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

How to convert SVG into PDF document?

Platform: WinForms |
Control: PDF
Tags: pdf, svgtopdf, webkit

The SVG file can be converted to PDF using WebKit HTML Converter. Please find the code example and sample below for the same.

 

Assemblies Required

  1. Syncfusion.Compression.Base.dll
  2. Syncfusion.HtmlConverter.Base.dll
  3. Syncfusion.Pdf.Base.dll
  4. QtBinaries folder

All the above-mentioned assemblies can be get by installing the WebKit installer available in the below link.

WebKit HTML Converter: https://www.syncfusion.com/downloads/latest-version

 

//Initialize HTML to PDF converter 
HtmlToPdfConverter htmlConverter = new HtmlToPdfConverter(HtmlRenderingEngine.WebKit);
 
WebKitConverterSettings settings = new WebKitConverterSettings();
 
//Set WebKit path
settings.WebKitPath = @"../../QtBinaries/";
 
//Assign WebKit settings to HTML converter
htmlConverter.ConverterSettings = settings;
 
//Convert a SVG file to PDF with HTML converter
PdfDocument document = htmlConverter.Convert(@"../../Sample.svg");
 
//Save and close the PDF document 
document.Save("Output.pdf");
 
document.Close(true);
 

 

Working Sample can be downloaded from the below link.

https://www.syncfusion.com/downloads/support/directtrac/general/ze/SVGToPDF1792257340

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

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

Up arrow icon

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

Live Chat Icon For mobile