←Select platform

IsSvgSupported Property

Summary

Indicates whether this document supports getting a page as SVG.

Syntax

C#
VB
Java
C++
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 through GetSvg is true, then the method will return an SVG document ready to be used. If IsSvgSupported is false, the method will return null.

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

You can override this behavior using the DocumentText.TextExtractionMode property.

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

  • All document formats supported by LEADTOOLS. This includes the likes of Microsoft Office formats (DOCX/DOC, XLSX/XLS, PPTX/PPT), HTML, Text, RTF, IOCA/MODCA, ePub and many more. 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. Any format that returns true for the value of IsVectorFile will be true as well.

  • SVG files naturally. The value of IsSvgViewingPreferred will be true as well.

  • Acrobat PDF document using PDFDocument.GetContentType and IsSvgSupported will be determined if the document has any text data that can be parsed:

  • If the return value is PDFContentType.Text, then the PDF document is "searchable" that contain any type of data and 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 a 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 benefits 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 document reports true and will be false if the document has no children or if all of the children report false.

Also, in a virtual document, it is recommended to use DocumentPage.IsSvgSupported instead of the global document version to determine if a certain page has support for SVG. The page simply calls DocumentPage.Images.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 19.0.2017.10.18
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Documents Assembly