70001965 Reduce the size of svg export

Article 70001965
Type Wish
Product Engine
Version 9001
Date Added 5/8/2021 12:00:00 AM
Fixed 9.9002.0.2 (5/10/2021 12:00:00 AM)
Submitted by Enrico Ossimprandi

Summary

Reduce the size of svg export

Solution

A new property SVGExportProperties of vdDocument.FileProperties was added in version 9002.0.2
Get/Set the SVG export properties used when saving in SVG format.
it can get one or more of the follwoing values
None = 0,//No extra flags
IndentXMLElements = 1,// Formats output svg xml by adding new line characters and tab spaces.This will increase the size of output file
WriteLayerInfo = 2,// Write referenced layer name for each svg element.This will increase the size of output file
TextBoundaryPointerEvents = 4,//Overwrite pointer event for text elements.Text elements are selected by their bounding Box.This will increase the size of output file
UrlElementLink = 8,//Add xlink for each element that have url property.This will increase the size of output file
ToolTipElement = 16,//Add title for each element with ToolTip.This will increase the size of output file
SolidFill2d_HatchMode = 32,//Add the solid fill areas as single boundaries and with out using default VDF polygon clipper.This will decrease the size of output file
Default = WriteLayerInfo | UrlElementLink | ToolTipElement,// The default flags used for SVG export



NOTE:
vdDocument.FileProperties.SVGExportProperties is saved by the drawing
Default value is SVGExportProperties.Default = WriteLayerInfo | UrlElementLink | ToolTipElement

Set vdDocument.FileProperties.SVGExportProperties = SolidFill2d_HatchMode for minimal output file size.

Send comments on this topic.