Convert PDF to SVG in C#
PDF to SVG
To create an SVG image from a PDF document, follow these steps:
- Create a
GdPictureDocumentConverter
object. - Load the source image by passing its path to the
LoadFromFile
method. Recommended: Specify the source image format with a member of theDocumentFormat
enumeration. - Save the output SVG image by passing its path to the
SaveAsSVG
method.
The example below creates an SVG image from a PDF document:
using GdPictureDocumentConverter gdpictureDocumentConverter = new GdPictureDocumentConverter();// Load the source document.gdpictureDocumentConverter.LoadFromFile(@"C:\temp\source.pdf", GdPicture14.DocumentFormat.DocumentFormatPDF);// Save the output in a new SVG image.gdpictureDocumentConverter.SaveAsSVG(@"C:\temp\output.svg");
Using gdpictureDocumentConverter As GdPictureDocumentConverter = New GdPictureDocumentConverter() ' Load the source document. gdpictureDocumentConverter.LoadFromFile("C:\temp\source.pdf", GdPicture14.DocumentFormat.DocumentFormatPDF) ' Save the output in a new SVG image. gdpictureDocumentConverter.SaveAsSVG("C:\temp\output.svg")End Using
Used methods
Related topics