ExportOptionsSVG
ExportOptionsSVG
Section titled “ExportOptionsSVG”exportOptionsSVG
Description
Section titled “Description”Options for exporting a document as a SVG file, used with the Document.exportFile() method. All properties are optional.
When you export a document, the appropriate file extension is appended automatically. You should not include any file extension in the file specification.
Properties
Section titled “Properties”ExportOptionsSVG.artboardRange
Section titled “ExportOptionsSVG.artboardRange”exportOptionsSVG.artboardRange
Description
Section titled “Description”A range of artboards to save, if saveMultipleArtboards
is true
. A comma-delimited list of artboard names., or the empty string to save all artboards.
Default: empty String.
String.
ExportOptionsSVG.compressed
Section titled “ExportOptionsSVG.compressed”exportOptionsSVG.compressed
Description
Section titled “Description”If true
, the exported file should be compressed.
Default: false
.
Boolean.
ExportOptionsSVG.coordinatePrecision
Section titled “ExportOptionsSVG.coordinatePrecision”exportOptionsSVG.coordinatePrecision
Description
Section titled “Description”The decimal precision for element coordinate values.
Range: 1 to 7.
Default: 3.
Number (long)
ExportOptionsSVG.cssProperties
Section titled “ExportOptionsSVG.cssProperties”exportOptionsSVG.cssProperties
Description
Section titled “Description”How the CSS properties of the document should be included in the exported file.
Default: SVGCSSPropertyLocation.STYLEATTRIBUTES
.
ExportOptionsSVG.documentEncoding
Section titled “ExportOptionsSVG.documentEncoding”exportOptionsSVG.documentEncoding
Description
Section titled “Description”How the text in the document should be encoded.
Default: SVGDocumentEncoding.ASCII
.
ExportOptionsSVG.DTD
Section titled “ExportOptionsSVG.DTD”exportOptionsSVG.DTD
Description
Section titled “Description”The SVG version to which the file should conform.
Default: SVGDTDVersion.SVG1_1
.
ExportOptionsSVG.embedRasterImages
Section titled “ExportOptionsSVG.embedRasterImages”exportOptionsSVG.embedRasterImages
Description
Section titled “Description”If true
, the raster images contained in the document should be embedded in the exported file.
Default: false
.
Boolean.
ExportOptionsSVG.fontSubsetting
Section titled “ExportOptionsSVG.fontSubsetting”exportOptionsSVG.fontSubsetting
Description
Section titled “Description”Which font glyphs should be included in the exported file.
Default: SVGFontSubsetting.ALLGLYPHS
.
ExportOptionsSVG.fontType
Section titled “ExportOptionsSVG.fontType”exportOptionsSVG.fontType
Description
Section titled “Description”The type of font to included in the exported file.
Default: SVGFontType.CEFFONT
.
ExportOptionsSVG.includeFileInfo
Section titled “ExportOptionsSVG.includeFileInfo”exportOptionsSVG.includeFileInfo
Description
Section titled “Description”If true
, file information should be saved in the exported file.
Default: false
.
Boolean.
ExportOptionsSVG.includeUnusedStyles
Section titled “ExportOptionsSVG.includeUnusedStyles”exportOptionsSVG.includeUnusedStyles
Description
Section titled “Description”If true
, save unused styles in the exported file.
Default: false
.
Boolean.
ExportOptionsSVG.includeVariablesAndDatasets
Section titled “ExportOptionsSVG.includeVariablesAndDatasets”exportOptionsSVG.includeVariablesAndDatasets
Description
Section titled “Description”If true
, variables and datasets should be saved in the exported file.
Default: false
.
Boolean.
ExportOptionsSVG.optimizeForSVGViewer
Section titled “ExportOptionsSVG.optimizeForSVGViewer”exportOptionsSVG.optimizeForSVGViewer
Description
Section titled “Description”If true
, the exported file should be optimized for the SVG Viewer.
Default: false
.
Boolean.
ExportOptionsSVG.preserveEditability
Section titled “ExportOptionsSVG.preserveEditability”exportOptionsSVG.preserveEditability
Description
Section titled “Description”If true
, Illustrator editing capabilities should be preserved when exporting the document.
Default: false
.
Boolean.
ExportOptionsSVG.saveMultipleArtboards
Section titled “ExportOptionsSVG.saveMultipleArtboards”exportOptionsSVG.saveMultipleArtboards
Description
Section titled “Description”If true
, save the artboards specified by artboardRange in the exported file.
Default: false
.
Boolean.
ExportOptionsSVG.slices
Section titled “ExportOptionsSVG.slices”exportOptionsSVG.slices
Description
Section titled “Description”If true
, slice data should be exported with the file.
Default: false
.
Boolean.
ExportOptionsSVG.sVGAutoKerning
Section titled “ExportOptionsSVG.sVGAutoKerning”exportOptionsSVG.sVGAutoKerning
Description
Section titled “Description”If true
, SVG automatic kerning is allowed in the file.
Default: false
.
Boolean.
ExportOptionsSVG.sVGTextOnPath
Section titled “ExportOptionsSVG.sVGTextOnPath”exportOptionsSVG.sVGTextOnPath
Description
Section titled “Description”If true
, the SVG text-on-path construct is allowed in the file.
Default: false
.
Boolean.
ExportOptionsSVG.typename
Section titled “ExportOptionsSVG.typename”exportOptionsSVG.typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
Example
Section titled “Example”Exporting to SVG format
Section titled “Exporting to SVG format”// Exports current document to dest as an SVG file with specified options,// dest contains the full path including the file name
function exportFileToSVG(dest) { if (app.documents.length > 0) { var exportOptions = new ExportOptionsSVG(); exportOptions.embedRasterImages = true; exportOptions.embedAllFonts = false; exportOptions.fontSubsetting = SVGFontSubsetting.GLYPHSUSED;
var type = ExportType.SVG; var fileSpec = new File(dest);
app.activeDocument.exportFile(fileSpec, type, exportOptions); }}