| java.lang.Object com.lowagie.text.pdf.MultiColumnText
MultiColumnText | public class MultiColumnText implements Element(Code) | | 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 .
author: Steve Appling |
Field Summary | |
final public static float | AUTOMATIC |
Constructor Summary | |
public | MultiColumnText() Default constructor. | public | MultiColumnText(float height) Construct a MultiColumnText container of the specified height. | public | MultiColumnText(float top, float height) Construct a MultiColumnText container of the specified height
starting at the specified Y position. |
Method Summary | |
public void | addColumn(float[] left, float[] right) Add a new column. | public void | addElement(Element element) Add an element to be rendered in a column.
Note that you can only add a Phrase
or a Chunk if the columns are
not all simple. | public void | addRegularColumns(float left, float right, float gutterWidth, int numColumns) Add the specified number of evenly spaced rectangular columns. | public void | addSimpleColumn(float left, float right) Add a simple rectangular column with specified left
and right x position boundaries. | public ArrayList | getChunks() | public int | getCurrentColumn() Gets the current column. | public boolean | isOverflow() Indicates that all of the text did not fit in the
specified height. | public void | nextColumn() Moves the text insertion point to the beginning of the next column, issuing a page break if
needed. | public boolean | process(ElementListener listener) Processes the element by adding it to an
ElementListener . | public void | resetCurrentColumn() Resets the current column. | public void | setAlignment(int alignment) | public void | setArabicOptions(int arabicOptions) Sets the arabic shaping options. | public void | setColumnsRightToLeft(boolean direction) Sets the direction of the columns. | public void | setRunDirection(int runDirection) Sets the run direction. | public void | setSpaceCharRatio(float spaceCharRatio) Sets the ratio between the extra word spacing and the extra character spacing
when the text is fully justified. | public boolean | shiftCurrentColumn() Shifts the current column. | public int | type() Gets the type of the text element. | public void | useColumnParams(ColumnText sourceColumn) Copy the parameters from the specified ColumnText to use
when rendering. | public float | write(PdfContentByte canvas, PdfDocument document, float documentY) Write out the columns. |
AUTOMATIC | final public static float AUTOMATIC(Code) | | special constant for automatic calculation of height
|
MultiColumnText | public MultiColumnText()(Code) | | Default constructor. Sets height to AUTOMATIC .
Columns will repeat on each page as necessary to accomodate content length.
|
MultiColumnText | public MultiColumnText(float height)(Code) | | Construct a MultiColumnText container of the specified height.
If height is AUTOMATIC , fill complete pages until done.
If a specific height is used, it may span one or more pages.
Parameters: height - |
MultiColumnText | public MultiColumnText(float top, float height)(Code) | | Construct a MultiColumnText container of the specified height
starting at the specified Y position.
Parameters: height - Parameters: top - |
addColumn | public void addColumn(float[] left, float[] right)(Code) | | 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 column Parameters: right - limits for right column |
addRegularColumns | public void addRegularColumns(float left, float right, float gutterWidth, int numColumns)(Code) | | Add the specified number of evenly spaced rectangular columns.
Columns will be seperated by the specified gutterWidth.
Parameters: left - left boundary of first column Parameters: right - right boundary of last column Parameters: gutterWidth - width of gutter spacing between columns Parameters: numColumns - number of columns to add |
addSimpleColumn | public void addSimpleColumn(float left, float right)(Code) | | Add a simple rectangular column with specified left
and right x position boundaries.
Parameters: left - left boundary Parameters: right - right boundary |
getCurrentColumn | public int getCurrentColumn()(Code) | | Gets the current column.
the current column |
isOverflow | public boolean isOverflow()(Code) | | 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.
true if there is still space left in the column |
nextColumn | public void nextColumn() throws DocumentException(Code) | | Moves the text insertion point to the beginning of the next column, issuing a page break if
needed.
throws: DocumentException - on error |
process | public boolean process(ElementListener listener)(Code) | | Processes the element by adding it to an
ElementListener .
Parameters: listener - an ElementListener true if the element was processed successfully |
resetCurrentColumn | public void resetCurrentColumn()(Code) | | Resets the current column.
|
setAlignment | public void setAlignment(int alignment)(Code) | | Sets the default alignment
Parameters: alignment - the default alignment |
setArabicOptions | public void setArabicOptions(int arabicOptions)(Code) | | Sets the arabic shaping options. The option can be AR_NOVOWEL,
AR_COMPOSEDTASHKEEL and AR_LIG.
Parameters: arabicOptions - the arabic shaping options |
setColumnsRightToLeft | public void setColumnsRightToLeft(boolean direction)(Code) | | Sets the direction of the columns.
Parameters: direction - true = right2left; false = left2right |
setRunDirection | public void setRunDirection(int runDirection)(Code) | | Sets the run direction.
Parameters: runDirection - the run direction |
setSpaceCharRatio | public void setSpaceCharRatio(float spaceCharRatio)(Code) | | Sets the ratio between the extra word spacing and the extra character spacing
when the text is fully justified.
Extra word spacing will grow spaceCharRatio times more than extra character spacing.
If the ratio is PdfWriter.NO_SPACE_CHAR_RATIO then the extra character spacing
will be zero.
Parameters: spaceCharRatio - the ratio between the extra word spacing and the extra character spacing |
shiftCurrentColumn | public boolean shiftCurrentColumn()(Code) | | Shifts the current column.
true if the currentcolumn has changed |
type | public int type()(Code) | | Gets the type of the text element.
a type |
useColumnParams | public void useColumnParams(ColumnText sourceColumn)(Code) | | Copy the parameters from the specified ColumnText to use
when rendering. Parameters like setArabicOptions
must be set in this way.
Parameters: sourceColumn - |
write | public float write(PdfContentByte canvas, PdfDocument document, float documentY) throws DocumentException(Code) | | Write out the columns. After writing, use
MultiColumnText.isOverflow() to see if all text was written.
Parameters: canvas - PdfContentByte to write with Parameters: document - document to write to (only used to get page limit info) Parameters: documentY - starting y position to begin writing at the current height (y position) after writing the columns throws: DocumentException - on error |
|
|