←Select platform

IsSvgSupported Property

Summary

Gets a value that indicates whether this document supports getting a page in SVG format.

Syntax
C#
VB
C++
Java
public virtual bool IsSvgSupported {get;} 
Public Overridable ReadOnly Property IsSvgSupported() As Boolean 
   Get 
public:  
   virtual property bool IsSvgSupported 
   { 
      bool get() 
   } 
public boolean isSvgSupported() 

Property Value

true if this document supports getting a page as SVG; otherwise, false.

Remarks

Use IsSvgSupported to determine whether an SVG (Scalable Vector Graphics) representation of a page can be obtained by calling GetSvg. If IsSvgSupported is true, then when GetSvg is called the method will return an SVG document ready to be used. If IsSvgSupported is false, the GetSvg will return null.

The GetText method uses IsSvgSupported to determine how this method works, as follows:

Override this behavior using the DocumentText.TextExtractionMode property.

The framework uses logic similar to RasterCodecs.CanLoadSvg in order to determine SVG support. Currently, SVG support is provided by the following types of documents:

  • All document formats supported by LEADTOOLS. This includes Microsoft Office formats (DOCX/DOC, XLSX/XLS, PPTX/PPT), HTML, Text, RTF, IOCA/MODCA, ePub, and many more. For any format that returns true for the value of CodecsImageInfo.Document.IsDocumentFile, the value of IsSvgViewingPreferred will be true as well.

  • Vector file formats such DXF, DWG, DWF. For any format that returns true for the value of IsVectorFile, the value of IsSvgSupported will be true as well.

  • SVG files (naturally). The value of IsSvgViewingPreferred will also be true.

  • For Acrobat PDF documents, both PDFDocument.GetContentType and IsSvgSupported are used to determine whether the document has any text data that can be parsed, as follows:

  • If the return value is PDFContentType.Text, then the PDF document is "searchable" and contains some type of data. IsSvgSupported will be true and the value of IsSvgViewingPreferred will be set to true as well.

  • If the return value is PDFContentType.ImageOverText, then the PDF document is searchable with an overlay image on top of each page. IsSvgSupported will be true, since the document has text than can be parsed. The value of IsSvgViewingPreferred will be set to false, however, since viewing a page from this document as SVG will not have any benefit because the SVG data is hidden behind an overlay image.

  • If the return value is PDFContentType.Image, then the PDF document is pure raster with no other content besides an image for each page (for example, a scanned document). IsSvgSupported will be false since the document does not have any text than can be parsed. The value of IsSvgViewingPreferred will be set to false as well.

Note that when the value of IsSvgSupported is false, then the value of IsSvgViewingPreferred will always be false, too.

Note that if this is a virtual document with children, then the value of this property will be true if any of the child documents reports true, and will be false if the document either has no children or if all the children report false.

Also, in a virtual document, it is best to use DocumentPage.IsSvgSupported instead of the global document version to determine if a certain page has support for SVG. The page simply calls IsSvgSupported and returns the value from its original document. The LEADTOOLS Document Viewer uses this value to determine if a page has support for SVG.

Example

For an example, refer to DocumentImages.

Requirements

Target Platforms

Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document Assembly