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
close icon

Create Pdf with html not working - draw function not returning

Hi,

I try to create a grid in a pdf. In the grid I want to render a specific html with styling. But when I call the draw function, the code never came back.

I need to render html text with different font families and sizes in one cell. Maybe there is also a better way as I try? 
I attached the code.


Thanks and best regards

Sven


Attachment: PdfGridHtmlTest_42a057aa.zip

4 Replies

SN Santhiya Narayanan Syncfusion Team November 30, 2022 01:50 PM UTC

We were able to reproduce the reported issue with provided details on our end. Currently, we are validating on this and we will update the further details on December 2nd, 2022.



SN Santhiya Narayanan Syncfusion Team December 2, 2022 02:38 PM UTC

As of now, we have support only basic HTML tags for drawing, the provided html text have font facing inside the style tag, due to it takes the font data as text and taking more amount of time to layout. So we request you to use only basic supported html tags. You can find the supported tags from the following link.


https://help.syncfusion.com/file-formats/pdf/working-with-text#adding-a-html-styled-text



SB Sven Boris Bornemann December 2, 2022 02:51 PM UTC

Ok.

Is there a way to use the PdfHTMLTextElement? For example create multiple PdfHTMLTextElement with different fonts and concat them?


Something like this ways:

var richTextElement = new PdfHTMLTextElement(htmlText, font, PdfBrushes.Green);
var richTextElement2 = new PdfHTMLTextElement(htmlText, font, PdfBrushes.Black);
row2.Cells[1].Value = richTextElement + richTextElement2;




IJ Irfana Jaffer Sadhik Syncfusion Team December 5, 2022 01:25 PM UTC

As of now it is not possible because of we are supporting only basic set of elements.


Loader.
Live Chat Icon For mobile
Up arrow icon