Package com.lowagie.text.pdf
Class MultiColumnText
java.lang.Object
com.lowagie.text.pdf.MultiColumnText
- All Implemented Interfaces:
Element
Deprecated.
Formats content into one or more columns bounded by a rectangle. The columns may be simple rectangles or more
complicated shapes. Add all of the columns before adding content. Column continuation is supported. A MultiColumnText
object may be added to a document using
Document.add.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classDeprecated.Inner class used to define a column -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatDeprecated.special constant for automatic calculation of heightprivate List<MultiColumnText.ColumnDef>Deprecated.Array ofColumnDefobjects used to define the columnsprivate booleanDeprecated.private ColumnTextDeprecated.ColumnText object used to do all the real work.private intDeprecated.private floatDeprecated.total desiredHeight of columns.private PdfDocumentDeprecated.private floatDeprecated.private booleanDeprecated.true if all the text could not be written out due to height restrictionprivate booleanDeprecated.true if all columns are simple (rectangular)private floatDeprecated.Top of the columns - y position on starting page.private floatDeprecated.total height of element written out so farFields inherited from interface com.lowagie.text.Element
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, FOOTNOTE, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MODIFICATIONDATE, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Default constructor.MultiColumnText(float height) Deprecated.Construct a MultiColumnText container of the specified height.MultiColumnText(float top, float height) Deprecated.Construct a MultiColumnText container of the specified height starting at the specified Y position. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumn(float[] left, float[] right) Deprecated.Add a new column.voidaddElement(Element element) Deprecated.Add an element to be rendered in a column.voidaddRegularColumns(float left, float right, float gutterWidth, int numColumns) Deprecated.Add the specified number of evenly spaced rectangular columns.voidaddSimpleColumn(float left, float right) Deprecated.Add a simple rectangular column with specified left and right x position boundaries.voidDeprecated.Adds aChunkto the current text array.voidDeprecated.Adds aPhraseto the current text array.Deprecated.Returns null - not usedprivate floatDeprecated.Calculates the appropriate y position for the bottom of the columns on this page.intDeprecated.Gets the current column.private floatgetHeight(float[] left, float[] right) Deprecated.Figure out the height of a column from the border extentsbooleanDeprecated.Checks if this element is a content object.booleanDeprecated.Checks if this element is nestable.booleanDeprecated.Indicates that all of the text did not fit in the specified height.private voidnewPage()Deprecated.voidDeprecated.Moves the text insertion point to the beginning of the next column, issuing a page break if needed.booleanprocess(ElementListener listener) Deprecated.Processes the element by adding it to anElementListener.voidDeprecated.Resets the current column.voidsetAlignment(int alignment) Deprecated.Sets the default alignmentvoidsetArabicOptions(int arabicOptions) Deprecated.Sets the arabic shaping options.voidsetColumnsRightToLeft(boolean direction) Deprecated.Sets the direction of the columns.voidsetRunDirection(int runDirection) Deprecated.Sets the run direction.voidsetSpaceCharRatio(float spaceCharRatio) Deprecated.Sets the ratio between the extra word spacing and the extra character spacing when the text is fully justified.booleanDeprecated.Shifts the current column.inttype()Deprecated.Gets the type of the text element.voiduseColumnParams(ColumnText sourceColumn) Deprecated.Copy the parameters from the specified ColumnText to use when rendering.floatwrite(PdfContentByte canvas, PdfDocument document, float documentY) Deprecated.Write out the columns.
-
Field Details
-
AUTOMATIC
public static final float AUTOMATICDeprecated.special constant for automatic calculation of height- See Also:
-
desiredHeight
private float desiredHeightDeprecated.total desiredHeight of columns. IfAUTOMATIC, this means fill pages until done. This may be larger than one page -
totalHeight
private float totalHeightDeprecated.total height of element written out so far -
overflow
private boolean overflowDeprecated.true if all the text could not be written out due to height restriction -
top
private float topDeprecated.Top of the columns - y position on starting page. IfAUTOMATIC, it means current y position when added to document -
columnText
Deprecated.ColumnText object used to do all the real work. This same object is used for all columns -
columnDefs
Deprecated.Array ofColumnDefobjects used to define the columns -
simple
private boolean simpleDeprecated.true if all columns are simple (rectangular) -
currentColumn
private int currentColumnDeprecated. -
nextY
private float nextYDeprecated. -
columnsRightToLeft
private boolean columnsRightToLeftDeprecated. -
document
Deprecated.
-
-
Constructor Details
-
MultiColumnText
public MultiColumnText()Deprecated.Default constructor. Sets height toAUTOMATIC. Columns will repeat on each page as necessary to accommodate content length. -
MultiColumnText
public MultiColumnText(float height) Deprecated.Construct a MultiColumnText container of the specified height. If height isAUTOMATIC, fill complete pages until done. If a specific height is used, it may span one or more pages.- Parameters:
height- height
-
MultiColumnText
public MultiColumnText(float top, float height) Deprecated.Construct a MultiColumnText container of the specified height starting at the specified Y position.- Parameters:
height- heighttop- top
-
-
Method Details
-
isOverflow
public boolean isOverflow()Deprecated.Indicates that all of the text did not fit in the specified height. Note that isOverflow will return false before the MultiColumnText object has been added to the document. It will always be false if the height is AUTOMATIC.- Returns:
- true if there is still space left in the column
-
useColumnParams
Deprecated.Copy the parameters from the specified ColumnText to use when rendering. Parameters likesetArabicOptionsmust be set in this way.- Parameters:
sourceColumn- source
-
addColumn
public void addColumn(float[] left, float[] right) Deprecated.Add a new column. The parameters are limits for each column wall in the format of a sequence of points (x1,y1,x2,y2,...).- Parameters:
left- limits for left columnright- limits for right column
-
addSimpleColumn
public void addSimpleColumn(float left, float right) Deprecated.Add a simple rectangular column with specified left and right x position boundaries.- Parameters:
left- left boundaryright- right boundary
-
addRegularColumns
public void addRegularColumns(float left, float right, float gutterWidth, int numColumns) Deprecated.Add the specified number of evenly spaced rectangular columns. Columns will be separated by the specified gutterWidth.- Parameters:
left- left boundary of first columnright- right boundary of last columngutterWidth- width of gutter spacing between columnsnumColumns- number of columns to add
-
addText
Deprecated.Adds aPhraseto the current text array. Will not have any effect if addElement() was called before.- Parameters:
phrase- the text- Since:
- 2.1.5
-
addText
Deprecated.Adds aChunkto the current text array. Will not have any effect if addElement() was called before.- Parameters:
chunk- the text- Since:
- 2.1.5
-
addElement
Deprecated.Add an element to be rendered in a column. Note that you can only add aPhraseor aChunkif the columns are not all simple. This is an underlying restriction inColumnText- Parameters:
element- element to add- Throws:
DocumentException- if element can't be added
-
write
public float write(PdfContentByte canvas, PdfDocument document, float documentY) throws DocumentException Deprecated.Write out the columns. After writing, useisOverflow()to see if all text was written.- Parameters:
canvas- PdfContentByte to write withdocument- document to write to (only used to get page limit info)documentY- starting y position to begin writing at- Returns:
- the current height (y position) after writing the columns
- Throws:
DocumentException- on error
-
newPage
Deprecated.- Throws:
DocumentException
-
getHeight
private float getHeight(float[] left, float[] right) Deprecated.Figure out the height of a column from the border extents- Parameters:
left- left borderright- right border- Returns:
- height
-
process
Deprecated.Processes the element by adding it to anElementListener. -
type
public int type()Deprecated.Gets the type of the text element. -
getChunks
Deprecated.Returns null - not used -
isContent
public boolean isContent()Deprecated.Description copied from interface:ElementChecks if this element is a content object. If not, it's a metadata object. -
isNestable
public boolean isNestable()Deprecated.Description copied from interface:ElementChecks if this element is nestable.- Specified by:
isNestablein interfaceElement- Returns:
- true if this element can be nested inside other elements.
- Since:
- iText 2.0.8
- See Also:
-
getColumnBottom
private float getColumnBottom()Deprecated.Calculates the appropriate y position for the bottom of the columns on this page.- Returns:
- the y position of the bottom of the columns
-
nextColumn
Deprecated.Moves the text insertion point to the beginning of the next column, issuing a page break if needed.- Throws:
DocumentException- on error
-
getCurrentColumn
public int getCurrentColumn()Deprecated.Gets the current column.- Returns:
- the current column
-
resetCurrentColumn
public void resetCurrentColumn()Deprecated.Resets the current column. -
shiftCurrentColumn
public boolean shiftCurrentColumn()Deprecated.Shifts the current column.- Returns:
- true if the current column has changed
-
setColumnsRightToLeft
public void setColumnsRightToLeft(boolean direction) Deprecated.Sets the direction of the columns.- Parameters:
direction- true = right2left; false = left2right
-
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
-
setRunDirection
public void setRunDirection(int runDirection) Deprecated.Sets the run direction.- Parameters:
runDirection- the run direction
-
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
-
setAlignment
public void setAlignment(int alignment) Deprecated.Sets the default alignment- Parameters:
alignment- the default alignment
-