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.
Unfortunately, activation email could not send to your email. Please try again.

SVG is missing in converted PDF.

Thread ID:

Created:

Updated:

Platform:

Replies:

123715 Apr 13,2016 08:46 AM Apr 27,2016 06:54 AM ASP.NET MVC 5
loading
Tags: PDF
Rekha
Asked On April 13, 2016 08:46 AM

Hi,

I am using "http://mvc.syncfusion.com/demos/web/pdf/htmltopdf" tool to convert webpage into PDF. 
I tried to convert "http://www.w3schools.com/svg/svg_inhtml.asp" webpage into pdf. This page has SVG embedded in it. Page gets converted into PDF.  But SVG is missing in it when I view that PDF using Adobe Reader. SVG is missing even when I view that PDF in browser using "Open Document inside Browser" option enabled.  It seems this tool is not converting SVG into PDF or there might be an alternate method for achieving this feature that I am not aware of. Please let me know how can I fix this issue.

Thank you,

Rekha 

Abirami Selvan [Syncfusion]
Replied On April 14, 2016 06:03 AM

Hi Rekha,
Thank you for contacting Syncfusion support.
When we try to convert the URL which you have provided , we can see the behavior SVG is not rendered correctly in output PDF document. We are internally using IE engine to convert the HTML to Image and then we are converting image to PDF. This issue occurs in IE engine itself. So we are suggesting you to use our new WebKit engine to convert SVG to PDF. We have created the sample for you reference.
Please refer to the sample in the following link:
http://www.syncfusion.com/downloads/support/forum/123715/ze/SVG_TO_PDF-1561571380
You can get WebKit installer in the following link:
https://www.syncfusion.com/downloads/latest-version (WebKitHTMLConverter)
Please refer to the following link for more details :
http://help.syncfusion.com/file-formats/pdf/working-with-document-conversions#conversion-using-webkit-rendering
Please try this and let us know if you need any further assistance.
Regards,
Abirami.

Rekha
Replied On April 22, 2016 01:35 AM

Thank you Abirami. The example helped us. And it is meeting our requirements. 

Abirami Selvan [Syncfusion]
Replied On April 25, 2016 01:40 AM

Hi Rekha,  
Thank you for your update.  Please let us know if you need any further assistance. 
Regards, 
Abirami. 


Rekha
Replied On April 26, 2016 09:36 AM

Hi Abirmani,

I am able to generate the PDFs using any HTML Template, so that certainly works. However ALL generated PDFs are plauged with following problem as seen in screenshot : http://screencast.com/t/6EvGR5UlXn, where white blank space is rendered towards end of the generated PDF. I have attached a sample PDF, so you can get a better sense of the white space. Also I have attached sample code, so you can easily recreate the problem.
Can you please propose how the additional white space can be rendered ?

Best Regards,
Rekha

Attachment: Sample_1cd013d5.zip

Abirami Selvan [Syncfusion]
Replied On April 27, 2016 06:54 AM

Hi Rekha, 
The behavior of the HTML to PDF converter is it will fit the content to the width of the page by default. So this leads to the large space below the HTML content. To overcome this we suggest you to increase the width of the PDF document or you can change the Viewport size accordingly. We have attached the sample for your reference. 
Please find the sample code example : 
WebKitConverterSettings webKitSettings = new WebKitConverterSettings(); 
//set orientation 
webKitSettings.Orientation = PdfPageOrientation.Landscape; 
//set view port 
webKitSettings.WebKitViewPort = new Size(1200, 1200); 
webKitSettings.WebKitPath = @"../../QtBinaries"; 
Please refer to the following sample: 
Please try this and let us know if you need any further assistance. 
Regards, 
Abirami. 


CONFIRMATION

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.

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.

;