Package com.lowagie.text.pdf
Class PdfLine
java.lang.Object
com.lowagie.text.pdf.PdfLine
PdfLine defines an array with PdfChunk-objects
that fit into 1 line.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe alignment of the line.protected floatThe height of the line.protected booleanprotected floatThe left indentation of the line.protected ArrayListThe arraylist containing the chunks.protected ChunkThe listsymbol (if necessary).protected booleantrueif the chunk splitting was caused by a newline.protected floatThe original width.protected floatThe listsymbol (if necessary).protected floatThe width of the line. -
Method Summary
Modifier and TypeMethodDescriptionfloatGets the maximum size of the ascender for all the fonts used in this line.getChunk(int idx) Gets aPdfChunkby index.floatGets the biggest descender for all the fonts used in this line.intGets the index of the lastPdfChunkwith metric attributesintReturns the length of a line in UTF32 charactersfloatGets the original width of the line.floatgetWidthCorrected(float charSpacing, float wordSpacing) Gets a width corrected with a charSpacing and wordSpacing.booleanChecks if this line has to be justified.booleanChecks if a newline caused the line split.iterator()Returns an iterator ofPdfChunks.floatReturn the indentation needed to show the listsymbol.Returns the listsymbol of this line.voidResets the alignment of this line.voidsetListItem(ListItem listItem) Sets the listsymbol of this line.intsize()Returns the number of chunks in the line.toString()Get the string representation of what is in this line.
-
Field Details
-
line
The arraylist containing the chunks. -
left
protected float leftThe left indentation of the line. -
width
protected float widthThe width of the line. -
alignment
protected int alignmentThe alignment of the line. -
height
protected float heightThe height of the line. -
listSymbol
The listsymbol (if necessary). -
symbolIndent
protected float symbolIndentThe listsymbol (if necessary). -
newlineSplit
protected boolean newlineSplittrueif the chunk splitting was caused by a newline. -
originalWidth
protected float originalWidthThe original width. -
isRTL
protected boolean isRTL
-
-
Method Details
-
size
public int size()Returns the number of chunks in the line.- Returns:
- a value
-
iterator
Returns an iterator ofPdfChunks.- Returns:
- an
Iterator
-
hasToBeJustified
public boolean hasToBeJustified()Checks if this line has to be justified.- Returns:
trueif the alignment equals ALIGN_JUSTIFIED and there is some width left.
-
resetAlignment
public void resetAlignment()Resets the alignment of this line.The alignment of the last line of for instance a
Paragraphthat has to be justified, has to be reset to ALIGN_LEFT. -
setListItem
Sets the listsymbol of this line.This is only necessary for the first line of a
ListItem.- Parameters:
listItem- the list symbol
-
listSymbol
Returns the listsymbol of this line.- Returns:
- a
PdfChunkif the line has a listsymbol;nullotherwise
-
listIndent
public float listIndent()Return the indentation needed to show the listsymbol.- Returns:
- a value
-
toString
Get the string representation of what is in this line. -
GetLineLengthUtf32
public int GetLineLengthUtf32()Returns the length of a line in UTF32 characters- Returns:
- the length in UTF32 characters
- Since:
- 2.1.2
-
isNewlineSplit
public boolean isNewlineSplit()Checks if a newline caused the line split.- Returns:
trueif a newline caused the line split
-
getLastStrokeChunk
public int getLastStrokeChunk()Gets the index of the lastPdfChunkwith metric attributes- Returns:
- the last
PdfChunkwith metric attributes
-
getChunk
Gets aPdfChunkby index.- Parameters:
idx- the index- Returns:
- the
PdfChunkor null if beyond the array
-
getOriginalWidth
public float getOriginalWidth()Gets the original width of the line.- Returns:
- the original width of the line
-
getWidthCorrected
public float getWidthCorrected(float charSpacing, float wordSpacing) Gets a width corrected with a charSpacing and wordSpacing.- Parameters:
charSpacing-wordSpacing-- Returns:
- a corrected width
-
getAscender
public float getAscender()Gets the maximum size of the ascender for all the fonts used in this line.- Returns:
- maximum size of all the ascenders used in this line
-
getDescender
public float getDescender()Gets the biggest descender for all the fonts used in this line. Note that this is a negative number.- Returns:
- maximum size of all the ascenders used in this line
-