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);
Constructor Summary |
---|
PdfSaveOptions()
Initializes a new instance of this class that can be used to save a document in the |
Property Getters/Setters Summary | ||
---|---|---|
function | getArea() | |
Gets or sets the area of the shapes will be saved . | ||
function | getCompliance() | |
function | setCompliance(value) | |
Desired conformance level for generated PDF document.
Default is |
||
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. | ||
function | getDigitalSignatureDetails() | |
function | setDigitalSignatureDetails(value) | |
Gets or sets a digital signature details. If not set, then no signing will be performed. | ||
function | getEncryptionDetails() | |
function | setEncryptionDetails(value) | |
Gets or sets a encryption details. If not set, then no encryption will be performed. | ||
function | getEnlargePage() | |
function | setEnlargePage(value) | |
Specifies whether enlarge page . | ||
function | getExportGuideShapes() | |
function | setExportGuideShapes(value) | |
Defines whether need exporting the guide shapes or not. | ||
function | getExportHiddenPage() | |
function | setExportHiddenPage(value) | |
Defines whether need exporting the hidden page or not. | ||
function | getHorizontalResolution() | |
function | setHorizontalResolution(value) | |
Gets or sets the horizontal resolution for generated images, in dots per inch. Applies generating image method except Emf format images. | ||
function | isExportComments() | |
function | setExportComments(value) | |
Defines whether need exporting the comments or not. | ||
function | getJpegQuality() | |
function | setJpegQuality(value) | |
Specifies the quality of JPEG compression for images (if JPEG compression is used). Default is 95. | ||
function | getPageCount() | |
function | setPageCount(value) | |
Gets or sets the number of pages to render in PDF. Default is MaxValue which means all pages of the diagram will be rendered. | ||
function | getPageIndex() | |
function | setPageIndex(value) | |
Gets or sets the 0-based index of the first page to render. Default is 0. | ||
function | getPageSavingCallback() | |
function | setPageSavingCallback(value) | |
Control/Indicate progress of page saving process. | ||
function | getPageSize() | |
function | setPageSize(value) | |
Gets or sets the page size for the generated images.
Can be |
||
function | getSaveForegroundPagesOnly() | |
function | setSaveForegroundPagesOnly(value) | |
Specifies whether all pages will be saved in image or only foreground. | ||
function | getSaveFormat() | |
function | setSaveFormat(value) | |
Specifies the format in which the rendered diagram pages will be saved if this save options object is used.
Can be |
||
function | getShapes() | |
function | setShapes(value) | |
Gets or sets shapes to render. Default count is 0. | ||
function | getSplitMultiPages() | |
function | setSplitMultiPages(value) | |
Defines whether split digram to multi pages according to page's setting. | ||
function | getTextCompression() | |
function | setTextCompression(value) | |
Specifies compression type to be used for all content streams except images.
Default is |
||
function | getVerticalResolution() | |
function | setVerticalResolution(value) | |
Gets or sets the vertical resolution for generated images, in dots per inch. Applies generating image method except Emf format image. | ||
function | getWarningCallback() | |
function | setWarningCallback(value) | |
Gets or sets warning callback. |
Constructor Detail |
---|
function PdfSaveOptions()
Property Getters/Setters Detail |
---|
getPageCount/setPageCount : Number | |
function getPageCount() / function setPageCount(value) |
getPageIndex/setPageIndex : Number | |
function getPageIndex() / function setPageIndex(value) |
getSaveFormat/setSaveFormat : Number | |
function getSaveFormat() / function setSaveFormat(value) |
getSaveForegroundPagesOnly/setSaveForegroundPagesOnly : boolean | |
function getSaveForegroundPagesOnly() / function setSaveForegroundPagesOnly(value) |
getCompliance/setCompliance : Number | |
function getCompliance() / function setCompliance(value) |
getEncryptionDetails/setEncryptionDetails : PdfEncryptionDetails | |
function getEncryptionDetails() / function setEncryptionDetails(value) |
getWarningCallback/setWarningCallback : IWarningCallback | |
function getWarningCallback() / function setWarningCallback(value) |
getPageSavingCallback/setPageSavingCallback : IPageSavingCallback | |
function getPageSavingCallback() / function setPageSavingCallback(value) |
getJpegQuality/setJpegQuality : Number | |
function getJpegQuality() / function setJpegQuality(value) |
getHorizontalResolution/setHorizontalResolution : Number | |
function getHorizontalResolution() / function setHorizontalResolution(value) |
getVerticalResolution/setVerticalResolution : Number | |
function getVerticalResolution() / function setVerticalResolution(value) |
getSplitMultiPages/setSplitMultiPages : boolean | |
function getSplitMultiPages() / function setSplitMultiPages(value) |
getExportHiddenPage/setExportHiddenPage : boolean | |
function getExportHiddenPage() / function setExportHiddenPage(value) |
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);
getTextCompression/setTextCompression : Number | |
function getTextCompression() / function setTextCompression(value) |
getDigitalSignatureDetails/setDigitalSignatureDetails : PdfDigitalSignatureDetails | |
function getDigitalSignatureDetails() / function setDigitalSignatureDetails(value) |
getPageSize/setPageSize : PageSize | |
function getPageSize() / function setPageSize(value) |
getShapes/setShapes : ShapeCollection | |
function getShapes() / function setShapes(value) |
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() |
getExportGuideShapes/setExportGuideShapes : boolean | |
function getExportGuideShapes() / function setExportGuideShapes(value) |
isExportComments/setExportComments : boolean | |
function isExportComments() / function setExportComments(value) |
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) |
getDefaultFont/setDefaultFont : String | |
function getDefaultFont() / function setDefaultFont(value) |