Link Search Menu Expand Document

Convert SVG to PDF - C#

PDF SDK sample in C# demonstrating ‘Convert SVG to PDF’

using System;
using System.Diagnostics;
using System.Drawing.Printing;
using Bytescout.PDF.Converters;

namespace ConvertSvgToPdf
    class Program
        static void Main(string[] args)
            // HtmlToPdfConverter can convert HTML files with SVG content, or SVG files directly.
            using (HtmlToPdfConverter converter = new HtmlToPdfConverter())
                converter.PageSize = PaperKind.A4;
                converter.ConvertHtmlToPdf("drawing.svg", "result.pdf");
                // You can also pass a link instead of the input file:  
                //converter.ConvertHtmlToPdf("", "result.pdf");

            // Open result document in default associated application (for demo purpose)
            ProcessStartInfo processStartInfo = new ProcessStartInfo("result.pdf");
            processStartInfo.UseShellExecute = true;

Download Source Code (.zip)

Return to the previous page Explore PDF SDK