addText

addText(pinX, pinY, width, height, text, fontName, fontColor, size) (1 of 2)

Adds Text with defined PinX and PinY.

ParameterTypeDescription
pinXfloatSpecifies the x-coordinate of the text’s pin (center of rotation) in relation to the page.
pinYfloatSpecifies the y-coordinate of the text’s pin (center of rotation) in relation to the page.
widthfloatSpecifies the width of the text.
heightfloatSpecifies the height of the text.
textStringtext string.
fontNameStringtext font name.
fontColorStringtext font color.
sizefloattext font size.

Returns: Returns a shape object that represents the new text object.


addText(pinX, pinY, width, height, text) (2 of 2)

Adds Text with defined PinX and PinY.

ParameterTypeDescription
pinXfloatSpecifies the x-coordinate of the text’s pin (center of rotation) in relation to the page.
pinYfloatSpecifies the y-coordinate of the text’s pin (center of rotation) in relation to the page.
textStringtext string.

Returns: Returns a shape object that represents the new text object.

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