Class MultiColumnText
- Namespace
- iTextSharp.text.pdf
- Assembly
- iTextSharp.LGPLv2.Core.dll
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
public class MultiColumnText : IElement
- Inheritance
-
MultiColumnText
- Implements
- Inherited Members
Constructors
MultiColumnText()
Default constructor. Sets height to AUTOMATIC . Columns will repeat on each page as necessary to accomodate content length.
public MultiColumnText()
MultiColumnText(float)
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.
public MultiColumnText(float height)
Parameters
height
float
MultiColumnText(float, float)
Construct a MultiColumnText container of the specified height starting at the specified Y position.
public MultiColumnText(float top, float height)
Parameters
Fields
AUTOMATIC
special constant for automatic calculation of height
public const float AUTOMATIC = -1
Field Value
Properties
Alignment
Sets the default alignment
public int Alignment { set; }
Property Value
ArabicOptions
Sets the arabic shaping options. The option can be AR_NOVOWEL, AR_COMPOSEDTASHKEEL and AR_LIG.
public int ArabicOptions { set; }
Property Value
Chunks
Returns null - not used
public IList<Chunk> Chunks { get; }
Property Value
CurrentColumn
Gets the current column.
public int CurrentColumn { get; }
Property Value
- int
the current column
RunDirection
Sets the run direction.
public int RunDirection { set; }
Property Value
SpaceCharRatio
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.
public float SpaceCharRatio { set; }
Property Value
Type
Gets the type of the text element.
public int Type { get; }
Property Value
- int
a type
Methods
AddColumn(float[], float[])
Add a new column. The parameters are limits for each column wall in the format of a sequence of points (x1,y1,x2,y2,...).
public void AddColumn(float[] left, float[] right)
Parameters
AddElement(IElement)
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. This is an underlying restriction in {@link com.lowagie.text.pdf.ColumnText} @throws DocumentException if element can't be added
public void AddElement(IElement element)
Parameters
element
IElementelement to add
AddRegularColumns(float, float, float, int)
Add the specified number of evenly spaced rectangular columns. Columns will be seperated by the specified gutterWidth.
public void AddRegularColumns(float left, float right, float gutterWidth, int numColumns)
Parameters
left
floatleft boundary of first column
right
floatright boundary of last column
gutterWidth
floatwidth of gutter spacing between columns
numColumns
intnumber of columns to add
AddSimpleColumn(float, float)
Add a simple rectangular column with specified left and right x position boundaries.
public void AddSimpleColumn(float left, float right)
Parameters
AddText(Chunk)
Adds a Chunk to the current text array. Will not have any effect if addElement() was called before. @since 2.1.5
public void AddText(Chunk chunk)
Parameters
chunk
Chunkthe text
AddText(Phrase)
Adds a Phrase to the current text array. Will not have any effect if addElement() was called before. @since 2.1.5
public void AddText(Phrase phrase)
Parameters
phrase
Phrasethe text
IsContent()
@see com.lowagie.text.Element#isContent() @since iText 2.0.8
public bool IsContent()
Returns
IsNestable()
@see com.lowagie.text.Element#isNestable() @since iText 2.0.8
public bool IsNestable()
Returns
IsOverflow()
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.
public bool IsOverflow()
Returns
- bool
true if there is still space left in the column
NextColumn()
Moves the text insertion point to the beginning of the next column, issuing a page break if needed. @throws DocumentException on error
public void NextColumn()
Process(IElementListener)
Processes the element by adding it to an ElementListener .
public bool Process(IElementListener listener)
Parameters
listener
IElementListeneran ElementListener
Returns
- bool
true if the element was processed successfully
ResetCurrentColumn()
Resets the current column.
public void ResetCurrentColumn()
SetColumnsRightToLeft(bool)
Sets the direction of the columns.
public void SetColumnsRightToLeft(bool direction)
Parameters
direction
booltrue = right2left; false = left2right
ShiftCurrentColumn()
Shifts the current column.
public bool ShiftCurrentColumn()
Returns
- bool
true if the currentcolumn has changed
UseColumnParams(ColumnText)
Copy the parameters from the specified ColumnText to use when rendering. Parameters like setArabicOptions must be set in this way.
public void UseColumnParams(ColumnText sourceColumn)
Parameters
sourceColumn
ColumnText
Write(PdfContentByte, PdfDocument, float)
Write out the columns. After writing, use {@link #isOverflow()} to see if all text was written. @throws DocumentException on error
public float Write(PdfContentByte canvas, PdfDocument document, float documentY)
Parameters
canvas
PdfContentBytePdfContentByte to write with
document
PdfDocumentdocument to write to (only used to get page limit info)
documentY
floatstarting y position to begin writing at
Returns
- float
the current height (y position) after writing the columns