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

SVG is missing in converted PDF.

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 

5 Replies

AS Abirami Selvan Syncfusion Team April 14, 2016 10:03 AM UTC

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.


RE Rekha April 22, 2016 05:35 AM UTC

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


AS Abirami Selvan Syncfusion Team April 25, 2016 05:40 AM UTC

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



RE Rekha April 26, 2016 01:36 PM UTC

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


AS Abirami Selvan Syncfusion Team April 27, 2016 10:54 AM UTC

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. 


Loader.
Live Chat Icon For mobile
Up arrow icon