Convert PDF to SVG in C#

PDF to SVG

To create an SVG image from a PDF document, follow these steps:

  1. Create a GdPictureDocumentConverter object.
  2. Load the source image by passing its path to the LoadFromFile method. Recommended: Specify the source image format with a member of the DocumentFormat enumeration.
  3. 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");