BaselineAlignment
Contents
[
Hide
]Inheritance: java.lang.Object
public class BaselineAlignment
Specifies fonts vertical position on a line.
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");
Fields
Field | Description |
---|---|
AUTO | Baseline is adjusted automatically. |
BASELINE | Aligns to the baseline of the paragraph. |
BOTTOM | Aligns to the bottom of each font. |
CENTER | Aligns the center points of each font. |
TOP | Aligns along the top of each font. |
length |
Methods
Method | Description |
---|---|
fromName(String baselineAlignmentName) | |
getName(int baselineAlignment) | |
getValues() | |
toString(int baselineAlignment) |
AUTO
public static int AUTO
Baseline is adjusted automatically.
BASELINE
public static int BASELINE
Aligns to the baseline of the paragraph.
BOTTOM
public static int BOTTOM
Aligns to the bottom of each font.
CENTER
public static int CENTER
Aligns the center points of each font.
TOP
public static int TOP
Aligns along the top of each font.
length
public static int length
fromName(String baselineAlignmentName)
public static int fromName(String baselineAlignmentName)
Parameters:
Parameter | Type | Description |
---|---|---|
baselineAlignmentName | java.lang.String |
Returns: int
getName(int baselineAlignment)
public static String getName(int baselineAlignment)
Parameters:
Parameter | Type | Description |
---|---|---|
baselineAlignment | int |
Returns: java.lang.String
getValues()
public static int[] getValues()
Returns: int[]
toString(int baselineAlignment)
public static String toString(int baselineAlignment)
Parameters:
Parameter | Type | Description |
---|---|---|
baselineAlignment | int |
Returns: java.lang.String