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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

The text and images got cut off when converting html to pdf

Thread ID:





110688 Aug 21,2013 08:18 AM UTC Aug 23,2013 07:33 AM UTC ASP.NET Web Forms (Classic) 1
Tags: PDF
Lee K
Asked On August 21, 2013 08:18 AM UTC

Hello Syncfusion Team,
I encountered a problem when converting html to pdf. The text and image got cut off
The code snippet I was using:
 private void ConvertProcess()
            SizeF pageSize = page.GetClientSize();
            PdfUnitConvertor convertor = new PdfUnitConvertor();
            float width = convertor.ConvertToPixels(page.GetClientSize().Width, PdfGraphicsUnit.Pixel);
            using (HtmlConverter html = new HtmlConverter())
                html.EnableJavaScript = this.enableJS;
                html.AutoDetectPageBreak = this.autoDetectPageBreak;
                html.EnableHyperlinks = this.enableHyperlinks;
                    if (this.isMetaFile)
                        HtmlToPdfResult result = html.Convert(this.url, Syncfusion.HtmlConverter.ImageType.Metafile, (int)width, -1, AspectRatio.KeepWidth);
                        if (result != null)
                            PdfMetafile mf = new PdfMetafile(result.RenderedImage as Metafile);
                            mf.Quality = 100;
                            PdfMetafileLayoutFormat format = new PdfMetafileLayoutFormat();
                            format.Break = PdfLayoutBreakType.FitPage;
                            format.Layout = PdfLayoutType.Paginate;
                            this.doc.PageSettings.Height = result.RenderedImage.Size.Height + 1200;
                            format.SplitTextLines = false;
                            format.SplitImages = false;
                            result.Render(page, format);
                catch (Exception ex)
Could you please help me to correct it?. Appreciate your response.
Thanks in advance,
Lee K


KarthikeyanC [Syncfusion]
Replied On August 23, 2013 07:33 AM UTC

Hi Lee,

Thank you for your interest in Syncfusion products.


Could you please check if you have Internet Explorer version 9 installed in your machine? HtmlConverter makes use of MSHTML (IE rendering engine) to convert the webpage to image. With IE 9 there is a known issue that it generates only raster image which when drawn in PDF appears blurry and splitting could not be done properly. You can get more information on this from the following link:



As explained, to solve this, the key FEATURE_IVIEWOBJECTDRAW_DMLT9_WITH_GDI should be updated in the registry. Please run the utility placed in the following location to perform the above changes automatically.

Legacy Drawing.zip


Please try this and let me know if you have any questions.





This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon