Home

Awesome

PdfToSvg.NET

Tests NuGet License MIT

Fully managed library for converting PDF files to SVG. Potential usage is seamlessly embedding PDFs on your site without the need of a PDF reader.

🚀 Test it online    🏠 Homepage    📖 API documentation    📜 Release notes

Features

Quick start

Install the PdfToSvg.NET NuGet package.

PM> Install-Package PdfToSvg.NET

Open a PDF document by calling PdfDocument.Open. Call SaveAsSvg() on each page to convert it to an SVG file.

using (var doc = PdfDocument.Open("input.pdf"))
{
    var pageNo = 1;

    foreach (var page in doc.Pages)
    {
        page.SaveAsSvg($"output-{pageNo++}.svg");
    }
}

Note that if you parse the XML returned from PdfToSvg.NET, you need to preserve space and not add indentation. Otherwise text will not be rendered correctly in the modified markup.

Command line usage

You can also download the CLI version of PdfToSvg.NET and use it from the command line.

pdftosvg.exe input.pdf output.svg

Command line reference