ImageGear for .NET User Guide > Using ImageGear for .NET > Using ImageGear.Formats.PDF Namespace > PDF to SVG Converter |
ImageGear for .NET provides the ability to convert and save any page from a PDF document to a Scalable Vector Graphics (SVG) file. This can be done by using one of the following API calls:
Since SVG format is not a multi-page format, the SaveDocument API called with default options will only convert and save the first page of the provided PDF document.
ImageGear for .NET PDF to SVG converter is optimized to provide the best text fidelity results. For that purpose, all PDF text elements are converted to SVG outlining paths, which are not searchable for text.
ImageGear for .NET PDF to SVG color converter applies the default color space defined in the PDF document. If no default color space is defined, all PDF colors defined in CMYK color space are converted to RGB using the Windows ICM and the color profiles enabled in the ImageGear for .NET color profile manager. The color profile transformation uses the ICC profile specified in ImGearColorProfileManager.CmykProfile. If this is not set, then the default color profile distributed with ImageGear for .NET (ig_cmyk_profile.icm) is used.
ImageGear for .NET PDF to SVG converter requires “Content Copying” permission to the source PDF document to be granted, which means that if a PDF document is secured, it should be opened with the password that allows access to its internals.
If this permission is not granted, the ImageGear for .NET PDF to SVG converter will turn on the rasterizaton mode for this document, which will rasterize any PDF page from this document prior to converting to SVG. The resolution of the raster image embedded to SVG will be set using the PDF control parameters.
Most SVG viewers, including Internet Explorer, Chrome, and Firefox browsers, enable edge anti-aliasing, but do not allow turning it off. Although in most cases anti-aliasing makes vector graphics look much better and smoother, there are cases when anti-aliasing leads to unintended SVG rendering effects like the following:
While the ImageGear for .NET PDF renderer provides enhanced rendering of thin lines when a PDF page is zoomed out, ensuring that 1 pixel lines are still visible even when the page is zoomed far out, SVG viewers normally don’t support that. So, thin lines converted from PDF will have the correct widths in SVG, but will be scaled proportionally and may disappear if a page is zoomed out too much.