TextBoxInternalMarginBottom Property |
Namespace: Aspose.Words.Drawing
The default value is 1/20 inch.
Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); // Insert a shape that contains a TextBox Shape textBoxShape = builder.InsertShape(ShapeType.TextBox, 150, 100); TextBox textBox = textBoxShape.TextBox; // Move the document builder to inside the TextBox and write text builder.MoveTo(textBoxShape.LastParagraph); builder.Write("Vertical text"); // Text is displayed vertically, written top to bottom textBox.LayoutFlow = LayoutFlow.TopToBottomIdeographic; // Move the builder out of the shape and back into the main document body builder.MoveTo(textBoxShape.ParentParagraph); // Insert another TextBox textBoxShape = builder.InsertShape(ShapeType.TextBox, 150, 100); textBox = textBoxShape.TextBox; // Apply these values to both these members to get the parent shape to defy the dimensions we set to fit tightly around the TextBox's text textBox.FitShapeToText = true; textBox.TextBoxWrapMode = TextBoxWrapMode.None; builder.MoveTo(textBoxShape.LastParagraph); builder.Write("Text fit tightly inside textbox"); builder.MoveTo(textBoxShape.ParentParagraph); textBoxShape = builder.InsertShape(ShapeType.TextBox, 100, 100); textBox = textBoxShape.TextBox; // Set margins for the textbox textBox.InternalMarginTop = 15; textBox.InternalMarginBottom = 15; textBox.InternalMarginLeft = 15; textBox.InternalMarginRight = 15; builder.MoveTo(textBoxShape.LastParagraph); builder.Write("Text placed according to textbox margins"); doc.Save(ArtifactsDir + "Shape.TextBox.docx");