Working with Text Boxes
Format Text in the Visio Shape’s Text Block Section
Aspose.Diagram API allows developers to control the text direction, alignment, margins, background color, background color transparency, and default tab stop position of text in a shape’s text block. They can interact with these properties programmatically using Aspose.Diagram for Java.
Set the direction, alignment, margins, background color, transparency, and default tab stop position of the text in a Shape’s Text Block
The text block format section of the Visio shape sheet contains the formatting information. The Shape class offers TextBlock property to get or set the visual appearance of the shape’s text.
Format Text Programming Sample
The following piece of code sets direction, alignment, margins, background color, background color transparency, and default tab stop position of the orientation angle and position of the shape’s text at the top.
Rotate and Set Position of the Shape Text
Aspose.Diagram API allows developers to adjust the text position and also rotate text on the Visio Shape. To accomplish this task, the text transforms section on the shapesheet provides TxtPin, TxtLocPin, TxtWidth and TxtHeight properties. Developers can interact with these properties programmatically using Aspose.Diagram API.
The text transforms section contains the positional information about a shape’s text block. These examples show how to adjust shape text positions and orientation angle:
- Set shape’s text position at the top.
- Set shape’s text position at the bottom.
- Set shape’s text position at the left.
- Set shape’s text position at the right.
Set shape’s text position at the top
The following piece of code sets orientation angle and position of the shape’s text at the top.
Set shape’s text position at the bottom
The following piece of code sets orientation angle and position of the shape’s text at the bottom.
Set shape’s text position at the left
The following piece of code sets orientation angle and position of the shape’s text at the left.
Set shape’s text position at the right
The following piece of code sets orientation angle and position of the shape’s text at the right.