BaselineAlignment

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

FieldDescription
AUTOBaseline is adjusted automatically.
BASELINEAligns to the baseline of the paragraph.
BOTTOMAligns to the bottom of each font.
CENTERAligns the center points of each font.
TOPAligns along the top of each font.
length

Methods

MethodDescription
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:

ParameterTypeDescription
baselineAlignmentNamejava.lang.String

Returns: int

getName(int baselineAlignment)

public static String getName(int baselineAlignment)

Parameters:

ParameterTypeDescription
baselineAlignmentint

Returns: java.lang.String

getValues()

public static int[] getValues()

Returns: int[]

toString(int baselineAlignment)

public static String toString(int baselineAlignment)

Parameters:

ParameterTypeDescription
baselineAlignmentint

Returns: java.lang.String