Several parameters can be set like the first paragraph line indent and extra space between paragraphs.
A call to the method go will return one of the following situations: the column ended or the text
ended.
I the column ended, a new column definition can be loaded with the method
setColumns and the method go can be called again.
If the text ended, more text can be loaded with addText and the method go can be called
again.
The only limitation is that one or more complete paragraphs must be loaded each time.
Full bidirectional reordering is supported. If the run direction is
PdfWriter.RUN_DIRECTION_RTL the meaning of the horizontal
alignments and margins is mirrored.
- Author:
- Paulo Soares (psoares@consiste.pt)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intDeprecated.The column alignment.static final intDeprecated.Compose the tashkeel in the ligatures.static final intDeprecated.Do some extra double ligatures.static final intDeprecated.Eliminate the arabic vowelsprotected BidiLineDeprecated.The chunks that form the text.protected PdfContentByteDeprecated.ThePdfContentwhere the text will be written to.protected PdfContentByte[]Deprecated.protected booleanDeprecated.protected ColumnTextDeprecated.protected LinkedList<Element> Deprecated.protected floatDeprecated.The leading for the current line.protected floatDeprecated.static final intDeprecated.Digit type option: Use Arabic-Indic digits (U+0660...U+0669).static final intDeprecated.Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).static final intDeprecated.Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039).static final intDeprecated.Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits.static final intDeprecated.Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).static final intDeprecated.Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC).protected floatDeprecated.The extra space between paragraphs.protected floatDeprecated.The fixed text leading.protected floatDeprecated.The following paragraph lines indent.static final floatDeprecated.the space char ratioprotected floatDeprecated.The first paragraph line indent.protected List<float[]> Deprecated.The left column bound.protected floatDeprecated.protected static final intDeprecated.The line cannot fit this column position.protected static final intDeprecated.The line is out the column limits.protected static final intDeprecated.The column is valid.protected intDeprecated.The line status when trying to fit a line to a column.protected intDeprecated.protected floatDeprecated.Upper bound of the column.protected floatDeprecated.Lower bound of the column.protected floatDeprecated.The text leading that is multiplied by the biggest font size in the line.static final intDeprecated.Signals that there is no more column.static final intDeprecated.Signals that there is no more text available.protected booleanDeprecated.protected floatDeprecated.The width of the line when the column is defined as a simple rectangle.protected floatDeprecated.The right paragraph lines indent.protected List<float[]> Deprecated.The right column bound.protected floatDeprecated.protected intDeprecated.static final intDeprecated.Initial value of the status.protected PhraseDeprecated.protected floatDeprecated.The current y line location. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddElement(Element element) Deprecated.Adds an element.voidDeprecated.Adds aChunkto the current text array.voidDeprecated.Adds aPhraseto the current text array.voidDeprecated.Clears the chunk array.protected List<float[]> convertColumn(float[] cLine) Deprecated.Converts a sequence of lines representing one of the column bounds into an internal format.static ColumnTextduplicate(ColumnText org) Deprecated.Creates an independent duplicated of the instanceorg.protected float[]Deprecated.Finds the intersection between theyLineand the two column bounds.protected floatfindLimitsPoint(List<float[]> wall) Deprecated.Finds the intersection between theyLineand the column.protected float[]Deprecated.Finds the intersection between theyLine, theyLine-leadingand the two column bounds.intDeprecated.Gets the alignment.intDeprecated.Gets the arabic shaping options.Deprecated.Gets the canvas.Deprecated.Gets the canvases.floatDeprecated.Gets the biggest descender value of the last line written.floatDeprecated.Sets the extra space between paragraphs.floatDeprecated.Gets the real width used by the largest line.floatDeprecated.Gets the following paragraph lines indent.floatDeprecated.Gets the first paragraph line indent.floatDeprecated.Gets the fixed leading.intDeprecated.Gets the number of lines written.floatDeprecated.Gets the variable leading.floatDeprecated.Gets the right paragraph lines indent.intDeprecated.Gets the run direction.floatDeprecated.Gets the space/character extra spacing ratio for fully justified text.static floatDeprecated.Gets the width that the line will occupy after writing.static floatDeprecated.Gets the width that the line will occupy after writing.floatgetYLine()Deprecated.Gets the yLine.intgo()Deprecated.Outputs the lines to the document.intgo(boolean simulate) Deprecated.Outputs the lines to the document.protected intgoComposite(boolean simulate) Deprecated.static booleanhasMoreText(int status) Deprecated.Checks the status variable and looks if there's still some text.booleanDeprecated.Gets the first line adjustment property.booleanDeprecated.Gets the strict word wrapping flag.booleanDeprecated.Checks if UseAscender is enabled/disabled.setACopy(ColumnText org) Deprecated.Makes this instance an independent copy oforg.voidsetAdjustFirstLine(boolean adjustFirstLine) Deprecated.Sets the first line adjustment.voidsetAlignment(int alignment) Deprecated.Sets the alignment.voidsetArabicOptions(int arabicOptions) Deprecated.Sets the arabic shaping options.voidsetCanvas(PdfContentByte canvas) Deprecated.Sets the canvas.voidsetCanvases(PdfContentByte[] canvases) Deprecated.Sets the canvases.voidsetColumns(float[] leftLine, float[] rightLine) Deprecated.Sets the columns bounds.voidsetExtraParagraphSpace(float extraParagraphSpace) Deprecated.Sets the extra space between paragraphs.voidsetFilledWidth(float filledWidth) Deprecated.Sets the real width used by the largest line.voidsetFollowingIndent(float indent) Deprecated.Sets the following paragraph lines indent.voidsetIndent(float indent) Deprecated.Sets the first paragraph line indent.voidsetLeading(float leading) Deprecated.Sets the leading to fixed.voidsetLeading(float fixedLeading, float multipliedLeading) Deprecated.Sets the leading fixed and variable.voidsetRightIndent(float indent) Deprecated.Sets the right paragraph lines indent.voidsetRunDirection(int runDirection) Deprecated.Sets the run direction.voidsetSimpleColumn(float llx, float lly, float urx, float ury) Deprecated.Simplified method for rectangular columns.voidsetSimpleColumn(float llx, float lly, float urx, float ury, float leading, int alignment) Deprecated.Simplified method for rectangular columns.voidsetSimpleColumn(Phrase phrase, float llx, float lly, float urx, float ury, float leading, int alignment) Deprecated.Simplified method for rectangular columns.protected voidsetSimpleVars(ColumnText org) Deprecated.voidsetSpaceCharRatio(float spaceCharRatio) Deprecated.Sets the ratio between the extra word spacing and the extra character spacing when the text is fully justified.voidsetStrictWordWrapping(boolean strictWordWrapping) Deprecated.Sets the strict word wrapping flag.voidDeprecated.Replaces the current text array with thisPhrase.voidsetUseAscender(boolean useAscender) Deprecated.Enables/Disables adjustment of first line height based on max ascender.voidsetYLine(float yLine) Deprecated.Sets the yLine.static voidshowTextAligned(PdfContentByte canvas, int alignment, Phrase phrase, float x, float y, float rotation) Deprecated.Shows a line of text.static voidshowTextAligned(PdfContentByte canvas, int alignment, Phrase phrase, float x, float y, float rotation, int runDirection, int arabicOptions) Deprecated.Shows a line of text.voidupdateFilledWidth(float w) Deprecated.Replaces thefilledWidthif greater than the existing one.booleanDeprecated.Checks if the element has a height of 0.
-
Field Details
-
AR_NOVOWEL
public static final int AR_NOVOWELDeprecated.Eliminate the arabic vowels- See Also:
-
AR_COMPOSEDTASHKEEL
public static final int AR_COMPOSEDTASHKEELDeprecated.Compose the tashkeel in the ligatures.- See Also:
-
AR_LIG
public static final int AR_LIGDeprecated.Do some extra double ligatures.- See Also:
-
DIGITS_EN2AN
public static final int DIGITS_EN2ANDeprecated.Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits.- See Also:
-
DIGITS_AN2EN
public static final int DIGITS_AN2ENDeprecated.Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039).- See Also:
-
DIGITS_EN2AN_INIT_LR
public static final int DIGITS_EN2AN_INIT_LRDeprecated.Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC). The initial state at the start of the text is assumed to be not an Arabic, letter, so European digits at the start of the text will not change. Compare to DIGITS_ALEN2AN_INIT_AL.- See Also:
-
DIGITS_EN2AN_INIT_AL
public static final int DIGITS_EN2AN_INIT_ALDeprecated.Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits if the most recent strongly directional character is an Arabic letter (its Bidi direction value is RIGHT_TO_LEFT_ARABIC). The initial state at the start of the text is assumed to be an Arabic, letter, so European digits at the start of the text will change. Compare to DIGITS_ALEN2AN_INT_LR.- See Also:
-
DIGIT_TYPE_AN
public static final int DIGIT_TYPE_ANDeprecated.Digit type option: Use Arabic-Indic digits (U+0660...U+0669).- See Also:
-
DIGIT_TYPE_AN_EXTENDED
public static final int DIGIT_TYPE_AN_EXTENDEDDeprecated.Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).- See Also:
-
GLOBAL_SPACE_CHAR_RATIO
public static final float GLOBAL_SPACE_CHAR_RATIODeprecated.the space char ratio- See Also:
-
START_COLUMN
public static final int START_COLUMNDeprecated.Initial value of the status.- See Also:
-
NO_MORE_TEXT
public static final int NO_MORE_TEXTDeprecated.Signals that there is no more text available.- See Also:
-
NO_MORE_COLUMN
public static final int NO_MORE_COLUMNDeprecated.Signals that there is no more column.- See Also:
-
LINE_STATUS_OK
protected static final int LINE_STATUS_OKDeprecated.The column is valid.- See Also:
-
LINE_STATUS_OFFLIMITS
protected static final int LINE_STATUS_OFFLIMITSDeprecated.The line is out the column limits.- See Also:
-
LINE_STATUS_NOLINE
protected static final int LINE_STATUS_NOLINEDeprecated.The line cannot fit this column position.- See Also:
-
runDirection
protected int runDirectionDeprecated. -
maxY
protected float maxYDeprecated.Upper bound of the column. -
minY
protected float minYDeprecated.Lower bound of the column. -
leftX
protected float leftXDeprecated. -
rightX
protected float rightXDeprecated. -
alignment
protected int alignmentDeprecated.The column alignment. Default is left alignment. -
leftWall
Deprecated.The left column bound. -
rightWall
Deprecated.The right column bound. -
bidiLine
Deprecated.The chunks that form the text. -
yLine
protected float yLineDeprecated.The current y line location. Text will be written at this line minus the leading. -
currentLeading
protected float currentLeadingDeprecated.The leading for the current line. -
fixedLeading
protected float fixedLeadingDeprecated.The fixed text leading. -
multipliedLeading
protected float multipliedLeadingDeprecated.The text leading that is multiplied by the biggest font size in the line. -
canvas
Deprecated.ThePdfContentwhere the text will be written to. -
canvases
Deprecated. -
lineStatus
protected int lineStatusDeprecated.The line status when trying to fit a line to a column. -
indent
protected float indentDeprecated.The first paragraph line indent. -
followingIndent
protected float followingIndentDeprecated.The following paragraph lines indent. -
rightIndent
protected float rightIndentDeprecated.The right paragraph lines indent. -
extraParagraphSpace
protected float extraParagraphSpaceDeprecated.The extra space between paragraphs. -
rectangularWidth
protected float rectangularWidthDeprecated.The width of the line when the column is defined as a simple rectangle. -
rectangularMode
protected boolean rectangularModeDeprecated. -
descender
protected float descenderDeprecated. -
composite
protected boolean compositeDeprecated. -
compositeColumn
Deprecated. -
compositeElements
Deprecated. -
listIdx
protected int listIdxDeprecated. -
waitPhrase
Deprecated.
-
-
Constructor Details
-
ColumnText
Deprecated.Creates aColumnText.- Parameters:
canvas- the place where the text will be written to. Can be a template.
-
-
Method Details
-
duplicate
Deprecated.Creates an independent duplicated of the instanceorg.- Parameters:
org- the originalColumnText- Returns:
- the duplicated
-
getWidth
Deprecated.Gets the width that the line will occupy after writing. Only the width of the first line is returned.- Parameters:
phrase- thePhrasecontaining the linerunDirection- the run directionarabicOptions- the options for the arabic shaping- Returns:
- the width of the line
-
getWidth
Deprecated.Gets the width that the line will occupy after writing. Only the width of the first line is returned.- Parameters:
phrase- thePhrasecontaining the line- Returns:
- the width of the line
-
showTextAligned
public static void showTextAligned(PdfContentByte canvas, int alignment, Phrase phrase, float x, float y, float rotation, int runDirection, int arabicOptions) Deprecated.Shows a line of text. Only the first line is written.- Parameters:
canvas- where the text is to be written toalignment- the alignment. It is not influenced by the run directionphrase- thePhrasewith the textx- the x reference positiony- the y reference positionrotation- the rotation to be applied in degrees counterclockwiserunDirection- the run directionarabicOptions- the options for the arabic shaping
-
showTextAligned
public static void showTextAligned(PdfContentByte canvas, int alignment, Phrase phrase, float x, float y, float rotation) Deprecated.Shows a line of text. Only the first line is written.- Parameters:
canvas- where the text is to be written toalignment- the alignmentphrase- thePhrasewith the textx- the x reference positiony- the y reference positionrotation- the rotation to be applied in degrees counterclockwise
-
hasMoreText
public static boolean hasMoreText(int status) Deprecated.Checks the status variable and looks if there's still some text.- Parameters:
status- statues variable- Returns:
trueif there's still some text elsefalse
-
setACopy
Deprecated.Makes this instance an independent copy oforg.- Parameters:
org- the originalColumnText- Returns:
- itself
-
setSimpleVars
Deprecated. -
addText
Deprecated.Adds aPhraseto the current text array. Will not have any effect if addElement() was called before.- Parameters:
phrase- the text
-
setText
Deprecated.Replaces the current text array with thisPhrase. Anything added previously with addElement() is lost.- Parameters:
phrase- the text
-
addText
Deprecated.Adds aChunkto the current text array. Will not have any effect if addElement() was called before.- Parameters:
chunk- the text
-
addElement
Deprecated.Adds an element. Elements supported areParagraph,List,PdfPTable,ImageandGraphic.It removes all the text placed with
addText().- Parameters:
element- theElement
-
convertColumn
Deprecated.Converts a sequence of lines representing one of the column bounds into an internal format.Each array element will contain a
float[4]representing the line x = ax + b.- Parameters:
cLine- the column array- Returns:
- the converted array
-
findLimitsPoint
Deprecated.Finds the intersection between theyLineand the column. It will set thelineStatusappropriately.- Parameters:
wall- the column to intersect- Returns:
- the x coordinate of the intersection
-
findLimitsOneLine
protected float[] findLimitsOneLine()Deprecated.Finds the intersection between theyLineand the two column bounds. It will set thelineStatusappropriately.- Returns:
- a
float[2]with the x coordinates of the intersection
-
findLimitsTwoLines
protected float[] findLimitsTwoLines()Deprecated.Finds the intersection between theyLine, theyLine-leadingand the two column bounds. It will set thelineStatusappropriately.- Returns:
- a
float[4]with the x coordinates of the intersection
-
setColumns
public void setColumns(float[] leftLine, float[] rightLine) Deprecated.Sets the columns bounds. Each column bound is described by afloat[]with the line points [x1,y1,x2,y2,...]. The array must have at least 4 elements.- Parameters:
leftLine- the left column boundrightLine- the right column bound
-
setSimpleColumn
public void setSimpleColumn(Phrase phrase, float llx, float lly, float urx, float ury, float leading, int alignment) Deprecated.Simplified method for rectangular columns.- Parameters:
phrase- aPhrasellx- the lower left x cornerlly- the lower left y cornerurx- the upper right x cornerury- the upper right y cornerleading- the leadingalignment- the column alignment
-
setSimpleColumn
public void setSimpleColumn(float llx, float lly, float urx, float ury, float leading, int alignment) Deprecated.Simplified method for rectangular columns.- Parameters:
llx- the lower left x cornerlly- the lower left y cornerurx- the upper right x cornerury- the upper right y cornerleading- the leadingalignment- the column alignment
-
setSimpleColumn
public void setSimpleColumn(float llx, float lly, float urx, float ury) Deprecated.Simplified method for rectangular columns.- Parameters:
llx- lower-left-xlly- lower-left-yurx- upper-right-xury- upper-right-y
-
setLeading
public void setLeading(float fixedLeading, float multipliedLeading) Deprecated.Sets the leading fixed and variable. The resultant leading will be fixedLeading+multipliedLeading*maxFontSize where maxFontSize is the size of the biggest font in the line.- Parameters:
fixedLeading- the fixed leadingmultipliedLeading- the variable leading
-
getLeading
public float getLeading()Deprecated.Gets the fixed leading.- Returns:
- the leading
-
setLeading
public void setLeading(float leading) Deprecated.Sets the leading to fixed.- Parameters:
leading- the leading
-
getMultipliedLeading
public float getMultipliedLeading()Deprecated.Gets the variable leading.- Returns:
- the leading
-
getYLine
public float getYLine()Deprecated.Gets the yLine.- Returns:
- the yLine
-
setYLine
public void setYLine(float yLine) Deprecated.Sets the yLine. The line will be written to yLine-leading.- Parameters:
yLine- the yLine
-
getAlignment
public int getAlignment()Deprecated.Gets the alignment.- Returns:
- the alignment
-
setAlignment
public void setAlignment(int alignment) Deprecated.Sets the alignment.- Parameters:
alignment- the alignment
-
getIndent
public float getIndent()Deprecated.Gets the first paragraph line indent.- Returns:
- the indent
-
setIndent
public void setIndent(float indent) Deprecated.Sets the first paragraph line indent.- Parameters:
indent- the indent
-
getFollowingIndent
public float getFollowingIndent()Deprecated.Gets the following paragraph lines indent.- Returns:
- the indent
-
setFollowingIndent
public void setFollowingIndent(float indent) Deprecated.Sets the following paragraph lines indent.- Parameters:
indent- the indent
-
getRightIndent
public float getRightIndent()Deprecated.Gets the right paragraph lines indent.- Returns:
- the indent
-
setRightIndent
public void setRightIndent(float indent) Deprecated.Sets the right paragraph lines indent.- Parameters:
indent- the indent
-
go
Deprecated.Outputs the lines to the document. It is equivalent togo(false).- Returns:
- returns the result of the operation. It can be
NO_MORE_TEXTand/orNO_MORE_COLUMN - Throws:
DocumentException- on error
-
go
Deprecated.Outputs the lines to the document. The output can be simulated.- Parameters:
simulate-trueto simulate the writing to the document- Returns:
- returns the result of the operation. It can be
NO_MORE_TEXTand/orNO_MORE_COLUMN - Throws:
DocumentException- on error
-
getExtraParagraphSpace
public float getExtraParagraphSpace()Deprecated.Sets the extra space between paragraphs.- Returns:
- the extra space between paragraphs
-
setExtraParagraphSpace
public void setExtraParagraphSpace(float extraParagraphSpace) Deprecated.Sets the extra space between paragraphs.- Parameters:
extraParagraphSpace- the extra space between paragraphs
-
clearChunks
public void clearChunks()Deprecated.Clears the chunk array. A call togo()will always return NO_MORE_TEXT. -
getSpaceCharRatio
public float getSpaceCharRatio()Deprecated.Gets the space/character extra spacing ratio for fully justified text.- Returns:
- the space/character extra spacing ratio
-
setSpaceCharRatio
public void setSpaceCharRatio(float spaceCharRatio) Deprecated.Sets the ratio between the extra word spacing and the extra character spacing when the text is fully justified. Extra word spacing will growspaceCharRatiotimes more than extra character spacing. If the ratio isPdfWriter.NO_SPACE_CHAR_RATIOthen the extra character spacing will be zero.- Parameters:
spaceCharRatio- the ratio between the extra word spacing and the extra character spacing
-
getRunDirection
public int getRunDirection()Deprecated.Gets the run direction.- Returns:
- the run direction
-
setRunDirection
public void setRunDirection(int runDirection) Deprecated.Sets the run direction.- Parameters:
runDirection- the run direction
-
getLinesWritten
public int getLinesWritten()Deprecated.Gets the number of lines written.- Returns:
- the number of lines written
-
getArabicOptions
public int getArabicOptions()Deprecated.Gets the arabic shaping options.- Returns:
- the arabic shaping options
-
setArabicOptions
public void setArabicOptions(int arabicOptions) Deprecated.Sets the arabic shaping options. The option can be AR_NOVOWEL, AR_COMPOSEDTASHKEEL and AR_LIG.- Parameters:
arabicOptions- the arabic shaping options
-
getDescender
public float getDescender()Deprecated.Gets the biggest descender value of the last line written.- Returns:
- the biggest descender value of the last line written
-
goComposite
Deprecated.- Throws:
DocumentException
-
getCanvas
Deprecated.Gets the canvas. If a set of four canvases exists, the TEXTCANVAS is returned.- Returns:
- a PdfContentByte.
-
setCanvas
Deprecated.Sets the canvas. If before a set of four canvases was set, it is being unset.- Parameters:
canvas- an object ofPdfContentByte
-
getCanvases
Deprecated.Gets the canvases.- Returns:
- an array of PdfContentByte
-
setCanvases
Deprecated.Sets the canvases.- Parameters:
canvases- an array ofPdfContentByte
-
zeroHeightElement
public boolean zeroHeightElement()Deprecated.Checks if the element has a height of 0.- Returns:
- true or false
- Since:
- 2.1.2
-
isUseAscender
public boolean isUseAscender()Deprecated.Checks if UseAscender is enabled/disabled.- Returns:
- true is the adjustment of the first line height is based on max ascender.
-
setUseAscender
public void setUseAscender(boolean useAscender) Deprecated.Enables/Disables adjustment of first line height based on max ascender.- Parameters:
useAscender- enable adjustment if true
-
getFilledWidth
public float getFilledWidth()Deprecated.Gets the real width used by the largest line.- Returns:
- the real width used by the largest line
-
setFilledWidth
public void setFilledWidth(float filledWidth) Deprecated.Sets the real width used by the largest line. Only used to set it to zero to start another measurement.- Parameters:
filledWidth- the real width used by the largest line
-
updateFilledWidth
public void updateFilledWidth(float w) Deprecated.Replaces thefilledWidthif greater than the existing one.- Parameters:
w- the newfilledWidthif greater than the existing one
-
isAdjustFirstLine
public boolean isAdjustFirstLine()Deprecated.Gets the first line adjustment property.- Returns:
- the first line adjustment property.
-
setAdjustFirstLine
public void setAdjustFirstLine(boolean adjustFirstLine) Deprecated.Sets the first line adjustment. Some objects have properties, like spacing before, that behave differently if the object is the first to be written after go() or not. The first line adjustment istrueby default but can be changed if several objects are to be placed one after the other in the same column calling go() several times.- Parameters:
adjustFirstLine-trueto adjust the first line,falseotherwise
-
isStrictWordWrapping
public boolean isStrictWordWrapping()Deprecated.Gets the strict word wrapping flag.- Returns:
- true if strict word wrapping is enabled, false otherwise
-
setStrictWordWrapping
public void setStrictWordWrapping(boolean strictWordWrapping) Deprecated.Sets the strict word wrapping flag. When enabled, throws StrictWordWrapException instead of forcing line breaks when text doesn't fit within column width.- Parameters:
strictWordWrapping- true to enable strict word wrapping, false to disable
-