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 Tables Fonts

I am trying to use this code for changes the font inside cells

 

void tblPDF_BeginCellLayout(object sender, BeginCellLayoutEventArgs args)

{

 

 

var csfont = new Font("Arial", 8.0f);

var cspdfFont = new PdfTrueTypeFont(csfont, true);

var font = new Font("Calibri", 8.0f);

var pdfFont = new PdfTrueTypeFont(font, true);

if (args.CellIndex == 2)

 

 

 

 

{

 

(sender as Syncfusion.Pdf.Tables.PdfLightTable).Style.DefaultStyle.Font = cspdfFont;

 

 

}

 

else

 

 

{

 

(sender as Syncfusion.Pdf.Tables.PdfLightTable).Style.DefaultStyle.Font = pdfFont;

 

 

}

}

 

But the font is not changes at all! Any Ideas?


5 Replies

KC Karthikeyan Chandrasekar Syncfusion Team September 23, 2013 10:08 AM UTC

Hi Peer,

Thank you for using Syncfusion Products.

 

We can able to change the font for each cell in the PdfLightTable, I have attached a sample project which satisfied your requirement. Please let us know if you need any further assistance.

PdfLightTableVB.zip

 

Thanks.

Karthikeyan.C



PF Peer Fribo Jensen September 26, 2013 07:24 PM UTC

Yes it works fine. But is does not work for C#. Do you have an example for C#?



KC Karthikeyan Chandrasekar Syncfusion Team October 1, 2013 03:41 AM UTC

Hi Peer,

Thank you for your update.

I have attached a C# sample for your reference, please find the attachment below.

PdfLightTable.zip

Please let us know if you need any further assistance.

Thanks,

Karthikeyan.C



PF Peer Fribo Jensen October 1, 2013 12:40 PM UTC

Thanks for the solutions. It works file. But if I use the PDFViewer, the solutions does not  shown a TrueType font!



KC Karthikeyan Chandrasekar Syncfusion Team October 3, 2013 04:06 AM UTC

Hi Peer,

Thank you for your update.

 

Could you please create a Direct Trac incident with the title “Forum-112388- PdfViewer does not show a True Type font” along with the input Pdf Document. So that it will be easy for us to investigate in this.

 

Please let us know if you have any queries.

 

Thanks,

Karthikeyan.C


Loader.
Live Chat Icon For mobile
Up arrow icon