new PdfSaveOptions()

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

Example

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram("VisioSaveOptions.vsdx");
// Options when saving a diagram into the PDF format
options = new aspose.diagram.PdfSaveOptions();
// discard saving background pages of the Visio diagram
options.setSaveForegroundPagesOnly(true);
// specify the quality of JPEG compression for images (if JPEG
// compression is used). Default is 95.
options.setJpegQuality(100);
// specify default font name
options.setDefaultFont("Arial");
// conformance level for generated PDF document.
options.setCompliance(aspose.diagram.PdfCompliance.PDF_15);
// Load the certificate from disk.
// The other constructor overloads can be used to load certificates from
// different locations.
cert = new aspose.diagram.X509Certificate2();
// sets a digital signature details. If not set, then no signing will be
// performed.
options.setDigitalSignatureDetails(
new aspose.diagram.PdfDigitalSignatureDetails(
cert,
"Test Signing",
"Aspose Office",
aspose.diagram.DateTime.getNow(),
aspose.diagram.PdfDigitalSignatureHashAlgorithm.SHA_256));
// set encription details
encriptionDetails = new aspose.diagram.PdfEncryptionDetails("user password", "Owner Password",
aspose.diagram.PdfEncryptionAlgorithm.RC_4_128);
options.setEncryptionDetails(encriptionDetails);
// sets the number of pages to render in PDF.
options.setPageCount(2);
// 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);
// save in any supported file format
diagram.save("out-UsePDFSaveOptions.pdf", options);

Methods

getCompliance()

Desired conformance level for generated PDF document. Default is PdfCompliance.PDF_15. The value of the property is PdfCompliance integer constant.

getDefaultFont()

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.

getEmfRenderSetting()

Setting for rendering Emf metafile. The value of the property is EmfRenderSetting integer constant. EMF metafiles identified as "EMF+ Dual" can contain both EMF+ records and EMF records. Either type of record can be used to render the image, only EMF+ records, or only EMF records. When EmfPlusPrefer is set, then EMF+ records will be parsed , otherwise only EMF records will be parsed. Default value is EmfOnly"/>.

getEncryptionDetails()

Gets or sets a encryption details. If not set, then no encryption will be performed.

getEnlargePage()

Specifies whether enlarge page . If true - enlarge page. If false - not enlarge page. The default value is true.

getExportGuideShapes()

Defines whether need exporting the guide shapes or not. Default value is true.

getExportHiddenPage()

Defines whether need exporting the hidden page or not. Default value is true.

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 PDF save options
options = new aspose.diagram.PdfSaveOptions();
// set export option of hidden Visio pages
options.setExportHiddenPage(false);
diagram.save("out-ExportOfHiddenVisioPagesToPDF.pdf", options);

getHorizontalResolution()

Gets or sets the horizontal resolution for generated images, in dots per inch. Applies generating image method except Emf format images. The default value is 96.

getJpegQuality()

Specifies the quality of JPEG compression for images (if JPEG compression is used). Default is 95.

getPageCount()

Gets or sets the number of pages to render in PDF. Default is MaxValue which means all pages of the diagram will be rendered.

getPageIndex()

Gets or sets the 0-based index of the first page to render. Default is 0.

getPageSavingCallback()

Control/Indicate progress of page saving process.

getPageSize()

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.

getSaveForegroundPagesOnly()

Specifies whether all pages will be saved in image or only foreground. If true - rendered only foreground pages(with background if present). If false - rendered foreground pages(with background if present) after that empty background pages. Can return true only when PageCount > 1. The default value is false.

getSaveFormat()

Specifies the format in which the rendered diagram pages will be saved if this save options object is used. Can be SaveFileFormat only. The value of the property is SaveFileFormat integer constant.

getShapes()

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);

getSplitMultiPages()

Defines whether split diagram to multi pages according to page's setting. Default value is false.

getTextCompression()

Specifies compression type to be used for all content streams except images. Default is PdfTextCompression.FLATE. The value of the property is PdfTextCompression integer constant.

getVerticalResolution()

Gets or sets the vertical resolution for generated images, in dots per inch. Applies generating image method except Emf format image. The default value is 96.

getWarningCallback()

Gets or sets warning callback.

isExportComments()

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);

setCompliance()

Desired conformance level for generated PDF document. Default is PdfCompliance.PDF_15. The value of the property is PdfCompliance integer constant.

setDefaultFont()

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.

setEmfRenderSetting()

Setting for rendering Emf metafile. The value of the property is EmfRenderSetting integer constant. EMF metafiles identified as "EMF+ Dual" can contain both EMF+ records and EMF records. Either type of record can be used to render the image, only EMF+ records, or only EMF records. When EmfPlusPrefer is set, then EMF+ records will be parsed , otherwise only EMF records will be parsed. Default value is EmfOnly"/>.

setEncryptionDetails()

Gets or sets a encryption details. If not set, then no encryption will be performed.

setEnlargePage()

Specifies whether enlarge page . If true - enlarge page. If false - not enlarge page. The default value is true.

setExportComments()

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);

setExportGuideShapes()

Defines whether need exporting the guide shapes or not. Default value is true.

setExportHiddenPage()

Defines whether need exporting the hidden page or not. Default value is true.

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 PDF save options
options = new aspose.diagram.PdfSaveOptions();
// set export option of hidden Visio pages
options.setExportHiddenPage(false);
diagram.save("out-ExportOfHiddenVisioPagesToPDF.pdf", options);

setHorizontalResolution()

Gets or sets the horizontal resolution for generated images, in dots per inch. Applies generating image method except Emf format images. The default value is 96.

setJpegQuality()

Specifies the quality of JPEG compression for images (if JPEG compression is used). Default is 95.

setPageCount()

Gets or sets the number of pages to render in PDF. Default is MaxValue which means all pages of the diagram will be rendered.

setPageIndex()

Gets or sets the 0-based index of the first page to render. Default is 0.

setPageSavingCallback()

Control/Indicate progress of page saving process.

setPageSize()

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.

setSaveForegroundPagesOnly()

Specifies whether all pages will be saved in image or only foreground. If true - rendered only foreground pages(with background if present). If false - rendered foreground pages(with background if present) after that empty background pages. Can return true only when PageCount > 1. The default value is false.

setSaveFormat()

Specifies the format in which the rendered diagram pages will be saved if this save options object is used. Can be SaveFileFormat only. The value of the property is SaveFileFormat integer constant.

setShapes()

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);

setSplitMultiPages()

Defines whether split diagram to multi pages according to page's setting. Default value is false.

setTextCompression()

Specifies compression type to be used for all content streams except images. Default is PdfTextCompression.FLATE. The value of the property is PdfTextCompression integer constant.

setVerticalResolution()

Gets or sets the vertical resolution for generated images, in dots per inch. Applies generating image method except Emf format image. The default value is 96.

setWarningCallback()

Gets or sets warning callback.