public class HorizontalAlignment
Example:
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");
Field Summary | ||
---|---|---|
static final int | NONE | |
The object is explicitly positioned, usually using its Left property.
|
||
static final int | DEFAULT | |
Same as |
||
static final int | LEFT | |
Specifies that the object shall be left aligned to the horizontal alignment base.
|
||
static final int | CENTER | |
Specifies that the object shall be centered with respect to the horizontal alignment base.
|
||
static final int | RIGHT | |
Specifies that the object shall be right aligned to the horizontal 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 horizontal alignment base.
|
public static final int NONE
public static final int DEFAULT
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public static final int INSIDE
public static final int OUTSIDE