public class VerticalAlignment
Example:
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");
Field Summary | ||
---|---|---|
static final int | NONE | |
The object is explicitly positioned, usually using its Top property.
|
||
static final int | TOP | |
Specifies that the object shall be at the top of the vertical alignment base.
|
||
static final int | CENTER | |
Specifies that the object shall be centered with respect to the vertical alignment base.
|
||
static final int | BOTTOM | |
Specifies that the object shall be at the bottom of the vertical alignment base.
|
||
static final int | INSIDE | |
Specifies that the object shall be inside of the horizontal alignment base.
|
||
static final int | OUTSIDE | |
Specifies that the object shall be outside of the vertical alignment base.
|
||
static final int | INLINE | |
Not documented. Seems to be a possible value for floating paragraphs and tables.
|
||
static final int | DEFAULT | |
Same as |
public static final int NONE
public static final int TOP
public static final int CENTER
public static final int BOTTOM
public static final int INSIDE
public static final int OUTSIDE
public static final int INLINE
public static final int DEFAULT