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

Issues converting from html to pdf

I was trying to convert a HTML string to a pdf file. I used the HTMLConvertor to convert the html string to an image using

HtmlConverter htmlConvertor = new HtmlConverter();
System.Drawing.Image srcImage = htmlConvertor.FromString(strHtml, ImageType.Metafile);

This worked fine. Now I converted this to a pdf using

IPDFGraphicState properties = doc.CreateGraphicState();
properties.SplitImages = true;
properties.BreakBehavior = AutoBreakBehavior.MultiLineTextBreak;

doc.LastPage.Graphics.DrawImage(PointF.Empty, srcImage, dest, properties);

When I convert this to pdf, I saw that there is some loss of data. The last couple of lines in my HTML were missing from the pdf generated.

Any idea if there is a work around for thsi issue?

Thanks.

2 Replies

SA Sangeetha September 28, 2007 06:20 PM UTC

More details on the issue:

This only happens with certain screen resolutions. When we do the conversion, with certain screen resolutions, there is no problem with the PDF generated. But with others, some content is not visible in the PDF. NOTE that the content is there in the PDF (If you select all the data in the pdf, copy it and paste it into any editor, you will see all the contents) It is just invisible.

I tried the following screen resolutions

800 * 600 - NO ISSUES
1024 * 768 - NO ISSUES
1152 * 864 - NO ISSUES
1280 * 720 - SOME CONTENT IN PDF NOT VISIBLE
1280 * 768 - SOME CONTENT IN PDF NOT VISIBLE
1280 * 7024 - SOME CONTENT IN PDF NOT VISIBLE

Any idea on how to get around this problem in syncfusion?

Thanks.
Sangeetha.


AD Administrator Syncfusion Team October 4, 2007 03:58 AM UTC

Hi Sangeetha,

Please followup the DirectTrac incident created in this regard.

Thanks,
Jaya

Loader.
Live Chat Icon For mobile
Up arrow icon