aspose.diagram
Class SVGSaveOptions

Allows to specify additional options when rendering diagram pages to SVG.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

diagram = new aspose.diagram.Diagram("VisioSaveOptions.vsdx");

options = new aspose.diagram.SVGSaveOptions();

// value or the font is not installed locally, they may appear as a
// block,
// set the DefaultFont such as MingLiu or MS Gothic to show these
// characters.
options.setDefaultFont("MS Gothic");
// sets the 0-based index of the first page to render. Default is 0.
options.setPageIndex(0);

// set page size
pgSize = new aspose.diagram.PageSize(aspose.diagram.PaperSizeFormat.A_1);
options.setPageSize(pgSize);

diagram.save("out-UseSVGSaveOptions.svg", options);

Constructor Summary
SVGSaveOptions()
           Initializes a new instance of this class that can be used to save a document in the SaveFileFormat format.
 
Property Getters/Setters Summary
functiongetArea()
           Gets or sets the area of the shapes will be saved .
functiongetDefaultFont()
functionsetDefaultFont(value)
           When characters in the diagram are unicode and not be set with correct font value or the font is not installed locally, they may appear as block in pdf, image or XPS. Set the DefaultFont such as MingLiu or MS Gothic to show these characters.
functiongetEnlargePage()
functionsetEnlargePage(value)
           Specifies whether enlarge page .
functiongetExportElementAsRectTag()
functionsetExportElementAsRectTag(value)
           Defines whether need exporting rectangle elements as rect tag or not.
functiongetExportGuideShapes()
functionsetExportGuideShapes(value)
           Defines whether need exporting the guide shapes or not.
functiongetExportHiddenPage()
functionsetExportHiddenPage(value)
           Defines whether need exporting the hidden page or not.
functionisExportComments()
functionsetExportComments(value)
           Defines whether need exporting the comments or not.
functiongetPageIndex()
functionsetPageIndex(value)
           Gets or sets the 0-based index of the page to render. Default is 0.
functiongetPageSize()
functionsetPageSize(value)
           Gets or sets the page size for the generated images. Can be PageSize or null.
functiongetQuality()
functionsetQuality(value)
           Gets or sets a value determining the quality of the generated images to apply only when saving pages to the Jpeg format. The default value is 100
functiongetSaveFormat()
functionsetSaveFormat(value)
           Specifies the format in which the document will be saved if this save options object is used. The value of the property is SaveFileFormat integer constant.
functiongetShapes()
functionsetShapes(value)
           Gets or sets shapes to render. Default count is 0.
functiongetSVGFitToViewPort()
functionsetSVGFitToViewPort(value)
           if this property is true, the generated svg will fit to view port.
functiongetWarningCallback()
functionsetWarningCallback(value)
           Gets or sets warning callback.
 

Constructor Detail

SVGSaveOptions

function SVGSaveOptions()
Initializes a new instance of this class that can be used to save a document in the SaveFileFormat format.

Property Getters/Setters Detail

getPageIndex/setPageIndex : Number 

function getPageIndex() / function setPageIndex(value)
Gets or sets the 0-based index of the page to render. Default is 0.

getExportHiddenPage/setExportHiddenPage : boolean 

function getExportHiddenPage() / function setExportHiddenPage(value)
Defines whether need exporting the hidden page or not. Default value is true.

getQuality/setQuality : Number 

function getQuality() / function setQuality(value)
Gets or sets a value determining the quality of the generated images to apply only when saving pages to the Jpeg format. The default value is 100 Has effect only when saving to JPEG. The value must be between 0 and 100. The default value is 100.

getSVGFitToViewPort/setSVGFitToViewPort : boolean 

function getSVGFitToViewPort() / function setSVGFitToViewPort(value)
if this property is true, the generated svg will fit to view port.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

diagram = new aspose.diagram.Diagram("Pages.vsdx");
// get a particular page
page = diagram.getPages().getPage("Flow 2");
// set Visio page visiblity
page.getPageSheet().getPageProps().getUIVisibility().setValue(aspose.diagram.BOOL.TRUE);

// initialize SVG save options
options = new aspose.diagram.SVGSaveOptions();
// set export option of hidden Visio pages
options.setExportHiddenPage(false);
// Set SVG fit to view port
options.setSVGFitToViewPort(true);
// Set export element as Rectangle
options.setExportElementAsRectTag(true);

diagram.save("out-ExportOfHiddenVisioPagesToSVG.svg", options);

getExportElementAsRectTag/setExportElementAsRectTag : boolean 

function getExportElementAsRectTag() / function setExportElementAsRectTag(value)
Defines whether need exporting rectangle elements as rect tag or not. Default value is false.

getPageSize/setPageSize : PageSize 

function getPageSize() / function setPageSize(value)
Gets or sets the page size for the generated images. Can be PageSize or null. The default value is null. If PageSize is null then page size for generated image is obtained from source diagram.

getShapes/setShapes : ShapeCollection 

function getShapes() / function setShapes(value)
Gets or sets shapes to render. Default count is 0.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

diagram = new aspose.diagram.Diagram("LoadSaveConvert.vsdx");

// create an instance SVG save options class
options = new aspose.diagram.SVGSaveOptions();
shapes = options.getShapes();

// get shapes by page index and shape ID, and then add in the shape collection object
shapes.add(diagram.getPages().get(0).getShapes().getShape(1));
shapes.add(diagram.getPages().get(0).getShapes().getShape(2));

// save Visio drawing
diagram.save("out-SelectiveShapes_out.svg", options);

getArea : Float 

function getArea()
Gets or sets the area of the shapes will be saved . This property has effect only when saving to raster image formats.

getExportGuideShapes/setExportGuideShapes : boolean 

function getExportGuideShapes() / function setExportGuideShapes(value)
Defines whether need exporting the guide shapes or not. Default value is true.

isExportComments/setExportComments : boolean 

function isExportComments() / function setExportComments(value)
Defines whether need exporting the comments or not. Default value is false.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

diagram = new aspose.diagram.Diagram("Pages.vsdx");
// get a particular page
page = diagram.getPages().getPage("Flow 2");
// set Visio page visiblity
page.getPageSheet().getPageProps().getUIVisibility().setValue(aspose.diagram.BOOL.TRUE);

// initialize Image save options
options = new aspose.diagram.ImageSaveOptions(aspose.diagram.SaveFileFormat.JPEG);
// set export option of hidden Visio pages
options.setExportHiddenPage(false);
// set export option of comments
options.setExportComments(false);

diagram.save("out-ExportOfHiddenVisioPagesToImage.jpeg", options);

getEnlargePage/setEnlargePage : boolean 

function getEnlargePage() / function setEnlargePage(value)
Specifies whether enlarge page . If true - enlarge page. If false - not enlarge page. The default value is true.

getSaveFormat/setSaveFormat : Number 

function getSaveFormat() / function setSaveFormat(value)
Specifies the format in which the document will be saved if this save options object is used. The value of the property is SaveFileFormat integer constant.

getDefaultFont/setDefaultFont : String 

function getDefaultFont() / function setDefaultFont(value)
When characters in the diagram are unicode and not be set with correct font value or the font is not installed locally, they may appear as block in pdf, image or XPS. Set the DefaultFont such as MingLiu or MS Gothic to show these characters.

getWarningCallback/setWarningCallback : IWarningCallback 

function getWarningCallback() / function setWarningCallback(value)
Gets or sets warning callback.

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.