Gets this page as an SVG document with the specified options.
public SvgDocument getSvg(CodecsLoadSvgOptions options)
Options to use when creating the SVG document. It can be used to drop images, text or shapes from the returned document
if they are not needed. If this value can is null, then the SVG document is returned as is without modifications.
The SVG document of this page if found or null.
The options parameter controls how the SVG document is generated. A common use is to load the SVG without any image elements that may contain large embedded data. This data is Base64 encoded which result in even bigger memory size for the SVG data. One workaround for this is to use DropImages in options. The result SVG document will only contain the text and vector shapes and will a small memory footprint. Then, GetSvgBackImage can be called to return a raster image that contain the dropped image elements separately.
This method works as follows (the "item" is an SVG document with the specified options):
If this document does not support SVG (the value of DocumentImages.IsSvgSupported is false), then this method will return null.
If this is an original page in the source document file (the value of OriginalPageNumber is not -1), then RasterCodecs is used to load the SvgDocument object from the original page using RasterCodecs.LoadSvg.
If this is not an original page in the source document file (the value of OriginalPageNumber is not 1), then a new SvgDocument object is created based on the page size and resolution and the default values in DocumentImages.
If this document uses the cache system (Document.HasCache is true), then the SvgDocument object is saved to the cache before it is returned. Next time this method is called, the SVG will be returned from the cache directly without loading it from the file or creating a new instance.
Note that if SetSvg has been previously called with a null object for the svg parameter, then this method will return null as well.
The LEADTOOLS Document Viewer uses this method to obtain the SVG document for the page when the view mode is "SVG".
The LEADTOOLS Document Converter uses this method to obtain the SVG document for the page when converting without using OCR.
Refer to Loading Using LEADTOOLS Documents Library for more information.
For an example, refer to DocumentPage.