HorizontalAlignment

HorizontalAlignment enumeration

Specifies horizontal alignment of a floating shape, text frame or floating table.

public enum HorizontalAlignment

Values

NameValueDescription
None0The object is explicitly positioned, usually using its Left property.
Default0Same as None.
Left1Specifies that the object shall be left aligned to the horizontal alignment base.
Center2Specifies that the object shall be centered with respect to the horizontal alignment base.
Right3Specifies that the object shall be right aligned to the horizontal alignment base.
Inside4Specifies that the object shall be inside of the horizontal alignment base.
Outside5Specifies that the object shall be outside of the horizontal alignment base.

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