We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

PDF Font Style

Is there a way to set both BOLD and UNDERLINE at the same time for a table cell? Here is an example of my code to set the text BOLD, how can I adjust it to make it both BOLD and Underline:

Dim table_ As PdfLightTable = New PdfLightTable()
table_.DataSourceType = PdfLightTableDataSourceType.TableDirect

'make the table borders transparent
Dim borderPen_ As PdfPen = New PdfPen(Color.Transparent)
borderPen_.Width = 1.0F

'Create a default style for our table
Dim defStyle_ As PdfCellStyle = New PdfCellStyle()
defStyle_.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 10, PdfFontStyle.Bold)
defStyle_.BorderPen = borderPen_

'set custom table style properties
table_.Style.DefaultStyle = defStyle_



1 Reply

SP Selvakumar P Syncfusion Team November 9, 2010 01:18 PM UTC

Hi james,

Thank you for using Syncfusion Products.

It is possible to set the font style as both Bold and Underline in a PdfTable.Please look into the code snippet given below:

'Setting FontStyle as both Bold and Underline
defStyle_.Font = New PdfStandardFont(PdfFontFamily.Helvetica, 10, PdfFontStyle.Bold Or PdfFontStyle.Underline)

and also refer with the sample which we have posted,

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=PdfFontStyle877645221.zip

regards,
Selvakumar


Loader.
Live Chat Icon For mobile
Up arrow icon