DocumentBuilderCurrentSection Property

Gets the section that is currently selected in this DocumentBuilder.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.7.0


public Section CurrentSection { get; }

Property Value

Type: Section


Shows how to insert a floating image and specify its position and size.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// By default, the image is inline
Shape shape = builder.InsertImage(ImageDir + "Logo.jpg");

// Make the image float, put it behind text and center on the page
shape.WrapType = WrapType.None;

// Make position relative to the page
shape.RelativeHorizontalPosition = RelativeHorizontalPosition.Page;
shape.RelativeVerticalPosition = RelativeVerticalPosition.Page;

// Set the shape's coordinates, from the top left corner of the page
shape.Left = 100;
shape.Top = 80;

// Set the shape's height
shape.Height = 125.0;

// The width will be scaled to the height and the dimensions of the real image
Assert.AreEqual(125.0, shape.Width);

// The Bottom and Right members contain the locations of the bottom and right edges of the image
Assert.AreEqual(shape.Top + shape.Height, shape.Bottom);
Assert.AreEqual(shape.Left + shape.Width, shape.Right);

doc.Save(ArtifactsDir + "Image.CreateFloatingPositionSize.docx");

See Also