public class BaselineAlignment
extends java.lang.Object
Examples:
Shows how to set fonts vertical position on a line.
Document doc = new Document(getMyDir() + "Office math.docx");
ParagraphFormat format = doc.getFirstSection().getBody().getParagraphs().get(0).getParagraphFormat();
if (format.getBaselineAlignment() == BaselineAlignment.AUTO)
{
format.setBaselineAlignment(BaselineAlignment.TOP);
}
doc.save(getArtifactsDir() + "ParagraphFormat.ParagraphBaselineAlignment.docx");
| Modifier and Type | Field and Description |
|---|---|
static int |
AUTO
Baseline is adjusted automatically.
|
static int |
BASELINE
Aligns to the baseline of the paragraph.
|
static int |
BOTTOM
Aligns to the bottom of each font.
|
static int |
CENTER
Aligns the center points of each font.
|
static int |
length |
static int |
TOP
Aligns along the top of each font.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
fromName(java.lang.String baselineAlignmentName) |
static java.lang.String |
getName(int baselineAlignment) |
static int[] |
getValues() |
static java.lang.String |
toString(int baselineAlignment) |
public static int TOP
public static int CENTER
public static int BASELINE
public static int BOTTOM
public static int AUTO
public static int length