RelativeHorizontalPosition

ShapeBase.RelativeHorizontalPosition property

Specifies relative to what the shape is positioned horizontally.

public RelativeHorizontalPosition RelativeHorizontalPosition { get; set; }

Remarks

The default value is Column.

Has effect only for top level floating shapes.

Examples

Shows how to insert a floating image to the center of a page.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a floating image that will appear behind the overlapping text and align it to the page's center.
Shape shape = builder.InsertImage(ImageDir + "Logo.jpg");
shape.WrapType = WrapType.None;
shape.BehindText = true;
shape.RelativeHorizontalPosition = RelativeHorizontalPosition.Page;
shape.RelativeVerticalPosition = RelativeVerticalPosition.Page;
shape.HorizontalAlignment = HorizontalAlignment.Center;
shape.VerticalAlignment = VerticalAlignment.Center;

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

See Also