Diagram class

Root element of Visio objects hierarchy.

new Diagram()

Methods

NameDescription
createDiagramFromStream(stream, callback) (static)Public class constructor, loads the diagram from the stream.
createDiagramFromStream(stream, format, callback) (static)Public class constructor, loads the diagram from the stream using predefined format.
createDiagramFromStream(stream, options, callback) (static)Public class constructor, loads the diagram from the file using predefined load file options.
save(diagram, stream, saveFormat) (static)Saves the diagram data to the stream.
save(diagram, stream, options) (static)Saves the diagram to a file using the specified save options.
addMaster(srcDiagram, masterName)Adds master to diagram from source diagram by master’s Name or NameU.
addMaster(templateFilePath, masterName)Adds master to diagram from template file by master’s Name or NameU.
addMaster(templateFilePath, masterID)Adds master to diagram from template file by master’s ID.
addShape(newShape, masterName, pageNumber)Adds shape created by master to specific page.
addShape(pinX, pinY, masterName, pageNumber)Adds shape created by master on page with defined PinX and PinY.
addShape(pinX, pinY, width, height, masterName, pageNumber)Adds shape created by master on page with defined PinX,PinY,Width and Height.
combine(secondDiagram)Combines another Diagram object.
constructor_overload$1(filename)Public class constructor, loads the diagram from the file.
constructor_overload$2(filename, format)Public class constructor, loads the diagram from the file using predefined format.
constructor_overload$3(filename, options)Public class constructor, loads the diagram from the file using predefined load file options.
copyTheme(source)Copies Theme from a source Diagram.
dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
getActivePage()Specifies the active page
getBuildnum()The build number of the Visio instance used to create the document.
getColors()Contains the document’s color table. Each document contains a single color table, which lists the 24 standard colors tha
getDataConnections()Contains the DataConnection elements for the document.
getDataRecordSets()The collection of DataRecordset objects associated with a Document object.
getDefaultFontDir()Get the Default Fonts folder path
getDocLangID()The unique ID of the user-interface language the user has specified in Microsoft Office 2010 Language Preferences.
getDocumentProps()Contains document property elements such as the document’s title, author, and so on.
getDocumentSettings()Contains elements that specify document settings.
getDocumentSheet()Specifies a document’s ShapeSheet structure.
getEmailRoutingData()Contains a MIME (Multipurpose Internet Mail Extensions) encoded MAPI e-mail routing slip for the document.
getEventItems()Contains an EventItem element for each event to which an object should respond.
getFonts()Contains a collection of Font elements
getHeaderFooter()Contains elements for a document’s header and footer.
getInterruptMonitor()Gets and sets the interrupt monitor.
getKey()Indicates whether the document has been modified outside of Visio. If present, Visio will fully test the contents of the
getMasters()Collection Master objects.
getMetric()Whether to use metric units in the drawing. Set this attribute to True (1) to use metric units; set it to False (0) to u
getPages()Collection Page objects.
getRibbonX()The Ribbon XML string that is passed to the document to customize the ribbon user interface.
getSolutionXMLs()XML value.
getStart()Indicates whether the document has been modified outside of Visio. If present, Visio will fully test the contents of the
getStyleSheets()Collection StyleSheet objects.
getUnusedStyles()Get unused Styles
getUserCustomUI()The Ribbon XML string that is passed to the document to customize the Quick Access toolbar or the ribbon.
getValidation()Stores information about diagram validation for the document.
getVbaProject()Gets the VbaProjectVbaProject.
getVbProjectData()Contains the Microsoft Visual Basic for Applications project data in MIME (Multipurpose Internet Mail Extensions) encode
getVersion()The version number of the Visio instance. Microsoft Visio 2010 = 14.
getWindows()Contains the Window elements for a document.
hasHiddenInfo()Indicates whether this diagram has hidden information.
layout(options)Lays out the shapes and/or reroutes the connectors for all pages of diagram.
print(printerName)Print the whole document to the specified printer,using the standard (no User Interface) print controller. If printerNam
print(printerName, options)Print the whole document to the specified printer,using the standard (no User Interface) print controller. If printerNam
print(printerName, documentName, options)Prints the document,using the standard (no User Interface) print controller and a document name.
print(printerName, documentName)Prints the document,using the standard (no User Interface) print controller and a document name.
removeHiddenInformation(item)Remove unused information
removeMacro()Removes VBA/macro from this diagram.
save(filename, format)Saves the diagram data to the file.
save(stream, saveOptions)Save the diagram to the stream.
save(filename, options)Saves the document to a file using the specified save options.
setBuildnum()The build number of the Visio instance used to create the document.
setDocLangID()The unique ID of the user-interface language the user has specified in Microsoft Office 2010 Language Preferences.
setEmailRoutingData()Contains a MIME (Multipurpose Internet Mail Extensions) encoded MAPI e-mail routing slip for the document.
setFontDirs()Indicates the Fonts folder path
setInterruptMonitor()Gets and sets the interrupt monitor.
setKey()Indicates whether the document has been modified outside of Visio. If present, Visio will fully test the contents of the
setMetric()Whether to use metric units in the drawing. Set this attribute to True (1) to use metric units; set it to False (0) to u
setRibbonX()The Ribbon XML string that is passed to the document to customize the ribbon user interface.
setStart()Indicates whether the document has been modified outside of Visio. If present, Visio will fully test the contents of the
setUserCustomUI()The Ribbon XML string that is passed to the document to customize the Quick Access toolbar or the ribbon.
setVbProjectData()Contains the Microsoft Visual Basic for Applications project data in MIME (Multipurpose Internet Mail Extensions) encode
setVersion()The version number of the Visio instance. Microsoft Visio 2010 = 14.

createDiagramFromStream(stream, callback) (static)

Public class constructor, loads the diagram from the stream.

ParameterTypeDescription
streamReadableStreamThe data stream
callbackCallbackThe callback function

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
var fs = require("fs");
var readStream = fs.createReadStream("example.vsdx");
aspose.diagram.Diagram.createDiagramFromStream(readStream, function(diagram, err) {
if (err) {
console.log("open error");
return;
}
diagram.save("output.vsdx", aspose.diagram.SaveFileFormat.VSDX);
});

createDiagramFromStream(stream, format, callback) (static)

Public class constructor, loads the diagram from the stream using predefined format.

ParameterTypeDescription
streamReadableStreamThe data stream
formatNumberA
callbackCallbackThe callback function

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
var fs = require("fs");
var readStream = fs.createReadStream("example.vsdx");
aspose.diagram.Diagram.createDiagramFromStream(readStream, aspose.diagram.LoadFileFormat.VSDX, function(diagram, err) {
if (err) {
console.log("open error");
return;
}
diagram.save("output.vsdx", aspose.diagram.SaveFileFormat.VSDX);
});

createDiagramFromStream(stream, options, callback) (static)

Public class constructor, loads the diagram from the file using predefined load file options.

ParameterTypeDescription
streamReadableStreamThe data stream
optionsLoadOptionsThe data
callbackCallbackThe callback function

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
var fs = require("fs");
var readStream = fs.createReadStream("example.vsdx");
options = new aspose.diagram.LoadOptions(aspose.diagram.LoadFileFormat.VSDX);
aspose.diagram.Diagram.createDiagramFromStream(readStream, options, function(diagram, err) {
if (err) {
console.log("open error: " + err);
return;
}
diagram.save("output.vsdx", aspose.diagram.SaveFileFormat.VSDX);
});

save(diagram, stream, saveFormat) (static)

Saves the diagram data to the stream.

ParameterTypeDescription
diagramDiagramThe diagram object to save
streamWritableStreamThe stream
saveFormatNumberA

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
var fs = require("fs");
var diagram = new aspose.diagram.Diagram("example.vsdx");
var writeStream = fs.createWriteStream("output-stream.vsdx");
aspose.diagram.Diagram.saveToStream(diagram, writeStream, aspose.diagram.SaveFileFormat.VSDX);

save(diagram, stream, options) (static)

Saves the diagram to a file using the specified save options.

ParameterTypeDescription
diagramDiagramThe diagram object to save
streamWritableStreamThe stream
optionsSaveOptionsSaveOptions

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
var fs = require("fs");
var diagram = new aspose.diagram.Diagram("example.vsdx");
var writeStream = fs.createWriteStream("output-stream.vsdx");
var options = new aspose.diagram.DiagramSaveOptions(aspose.diagram.SaveFileFormat.VSDX);
aspose.diagram.Diagram.saveToStream(diagram, writeStream, options);

addMaster(srcDiagram, masterName)

Adds master to diagram from source diagram by master’s Name or NameU.

ParameterTypeDescription
srcDiagramDiagramsource diagram.
masterNameStringMaster’s Name or NameU.

Returns: Number — Number The unique ID of the master within masters collection in this diagram.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram();
templateFileName = "NetApp-FAS-series.vss";
// Add master with stencil file path and master id
masterName = "FAS80xx rear empty";
diagram.addMaster(templateFileName, 2);
// Add master with stencil file path and master name
diagram.addMaster(templateFileName, masterName);
// adds master to diagram from source diagram
src = new aspose.diagram.Diagram(templateFileName);
diagram.addMaster(src, masterName);
// Adds shape with defined PinX and PinY.
diagram.addShape(2.0, 2.0, masterName, 0);
diagram.addShape(6.0, 6.0, masterName, 0);
// Adds shape with defined PinX,PinY,Width and Height.
diagram.addShape(7.0, 3.0, 1.5, 1.5, masterName, 0);
// Save resultant Image file
diagram.save("out-AddMasterFromStencil.vsdx", aspose.diagram.SaveFileFormat.VSDX);

addMaster(templateFilePath, masterName)

Adds master to diagram from template file by master’s Name or NameU.

ParameterTypeDescription
templateFilePathStringPath to template file(can be vdx, vst or vsd format).
masterNameStringMaster’s Name or NameU.

Returns: Number — Number The unique ID of the master within masters collection in this diagram.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram();
templateFileName = "NetApp-FAS-series.vss";
// Add master with stencil file path and master id
masterName = "FAS80xx rear empty";
diagram.addMaster(templateFileName, 2);
// Add master with stencil file path and master name
diagram.addMaster(templateFileName, masterName);
// adds master to diagram from source diagram
src = new aspose.diagram.Diagram(templateFileName);
diagram.addMaster(src, masterName);
// Adds shape with defined PinX and PinY.
diagram.addShape(2.0, 2.0, masterName, 0);
diagram.addShape(6.0, 6.0, masterName, 0);
// Adds shape with defined PinX,PinY,Width and Height.
diagram.addShape(7.0, 3.0, 1.5, 1.5, masterName, 0);
// Save resultant Image file
diagram.save("out-AddMasterFromStencil.vsdx", aspose.diagram.SaveFileFormat.VSDX);

addMaster(templateFilePath, masterID)

Adds master to diagram from template file by master’s ID.

ParameterTypeDescription
templateFilePathStringPath to template file(can be vdx, vst or vsd format).
masterIDNumberThe unique ID of the master within masters collection in template.

Returns: Number — Number The unique ID of the master within masters collection in this diagram.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram();
templateFileName = "NetApp-FAS-series.vss";
// Add master with stencil file path and master id
masterName = "FAS80xx rear empty";
diagram.addMaster(templateFileName, 2);
// Add master with stencil file path and master name
diagram.addMaster(templateFileName, masterName);
// adds master to diagram from source diagram
src = new aspose.diagram.Diagram(templateFileName);
diagram.addMaster(src, masterName);
// Adds shape with defined PinX and PinY.
diagram.addShape(2.0, 2.0, masterName, 0);
diagram.addShape(6.0, 6.0, masterName, 0);
// Adds shape with defined PinX,PinY,Width and Height.
diagram.addShape(7.0, 3.0, 1.5, 1.5, masterName, 0);
// Save resultant Image file
diagram.save("out-AddMasterFromStencil.vsdx", aspose.diagram.SaveFileFormat.VSDX);

addShape(newShape, masterName, pageNumber)

Adds shape created by master to specific page.

ParameterTypeDescription
newShapeShapeNew shape object
masterNameStringMaster’s name.
pageNumberNumberIndex of page.

Returns: long — long The unique ID of the shape within shapes collection on the specified page.

addShape(pinX, pinY, masterName, pageNumber)

Adds shape created by master on page with defined PinX and PinY.

ParameterTypeDescription
pinXNumberSpecifies the x-coordinate of the shape’s pin (center of rotation) in relation to the page.
pinYNumberSpecifies the y-coordinate of the shape’s pin (center of rotation) in relation to the page.
masterNameStringMaster’s name.
pageNumberNumberIndex of page.

Returns: long — long The unique ID of the shape within shapes collection on the specified page.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram();
templateFileName = "NetApp-FAS-series.vss";
// Add master with stencil file path and master id
masterName = "FAS80xx rear empty";
diagram.addMaster(templateFileName, 2);
// Add master with stencil file path and master name
diagram.addMaster(templateFileName, masterName);
// adds master to diagram from source diagram
src = new aspose.diagram.Diagram(templateFileName);
diagram.addMaster(src, masterName);
// Adds shape with defined PinX and PinY.
diagram.addShape(2.0, 2.0, masterName, 0);
diagram.addShape(6.0, 6.0, masterName, 0);
// Adds shape with defined PinX,PinY,Width and Height.
diagram.addShape(7.0, 3.0, 1.5, 1.5, masterName, 0);
// Save resultant Image file
diagram.save("out-AddMasterFromStencil.vsdx", aspose.diagram.SaveFileFormat.VSDX);

addShape(pinX, pinY, width, height, masterName, pageNumber)

Adds shape created by master on page with defined PinX,PinY,Width and Height.

ParameterTypeDescription
pinXNumberSpecifies the x-coordinate of the shape’s pin (center of rotation) in relation to the page.
pinYNumberSpecifies the y-coordinate of the shape’s pin (center of rotation) in relation to the page.
widthNumberSpecifies the width of the shape in inches.
heightNumberSpecifies the height of the shape in inches.
masterNameStringMaster’s name.
pageNumberNumberIndex of page.

Returns: long — long The unique ID of the shape within shapes collection on the specified page.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram();
templateFileName = "NetApp-FAS-series.vss";
// Add master with stencil file path and master id
masterName = "FAS80xx rear empty";
diagram.addMaster(templateFileName, 2);
// Add master with stencil file path and master name
diagram.addMaster(templateFileName, masterName);
// adds master to diagram from source diagram
src = new aspose.diagram.Diagram(templateFileName);
diagram.addMaster(src, masterName);
// Adds shape with defined PinX and PinY.
diagram.addShape(2.0, 2.0, masterName, 0);
diagram.addShape(6.0, 6.0, masterName, 0);
// Adds shape with defined PinX,PinY,Width and Height.
diagram.addShape(7.0, 3.0, 1.5, 1.5, masterName, 0);
// Save resultant Image file
diagram.save("out-AddMasterFromStencil.vsdx", aspose.diagram.SaveFileFormat.VSDX);

combine(secondDiagram)

Combines another Diagram object.

ParameterTypeDescription
secondDiagramDiagramAnother Diagram object.

constructor_overload$1(filename)

Public class constructor, loads the diagram from the file.

ParameterTypeDescription
filenameStringThe file name.

constructor_overload$2(filename, format)

Public class constructor, loads the diagram from the file using predefined format.

ParameterTypeDescription
filenameStringThe file name.
formatNumberLoadFileFormat

constructor_overload$3(filename, options)

Public class constructor, loads the diagram from the file using predefined load file options.

ParameterTypeDescription
filenameStringThe file name.
optionsLoadOptionsThe data

copyTheme(source)

Copies Theme from a source Diagram.

ParameterTypeDescription
sourceDiagramsource diagram.

dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

getActivePage()

Specifies the active page

getBuildnum()

The build number of the Visio instance used to create the document.

getColors()

Contains the document’s color table. Each document contains a single color table, which lists the 24 standard colors that are available for application to objects such as shapes, text, and layers in the document.

getDataConnections()

Contains the DataConnection elements for the document.

getDataRecordSets()

The collection of DataRecordset objects associated with a Document object.

getDefaultFontDir()

Get the Default Fonts folder path

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram("RetrieveFontInfo.vsd");
console.log(diagram.getDefaultFontDir());

getDocLangID()

The unique ID of the user-interface language the user has specified in Microsoft Office 2010 Language Preferences.

getDocumentProps()

Contains document property elements such as the document’s title, author, and so on.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram("Introduction.vsdx");
// Display Visio version and document modification time at different stages
console.log("Visio Instance Version : " + diagram.getVersion());
console.log("Full Build Number Created : " + diagram.getDocumentProps().getBuildNumberCreated());
console.log("Full Build Number Edited : " + diagram.getDocumentProps().getBuildNumberEdited());
console.log("Date Created : " + diagram.getDocumentProps().getTimeCreated());
console.log("Date Last Edited : " + diagram.getDocumentProps().getTimeEdited());
console.log("Date Last Printed : " + diagram.getDocumentProps().getTimePrinted());
console.log("Date Last Saved : " + diagram.getDocumentProps().getTimeSaved());

getDocumentSettings()

Contains elements that specify document settings.

getDocumentSheet()

Specifies a document’s ShapeSheet structure.

getEmailRoutingData()

Contains a MIME (Multipurpose Internet Mail Extensions) encoded MAPI e-mail routing slip for the document.

getEventItems()

Contains an EventItem element for each event to which an object should respond.

getFonts()

Contains a collection of Font elements

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram("RetrieveFontInfo.vsd");
fonts = diagram.getFonts();
for (var it = fonts.iterator(); it.hasNext();) {
font = it.next();
// Display information about the fonts
console.log(font.getName());
}

getHeaderFooter()

Contains elements for a document’s header and footer.

getInterruptMonitor()

Gets and sets the interrupt monitor.

getKey()

Indicates whether the document has been modified outside of Visio. If present, Visio will fully test the contents of the file. Omit for files you create outside of Visio.

getMasters()

Collection Master objects.

getMetric()

Whether to use metric units in the drawing. Set this attribute to True (1) to use metric units; set it to False (0) to use English units. The value of the property is BOOL integer constant.

getPages()

Collection Page objects.

getRibbonX()

The Ribbon XML string that is passed to the document to customize the ribbon user interface.

getSolutionXMLs()

XML value.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram("SolutionXML.vsdx");
// iterate through SolutionXML elements
for (it = diagram.getSolutionXMLs().iterator(); it.hasNext();) {
solutionXML = it.next();
// get name property
console.log(solutionXML.getName());
// get xml value
console.log(solutionXML.getXmlValue());
}

getStart()

Indicates whether the document has been modified outside of Visio. If present, Visio will fully test the contents of the file. Omit for files you create outside of Visio.

getStyleSheets()

Collection StyleSheet objects.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram("ApplyCustomStyleSheets.vsd");
sourceShape = null;
// get page by name
page = diagram.getPages().getPage("Flow 1");
// Find the shape that you want to apply style to
for (it = page.getShapes().iterator(); it.hasNext();) {
shape = it.next();
if (shape.getName() == "Process") {
sourceShape = shape;
break;
}
}
customStyleSheet = null;
// Find the required style sheet
for (it = diagram.getStyleSheets().iterator(); it.hasNext();) {
styleSheet = it.next();
if (styleSheet.getName() == "Callout") {
customStyleSheet = styleSheet;
break;
}
}
if (sourceShape != null && customStyleSheet != null) {
// Apply text style
sourceShape.setTextStyle(customStyleSheet);
// Apply fill style
sourceShape.setFillStyle(customStyleSheet);
// Apply line style
sourceShape.setLineStyle(customStyleSheet);
}
diagram.save("out-ApplyCustomStyleSheets.vdx", aspose.diagram.SaveFileFormat.VDX);

getUnusedStyles()

Get unused Styles

getUserCustomUI()

The Ribbon XML string that is passed to the document to customize the Quick Access toolbar or the ribbon.

getValidation()

Stores information about diagram validation for the document.

getVbaProject()

Gets the VbaProjectVbaProject.

getVbProjectData()

Contains the Microsoft Visual Basic for Applications project data in MIME (Multipurpose Internet Mail Extensions) encoded format.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram("Macro.vsdm");
// remove all macros
diagram.setVbProjectData(null);
// save the Visio diagram
diagram.save("out-RemoveMacros.vssm", aspose.diagram.SaveFileFormat.VSSM);

getVersion()

The version number of the Visio instance. Microsoft Visio 2010 = 14.

getWindows()

Contains the Window elements for a document.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram("TextBoxes.vsdx");
// iterate through the window elements
for (it = diagram.getWindows().iterator(); it.hasNext();) {
window = it.next();
console.log("ID: " + window.getID());
console.log("Type: " + window.getWindowType());
console.log("Window height: " + window.getWindowHeight());
console.log("Window width: " + window.getWindowWidth());
console.log("Window state: " + window.getWindowState());
}

hasHiddenInfo()

Indicates whether this diagram has hidden information.

layout(options)

Lays out the shapes and/or reroutes the connectors for all pages of diagram.

ParameterTypeDescription
optionsLayoutOptionsUsing the

print(printerName)

Print the whole document to the specified printer,using the standard (no User Interface) print controller. If printerName is Null or empty will be used default printer.

ParameterTypeDescription
printerNameStringThe name of the printer.Can be Null

Print the whole document to the specified printer,using the standard (no User Interface) print controller. If printerName is Null or empty will be used default printer.

ParameterTypeDescription
printerNameStringThe name of the printer.Can be Null
optionsPrintSaveOptionsThe print options.

Prints the document,using the standard (no User Interface) print controller and a document name.

ParameterTypeDescription
printerNameStringThe name of the printer.Can be Null
documentNameStringThe document name to display (for example, in a print status dialog box or printer queue) while printing the document.
optionsPrintSaveOptionsThe print options.

Prints the document,using the standard (no User Interface) print controller and a document name.

ParameterTypeDescription
printerNameStringThe name of the printer.Can be Null
documentNameStringThe document name to display (for example, in a print status dialog box or printer queue) while printing the document.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram("Pages.vsdx");
// call the print method to print whole Diagram using the printer name
// and set document name in the print job
diagram.print("Microsoft Print to PDF", "Job name while printing with Aspose.Diagram");

removeHiddenInformation(item)

Remove unused information

ParameterTypeDescription
itemNumberRemoveHiddenInfoItem.

removeMacro()

Removes VBA/macro from this diagram.

save(filename, format)

Saves the diagram data to the file.

ParameterTypeDescription
filenameStringThe file name.
formatNumberSaveFileFormat

save(stream, saveOptions)

Save the diagram to the stream.

ParameterTypeDescription
streamOutputStreamThe file stream.
saveOptionsSaveOptionsThe save options.

save(filename, options)

Saves the document to a file using the specified save options.

ParameterTypeDescription
filenameStringThe file name.
optionsSaveOptionsSaveOptions

setBuildnum()

The build number of the Visio instance used to create the document.

setDocLangID()

The unique ID of the user-interface language the user has specified in Microsoft Office 2010 Language Preferences.

setEmailRoutingData()

Contains a MIME (Multipurpose Internet Mail Extensions) encoded MAPI e-mail routing slip for the document.

setFontDirs()

Indicates the Fonts folder path

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
var fontDirs = ["C:\\MyFonts\\", "D:\\Misc\\Fonts\\"];
diagram = new aspose.diagram.Diagram("SpecifyFontLocation.vsdx");
// setting the custom font directories
diagram.setFontDirs(fontDirs);
// saving Visio diagram in PDF format
diagram.save("out-SpecifyFontLocation.pdf", aspose.diagram.SaveFileFormat.PDF);

setInterruptMonitor()

Gets and sets the interrupt monitor.

setKey()

Indicates whether the document has been modified outside of Visio. If present, Visio will fully test the contents of the file. Omit for files you create outside of Visio.

setMetric()

Whether to use metric units in the drawing. Set this attribute to True (1) to use metric units; set it to False (0) to use English units. The value of the property is BOOL integer constant.

setRibbonX()

The Ribbon XML string that is passed to the document to customize the ribbon user interface.

setStart()

Indicates whether the document has been modified outside of Visio. If present, Visio will fully test the contents of the file. Omit for files you create outside of Visio.

setUserCustomUI()

The Ribbon XML string that is passed to the document to customize the Quick Access toolbar or the ribbon.

setVbProjectData()

Contains the Microsoft Visual Basic for Applications project data in MIME (Multipurpose Internet Mail Extensions) encoded format.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram("Macro.vsdm");
// remove all macros
diagram.setVbProjectData(null);
// save the Visio diagram
diagram.save("out-RemoveMacros.vssm", aspose.diagram.SaveFileFormat.VSSM);

setVersion()

The version number of the Visio instance. Microsoft Visio 2010 = 14.