How Can I Customize Border Styles in WinForms PDF?
Our WinForms PDF feature tour page can customize the color of the table border and border width in the PdfLightTable by using the BorderPen property.
Refer to the following code example to customize the border style in the table.
C#
// Creates a new PDF document.
PdfDocument doc = new PdfDocument();
// Adds a page.
PdfPage page = doc.Pages.Add();
// Acquires page's graphics.
PdfGraphics graphics = page.Graphics;
// Declares the PdfLightTable.
PdfLightTable pdfLightTable = new PdfLightTable();
// Customizes the color of the table border.
pdfLightTable.Style.BorderPen = new PdfPen(new PdfColor(168, 189, 238), 0.5F);
// Sets the DataSourceType as Direct.
pdfLightTable.DataSourceType = PdfLightTableDataSourceType.TableDirect;
// Creates columns.
pdfLightTable.Columns.Add(new PdfColumn("Roll Number"));
pdfLightTable.Columns.Add(new PdfColumn("Name"));
pdfLightTable.Columns.Add(new PdfColumn("Class"));
// Adds rows.
pdfLightTable.Rows.Add(new object[] { "111", "Maxim", "III" });
// Draws the PdfLightTable.
pdfLightTable.Draw(page, PointF.Empty);
// Saves the document.
doc.Save("Sample.pdf");
doc.Close(true);
Sample Link
http://www.syncfusion.com/downloads/support/directtrac/general/PdfLightTableSample-1780819773.zip
Conclusion
I hope you enjoyed learning about how you can customize border styles in WinForms PDF.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums or feedback portal. We are always happy to assist you!