Category / Section
How to draw a PdfLightTable within a fixed boundary?
1 min read
You can draw the PdfLightTable within a fixed boundary by using the Draw(PdfPage, RectangleF) method. The following code example and sample demonstrate the same.
C#
//Creating Instance for Pdf Document. PdfDocument document = new PdfDocument(); //Adding new page. PdfPage page = document.Pages.Add(); //Initialising PdfLightTable PdfLightTable pdfLightTable = new PdfLightTable(); //Loading Data Source in PdfLightTable. pdfLightTable.DataSource = GetProductsDataSet(); //Drawing the PdfLightTable with fixed boundary. pdfLightTable.Draw(page, new RectangleF(100, 100, 300, 400)); // Save and close the document. document.Save("Sample.pdf"); document.Close(true);
Sample link:
http://www.syncfusion.com/downloads/support/directtrac/general/PdfLightTable1293312947.zip