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?
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.
Thanks.
Karthikeyan.C
Yes it works fine. But is does not work for C#. Do you have an example for C#?
Hi Peer,
Thank you for your update.
I have attached a C# sample for your reference, please find the attachment below.
Please let us know if you need any further assistance.
Thanks,
Karthikeyan.C
Thanks for the solutions. It works file. But if I use the PDFViewer, the solutions does not shown a TrueType font!
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