com.aspose.words

Class VerticalAlignment

  • java.lang.Object
    • com.aspose.words.VerticalAlignment
public class VerticalAlignment 
extends java.lang.Object

Utility class containing constants. Specifies vertical alignment of a floating shape, text frame or a floating table.

Example:

Shows how to insert a floating image in the middle of a page.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

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

// Make the image float, put it behind text and center on the page
shape.setWrapType(WrapType.NONE);
shape.setBehindText(true);
shape.setRelativeHorizontalPosition(RelativeHorizontalPosition.PAGE);
shape.setRelativeVerticalPosition(RelativeVerticalPosition.PAGE);
shape.setHorizontalAlignment(HorizontalAlignment.CENTER);
shape.setVerticalAlignment(VerticalAlignment.CENTER);

doc.save(getArtifactsDir() + "Image.CreateFloatingPageCenter.docx");
See Also:
ShapeBase.VerticalAlignment

Field Summary
static final intNONE = 0
The object is explicitly positioned, usually using its Top property.
static final intTOP = 1
Specifies that the object shall be at the top of the vertical alignment base.
static final intCENTER = 2
Specifies that the object shall be centered with respect to the vertical alignment base.
static final intBOTTOM = 3
Specifies that the object shall be at the bottom of the vertical alignment base.
static final intINSIDE = 4
Specifies that the object shall be inside of the horizontal alignment base.
static final intOUTSIDE = 5
Specifies that the object shall be outside of the vertical alignment base.
static final intINLINE = -1
Not documented. Seems to be a possible value for floating paragraphs and tables.
static final intDEFAULT = 0
Same as NONE.
 

    • Field Detail

      • NONE = 0

        public static final int NONE
        The object is explicitly positioned, usually using its Top property.
      • TOP = 1

        public static final int TOP
        Specifies that the object shall be at the top of the vertical alignment base.
      • CENTER = 2

        public static final int CENTER
        Specifies that the object shall be centered with respect to the vertical alignment base.
      • BOTTOM = 3

        public static final int BOTTOM
        Specifies that the object shall be at the bottom of the vertical alignment base.
      • INSIDE = 4

        public static final int INSIDE
        Specifies that the object shall be inside of the horizontal alignment base.
      • OUTSIDE = 5

        public static final int OUTSIDE
        Specifies that the object shall be outside of the vertical alignment base.
      • INLINE = -1

        public static final int INLINE
        Not documented. Seems to be a possible value for floating paragraphs and tables.
      • DEFAULT = 0

        public static final int DEFAULT
        Same as NONE.