VerticalAlignment
Inheritance: java.lang.Object
public class VerticalAlignment
Specifies vertical alignment of a floating shape, text frame or a floating table.
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(getImageDir() + "Logo.jpg");
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");
Fields
Field | Description |
---|---|
BOTTOM | Specifies that the object shall be at the bottom of the vertical alignment base. |
CENTER | Specifies that the object shall be centered with respect to the vertical alignment base. |
DEFAULT | Same as NONE. |
INLINE | Not documented. |
INSIDE | Specifies that the object shall be inside of the horizontal alignment base. |
NONE | The object is explicitly positioned, usually using its Top property. |
OUTSIDE | Specifies that the object shall be outside of the vertical alignment base. |
TOP | Specifies that the object shall be at the top of the vertical alignment base. |
length |
Methods
Method | Description |
---|---|
fromName(String verticalAlignmentName) | |
getName(int verticalAlignment) | |
getValues() | |
toString(int verticalAlignment) |
BOTTOM
public static int BOTTOM
Specifies that the object shall be at the bottom of the vertical alignment base.
CENTER
public static int CENTER
Specifies that the object shall be centered with respect to the vertical alignment base.
DEFAULT
public static int DEFAULT
Same as NONE.
INLINE
public static int INLINE
Not documented. Seems to be a possible value for floating paragraphs and tables.
INSIDE
public static int INSIDE
Specifies that the object shall be inside of the horizontal alignment base.
NONE
public static int NONE
The object is explicitly positioned, usually using its Top property.
OUTSIDE
public static int OUTSIDE
Specifies that the object shall be outside of the vertical alignment base.
TOP
public static int TOP
Specifies that the object shall be at the top of the vertical alignment base.
length
public static int length
fromName(String verticalAlignmentName)
public static int fromName(String verticalAlignmentName)
Parameters:
Parameter | Type | Description |
---|---|---|
verticalAlignmentName | java.lang.String |
Returns: int
getName(int verticalAlignment)
public static String getName(int verticalAlignment)
Parameters:
Parameter | Type | Description |
---|---|---|
verticalAlignment | int |
Returns: java.lang.String
getValues()
public static int[] getValues()
Returns: int[]
toString(int verticalAlignment)
public static String toString(int verticalAlignment)
Parameters:
Parameter | Type | Description |
---|---|---|
verticalAlignment | int |
Returns: java.lang.String