Constructor Summary |
---|
Page()
Constructor. |
Page(ID)
Constructor. |
Property Getters/Setters Summary | ||
---|---|---|
function | getAssociatedPage() | |
function | setAssociatedPage(value) | |
The ID of the original drawing page that was marked up on separate markup overlays by reviewers of the drawing. | ||
function | getBackground() | |
function | setBackground(value) | |
A flag indicating if the page is a background page. The value of the property is BOOL integer constant. | ||
function | getBackPage() | |
function | setBackPage(value) | |
The page's background page. | ||
function | getConnects() | |
Contains a Connect element for each connection between two shapes in a drawing. | ||
function | getID() | |
function | setID(value) | |
The unique ID of the element within its parent element. | ||
function | getName() | |
function | setName(value) | |
The name of the element. | ||
function | getNameU() | |
function | setNameU(value) | |
The universal name of the element. | ||
function | getPages() | |
function | setPages(value) | |
Page collection. | ||
function | getPageSheet() | |
Contains elements that define the page sheet for a Page or Master element. | ||
function | getReviewerID() | |
function | setReviewerID(value) | |
The ID of the reviewer associated with the markup overlay. | ||
function | getShapes() | |
Shape collection. | ||
function | getViewCenterX() | |
function | setViewCenterX(value) | |
ViewCenterX and ViewCenterY specify a center point on a page that a new view (window) assumes when it is opened initially. | ||
function | getViewCenterY() | |
function | setViewCenterY(value) | |
ViewCenterX and ViewCenterY specify a center point on a page that a new view (window) assumes when it is opened initially. | ||
function | getViewScale() | |
function | setViewScale(value) | |
The default magnification factor to use when a new view (window) of the page is opened. For example, 1 = 100%; 1.5 = 150%, and so on. |
Method Summary | ||
---|---|---|
function | addActiveXControl(type, pinX, pinY, width, height) | |
Creates an Activex Control. | ||
function | addComment(shape, comment) | |
Adds comment to a shape. | ||
function | addComment(pinX, pinY, comment) | |
Adds comment with defined PinX and PinY. | ||
function | addComment(shapeID, comment) | |
Adds comment to a shape with shape's id. | ||
function | addShape(newShape, masterName) | |
Adds shape created by master to specific page. | ||
function | addShape(pinX, pinY, width, height, masterName) | |
Adds shape created by master on page with defined PinX,PinY,Width and Height. | ||
function | addShape(pinX, pinY, masterName) | |
Adds shape created by master on page with defined PinX and PinY. | ||
function | addText(pinX, pinY, width, height, text) | |
Adds Text with defined PinX and PinY. | ||
function | applyStyle(textStyle, lineStyle, fillStyle) | |
Applies style for full page. | ||
function | autoSpaceShapes(shapes, options) | |
Auto space shapes | ||
function | bringForward(shapeId) | |
Brings a shape,defined by ID, forward one position in the z-order. | ||
function | bringToFront(shapeId) | |
Brings a shape,defined by ID, to the front of the z-order. | ||
function | connectShapesViaConnector(shapeFrom, placeFrom, shapeTo, placeTo, connector) | |
Connect shapes via connector. | ||
function | connectShapesViaConnector(shapeFromId, placeFrom, shapeToId, placeTo, connectorId) | |
Connect shapes via connector. | ||
function | connectShapesViaConnectorIndex(shapeFrom, fromIndex, shapeTo, toIndex, connector) | |
Connect shapes via connector index. | ||
function | connectShapesViaConnectorIndex(shapeFromId, fromIndex, shapeToId, toIndex, connectorId) | |
Connect shapes via connector index. | ||
function | copy(source) | |
function | dispose() | |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. | ||
function | glueShapes(shapeFrom, placeTo, shapeTo) | |
Glue shapes. | ||
function | glueShapes(shapeFromId, placeTo, shapeToId) | |
Glue shapes | ||
function | glueShapesInContainer(shapeFromId, shapeToBeginConnectionIndex, shapeToEndConnectionIndex, shapeToId) | |
Glue shapes in container | ||
function | glueShapesInContainer(shapeFromId, shapeToBeginConnectionName, shapeToEndConnectionName, shapeToId) | |
Glue shapes in container using connection name | ||
function | glueShapesInContainerByID(shapeFromId, shapeToBeginConnectionID, shapeToEndConnectionID, shapeToId) | |
Glue shapes by connetion id in container | ||
function | layout(options) | |
Lays out the shapes and/or reroutes the connectors for the page. | ||
function | moveTo(index) | |
Moves the page to another location in the pages. | ||
function | sendBackward(shapeId) | |
Moves a shape,defined by ID, back one position in the z-order. | ||
function | sendToBack(shapeId) | |
Moves a shape,defined by ID, to the back of the z-order. |
Constructor Detail |
---|
function Page()
function Page(ID)
Property Getters/Setters Detail |
---|
getPages/setPages : PageCollection | |
function getPages() / function setPages(value) |
getShapes : ShapeCollection | |
function getShapes() |
getPageSheet : PageSheet | |
function getPageSheet() |
getConnects : ConnectCollection | |
function getConnects() |
Example:
var aspose = aspose || {}; aspose.diagram = require("aspose.diagram"); diagram = new aspose.diagram.Diagram("RetrieveConnectorInfo.vsd"); connects = diagram.getPages().getPage(0).getConnects(); for (var it = connects.iterator(); it.hasNext();) { connector = it.next(); // Display information about the Connectors console.log("From Shape ID : " + connector.getFromSheet()); console.log("To Shape ID : " + connector.getToSheet()); }
getID/setID : Number | |
function getID() / function setID(value) |
getName/setName : String | |
function getName() / function setName(value) |
getNameU/setNameU : String | |
function getNameU() / function setNameU(value) |
getBackground/setBackground : Number | |
function getBackground() / function setBackground(value) |
Example:
var aspose = aspose || {}; aspose.diagram = require("aspose.diagram"); diagram = new aspose.diagram.Diagram("RetrievePageInfo.vdx"); for (var it = diagram.getPages().iterator(); it.hasNext();) { page = it.next(); // Checks if current page is a background page if (page.getBackground() == aspose.diagram.BOOL.TRUE) { // Display information about the background page console.log("Background Page ID : " + page.getID()); console.log("Background Page Name : " + page.getName()); } else { // Display information about the foreground page console.log("\nPage ID : " + page.getID()); console.log("Universal Name : " + page.getNameU()); console.log("ID of the Background Page : " + page.getBackPage()); } }
getBackPage/setBackPage : Page | |
function getBackPage() / function setBackPage(value) |
getViewScale/setViewScale : Number | |
function getViewScale() / function setViewScale(value) |
getViewCenterX/setViewCenterX : Number | |
function getViewCenterX() / function setViewCenterX(value) |
getViewCenterY/setViewCenterY : Number | |
function getViewCenterY() / function setViewCenterY(value) |
getReviewerID/setReviewerID : Number | |
function getReviewerID() / function setReviewerID(value) |
getAssociatedPage/setAssociatedPage : Page | |
function getAssociatedPage() / function setAssociatedPage(value) |
Method Detail |
---|
copy | |
function copy(source) |
dispose | |
function dispose() |
applyStyle | |
function applyStyle(textStyle, lineStyle, fillStyle) |
textStyle: Number
- text Style id.lineStyle: Number
- line Style id.fillStyle: Number
- fill Style id.Example:
var aspose = aspose || {}; aspose.diagram = require("aspose.diagram"); diagram = new aspose.diagram.Diagram("ReadDiagramFile.vsd"); //Define a new StyleSheet st = new aspose.diagram.StyleSheet(); st.setID(diagram.getStyleSheets().getCount() + 1); ch = new aspose.diagram.Char(); ch.getColor().setValue("#00ff00"); ch.setIX(0); st.getChars().add(ch); st.getLine().getLineColor().setValue("#ff0000"); st.getLine().getLinePattern().setValue(1); st.getLine().getLineWeight().setValue(0.01); st.getFill().getFillForegnd().setValue("#0000ff"); st.getFill().getFillPattern().setValue(1); st.getFill().getShdwPattern().setValue(0); //Add the stylesheet to Stylesheets collection diagram.getStyleSheets().add(st); shapes = diagram.getPages().get(0).getShapes(); for (var it = shapes.iterator(); it.hasNext();) { shape = it.next(); shape.getLine().getLinePattern().setValue(1); shape.getFill().getFillPattern().setValue(1); } //Apply the stylesheet diagram.getPages().get(0).applyStyle(st.getID(), st.getID(), st.getID()); diagram.save("out-ApplyStyleToVisioDiagramPage.vsdx", aspose.diagram.SaveFileFormat.VSDX);
moveTo | |
function moveTo(index) |
index: Number
- Destination page index.addActiveXControl | |
function addActiveXControl(type, pinX, pinY, width, height) |
type: Number
- A pinX: Number
- Specifies the x-coordinate of the shape's pin (center of rotation) in relation to the page.pinY: Number
- Specifies the y-coordinate of the shape's pin (center of rotation) in relation to the page.width: Number
- Specifies the width of the shape in inches.height: Number
- Specifies the height of the shape in inches.Example:
var aspose = aspose || {}; aspose.diagram = require("aspose.diagram"); // Instantiate Diagram Object diagram = new aspose.diagram.Diagram(); // Insert an ActiveX control diagram.getPages().get(0).addActiveXControl(aspose.diagram.ControlType.IMAGE, 1, 1, 1, 1); diagram.save("out-InsertActiveXControl.vsdx", aspose.diagram.SaveFileFormat.VSDX);
addShape | |
function addShape(pinX, pinY, masterName) |
pinX: Number
- Specifies the x-coordinate of the shape's pin (center of rotation) in relation to the page.pinY: Number
- Specifies the y-coordinate of the shape's pin (center of rotation) in relation to the page.masterName: String
- Master's name.addShape | |
function addShape(pinX, pinY, width, height, masterName) |
pinX: Number
- Specifies the x-coordinate of the shape's pin (center of rotation) in relation to the page.pinY: Number
- Specifies the y-coordinate of the shape's pin (center of rotation) in relation to the page.width: Number
- Specifies the width of the shape in inches.height: Number
- Specifies the height of the shape in inches.masterName: String
- Master's name.addShape | |
function addShape(newShape, masterName) |
newShape: Shape
- New shape objectmasterName: String
- Master's name.layout | |
function layout(options) |
options: LayoutOptions
- Using the connectShapesViaConnector | |
function connectShapesViaConnector(shapeFrom, placeFrom, shapeTo, placeTo, connector) |
shapeFrom: Shape
- The shape where the connector begins placeFrom: Number
- A shapeTo: Shape
- The shape where the connector ends placeTo: Number
- A connector: Shape
- The shape with type Dynamic connector connectShapesViaConnector | |
function connectShapesViaConnector(shapeFromId, placeFrom, shapeToId, placeTo, connectorId) |
shapeFromId: long
- The ID of shape where the connector begins placeFrom: Number
- A shapeToId: long
- The ID of shape where the connector ends placeTo: Number
- A connectorId: long
- The ID of shape with type Dynamic connector Example:
var aspose = aspose || {}; aspose.diagram = require("aspose.diagram"); diagram = new aspose.diagram.Diagram("AddingNewShape.vsdx"); // set sub shape ids shapeFromId = 2; shapeToId = 4; // access a particular page page = diagram.getPages().getPage("Page-3"); // initialize connector shape shape = new aspose.diagram.Shape(); shape.getLine().getEndArrow().setValue(4); shape.getLine().getLineWeight().setValue(0.01388); // add shape connecter1Id = page.addShape(shape, "Dynamic connector"); // connect sub-shapes page.connectShapesViaConnector( shapeFromId, aspose.diagram.ConnectionPointPlace.RIGHT, shapeToId, aspose.diagram.ConnectionPointPlace.LEFT, connecter1Id); diagram.save("out-ConnectVisioSubShapes.vsdx", aspose.diagram.SaveFileFormat.VSDX);
connectShapesViaConnectorIndex | |
function connectShapesViaConnectorIndex(shapeFromId, fromIndex, shapeToId, toIndex, connectorId) |
shapeFromId: long
- The ID of shape where the connector begins fromIndex: Number
- The index of the connection on the first shapeshapeToId: long
- The ID of shape where the connector ends toIndex: Number
- he index of the connection on the second shape connectorId: long
- The ID of shape with type Dynamic connector connectShapesViaConnectorIndex | |
function connectShapesViaConnectorIndex(shapeFrom, fromIndex, shapeTo, toIndex, connector) |
shapeFrom: Shape
- The shape where the connector begins fromIndex: Number
- The index of the connection on the first shapeshapeTo: Shape
- The shape where the connector ends toIndex: Number
- he index of the connection on the second shape connector: Shape
- The shape with type Dynamic connector glueShapes | |
function glueShapes(shapeFrom, placeTo, shapeTo) |
shapeFrom: Shape
- The shape which is glue from placeTo: Number
- A shapeTo: Shape
- The shape where to glue to glueShapes | |
function glueShapes(shapeFromId, placeTo, shapeToId) |
shapeFromId: long
- The ID of shape which is glue from placeTo: Number
- A shapeToId: long
- The ID of shape where to glue to Example:
var aspose = aspose || {}; aspose.diagram = require("aspose.diagram"); diagram = new aspose.diagram.Diagram("GlueVisioShapes.vsdx"); // Get a particular page page = diagram.getPages().getPage("Page-1"); // set shape id shape1_ID = 7; shape2_ID = 494; // Glue shapes page.glueShapes(shape1_ID, aspose.diagram.ConnectionPointPlace.CENTER, shape2_ID); diagram.save("out-GlueVisioShapes.vsdx", aspose.diagram.SaveFileFormat.VSDX);
glueShapesInContainerByID | |
function glueShapesInContainerByID(shapeFromId, shapeToBeginConnectionID, shapeToEndConnectionID, shapeToId) |
shapeFromId: long
- The ID of shape which is glue from shapeToBeginConnectionID: Number
- The location on the first connection id where to glue .shapeToEndConnectionID: Number
- The location on the end connection id where to glue .shapeToId: long
- The ID of shape where to glue to glueShapesInContainer | |
function glueShapesInContainer(shapeFromId, shapeToBeginConnectionName, shapeToEndConnectionName, shapeToId) |
shapeFromId: long
- The ID of shape which is glue from shapeToBeginConnectionName: String
- The location on the first connection name where to glue .shapeToEndConnectionName: String
- The location on the end connection name where to glue .shapeToId: long
- The ID of shape where to glue to glueShapesInContainer | |
function glueShapesInContainer(shapeFromId, shapeToBeginConnectionIndex, shapeToEndConnectionIndex, shapeToId) |
shapeFromId: long
- The ID of shape which is glue from shapeToBeginConnectionIndex: Number
- The location on the first connection index where to glue .shapeToEndConnectionIndex: Number
- The location on the end connection index where to glue .shapeToId: long
- The ID of shape where to glue to bringForward | |
function bringForward(shapeId) |
shapeId: long
- ID of shape.sendBackward | |
function sendBackward(shapeId) |
shapeId: long
- ID of shape.bringToFront | |
function bringToFront(shapeId) |
shapeId: long
- ID of shape.sendToBack | |
function sendToBack(shapeId) |
shapeId: long
- ID of shape.addComment | |
function addComment(shapeID, comment) |
shape
- The ID of shape which is adding comment.comment: String
- Comment's string.addComment | |
function addComment(shape, comment) |
shape: Shape
- Specifies the shape which is adding comment .comment: String
- Comment's string.addComment | |
function addComment(pinX, pinY, comment) |
pinX: Number
- Specifies the x-coordinate of the comment's pin (center of rotation) in relation to the page.pinY: Number
- Specifies the y-coordinate of the comment's pin (center of rotation) in relation to the page.comment: String
- Comment's string.Example:
var aspose = aspose || {}; aspose.diagram = require("aspose.diagram"); var diagram = new aspose.diagram.Diagram("Drawing1.vsdx"); // Add comment diagram.getPages().getPage(0).addComment(7.205905511811023, 3.880708661417323, "test@"); // Save diagram diagram.save("out-AddPageLevelCommentInVisio.vsdx", aspose.diagram.SaveFileFormat.VSDX);
autoSpaceShapes | |
function autoSpaceShapes(shapes, options) |
shapes: ShapeCollection
- Specifies the shapes be auto spaced.addText | |
function addText(pinX, pinY, width, height, text) |
pinX: Number
- Specifies the x-coordinate of the text's pin (center of rotation) in relation to the page.pinY: Number
- Specifies the y-coordinate of the text's pin (center of rotation) in relation to the page.text: String
- text string.Example:
var aspose = aspose || {}; aspose.diagram = require("aspose.diagram"); diagram = new aspose.diagram.Diagram(); // set parameters PinX = 1, PinY = 1, Width = 1, Height = 1; text = "Test text"; // add text to a Visio page diagram.getPages().getPage(0).addText(PinX, PinY, Width, Height, text); diagram.save("out-InsertTextShape.vsdx", aspose.diagram.SaveFileFormat.VSDX);