PdfToSvg Namespace

To convert a PDF file to SVG, start by creating a PdfDocument. Then use either SaveAsSvg(String, SvgConversionOptions, CancellationToken) or ToSvgString(SvgConversionOptions, CancellationToken) to save each page as SVG.

Convert PDF to SVG
using (var doc = PdfDocument.Open("input.pdf"))
{
    var pageIndex = 0;

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

By default, PdfToSvg.NET will try to extract fonts embedded in the PDF and embed them in the output SVG as data URLs. This behavior can be changed by specifying another FontResolver.

Classes

DocumentInfoProvides information about a PDF document.
DocumentPermissionsProvides information about which operations to a PdfDocument that are allowed by the document author.
FileAttachmentProvides access to an embedded file attached to a PDF document.
FileAttachmentCollectionRead only collection of files attached to a PDF page.
FontRepresents a substitute font to be used in the generated SVG markup.
FontResolverResolves which font to be used for text in the SVG, for a given PDF font name.
ImageProvides information about an image in a PDF document.
ImageResolverResolves an image URL for an image encountered in a PDF document.
InlinedFontRepresents a font whose glyphs are inlined as paths and other elements within the SVG markup.
InvalidCredentialExceptionRepresents errors that occur when a document is password protected, but an incorrect password is specified or not specified at all.
LocalFontRepresents a font that is assumed to be installed on the machine viewing the SVG.
OpenOptionsProvides additional configuration options for opening a PdfDocument.
PdfDocumentContains information about a loaded PDF file.
PdfExceptionRepresents errors that can occur while loading and converting a PDF file. This is the base class for all library specific exceptions.
PdfPageRepresents a single page in a PDF document.
PdfPageCollectionRead only collection of PdfPage objects.
PermissionExceptionRepresents errors that occurs when an attempt is made to perform an operation not allowed by the document author.
SourceFontContains information about a font used in the PDF document.
SvgConversionOptionsContains options affecting the behavior when a PDF page is converted to SVG.
WebFontUses a web font in the resulting SVG markup.

Enumerations

FontStyleSpecifies font styles.
FontWeightSpecifies font weights.