HiraokaHyperTools.iTextSharp-LGPL
0.2.5
|
Public Member Functions | |
ColumnText (PdfContentByte canvas) | |
ColumnText | SetACopy (ColumnText org) |
void | AddText (Phrase phrase) |
void | SetText (Phrase phrase) |
void | AddText (Chunk chunk) |
void | AddElement (IElement element) |
void | SetColumns (float[] leftLine, float[] rightLine) |
void | SetSimpleColumn (Phrase phrase, float llx, float lly, float urx, float ury, float leading, int alignment) |
void | SetSimpleColumn (float llx, float lly, float urx, float ury, float leading, int alignment) |
void | SetSimpleColumn (float llx, float lly, float urx, float ury) |
void | SetLeading (float fixedLeading, float multipliedLeading) |
int | Go () |
int | Go (bool simulate) |
void | ClearChunks () |
bool | ZeroHeightElement () |
void | UpdateFilledWidth (float w) |
Static Public Member Functions | |
static ColumnText | Duplicate (ColumnText org) |
static float | GetWidth (Phrase phrase, int runDirection, int arabicOptions) |
static float | GetWidth (Phrase phrase) |
static void | ShowTextAligned (PdfContentByte canvas, int alignment, Phrase phrase, float x, float y, float rotation, int runDirection, int arabicOptions) |
static void | ShowTextAligned (PdfContentByte canvas, int alignment, Phrase phrase, float x, float y, float rotation) |
static bool | HasMoreText (int status) |
Public Attributes | |
int | AR_NOVOWEL = ArabicLigaturizer.ar_novowel |
Static Public Attributes | |
const int | AR_COMPOSEDTASHKEEL = ArabicLigaturizer.ar_composedtashkeel |
const int | AR_LIG = ArabicLigaturizer.ar_lig |
const int | DIGITS_EN2AN = ArabicLigaturizer.DIGITS_EN2AN |
const int | DIGITS_AN2EN = ArabicLigaturizer.DIGITS_AN2EN |
const int | DIGITS_EN2AN_INIT_LR = ArabicLigaturizer.DIGITS_EN2AN_INIT_LR |
const int | DIGITS_EN2AN_INIT_AL = ArabicLigaturizer.DIGITS_EN2AN_INIT_AL |
const int | DIGIT_TYPE_AN = ArabicLigaturizer.DIGIT_TYPE_AN |
const int | DIGIT_TYPE_AN_EXTENDED = ArabicLigaturizer.DIGIT_TYPE_AN_EXTENDED |
static float | GLOBAL_SPACE_CHAR_RATIO = 0 |
const int | NO_MORE_TEXT = 1 |
const int | NO_MORE_COLUMN = 2 |
Protected Member Functions | |
ArrayList | ConvertColumn (float[] cLine) |
float | FindLimitsPoint (ArrayList wall) |
float[] | FindLimitsOneLine () |
float[] | FindLimitsTwoLines () |
int | GoComposite (bool simulate) |
Protected Attributes | |
int | runDirection = PdfWriter.RUN_DIRECTION_DEFAULT |
float | maxY |
float | minY |
float | leftX |
float | rightX |
int | alignment = Element.ALIGN_LEFT |
ArrayList | leftWall |
ArrayList | rightWall |
BidiLine | bidiLine |
float | yLine |
float | currentLeading = 16 |
float | fixedLeading = 16 |
float | multipliedLeading = 0 |
PdfContentByte | canvas |
PdfContentByte[] | canvases |
int | lineStatus |
float | indent = 0 |
float | followingIndent = 0 |
float | rightIndent = 0 |
float | extraParagraphSpace = 0 |
float | rectangularWidth = -1 |
bool | rectangularMode = false |
float | descender |
bool | composite = false |
ColumnText | compositeColumn |
int | listIdx = 0 |
Phrase | waitPhrase |
Static Protected Attributes | |
const int | LINE_STATUS_OK = 0 |
const int | LINE_STATUS_OFFLIMITS = 1 |
const int | LINE_STATUS_NOLINE = 2 |
Properties | |
float | Leading [get, set] |
float | MultipliedLeading [get] |
float | YLine [get, set] |
int | Alignment [get, set] |
float | Indent [get, set] |
float | FollowingIndent [get, set] |
float | RightIndent [get, set] |
float | ExtraParagraphSpace [get, set] |
float | SpaceCharRatio [get, set] |
int | RunDirection [get, set] |
int | LinesWritten [get] |
int | ArabicOptions [get, set] |
float | Descender [get] |
PdfContentByte | Canvas [get, set] |
PdfContentByte[] | Canvases [get, set] |
bool | UseAscender [get, set] |
float | FilledWidth [get, set] |
bool | AdjustFirstLine [get, set] |
Formats text in a columnwise form. The text is bound on the left and on the right by a sequence of lines. This allows the column to have any shape, not only rectangular.
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.
iTextSharp.text.pdf.ColumnText.ColumnText | ( | PdfContentByte | canvas | ) |
Creates a ColumnText
.
text | the place where the text will be written to. Can be a template. |
void iTextSharp.text.pdf.ColumnText.AddElement | ( | IElement | element | ) |
void iTextSharp.text.pdf.ColumnText.AddText | ( | Chunk | chunk | ) |
Adds a Chunk
to the current text array. Will not have any effect if AddElement() was called before.
chunk | the text |
void iTextSharp.text.pdf.ColumnText.AddText | ( | Phrase | phrase | ) |
Adds a Phrase
to the current text array.
phrase | the text |
void iTextSharp.text.pdf.ColumnText.ClearChunks | ( | ) |
Clears the chunk array. A call to go()
will always return NO_MORE_TEXT.
|
protected |
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.
cLine | the column array |
|
static |
Creates an independent duplicated of the instance org
.
org | the original ColumnText |
|
protected |
Finds the intersection between the yLine
and the two column bounds. It will set the lineStatus
apropriatly.
float[2]
with the x coordinates of the intersection
|
protected |
Finds the intersection between the yLine
and the column. It will set the lineStatus
apropriatly.
wall | the column to intersect |
|
protected |
Finds the intersection between the yLine
, the yLine-leading
and the two column bounds. It will set the lineStatus
apropriatly.
float[4]
with the x coordinates of the intersection
|
static |
Gets the width that the line will occupy after writing. Only the width of the first line is returned.
phrase | the Phrase containing the line |
|
static |
Gets the width that the line will occupy after writing. Only the width of the first line is returned.
phrase | the Phrase containing the line |
runDirection | the run direction |
arabicOptions | the options for the arabic shaping |
int iTextSharp.text.pdf.ColumnText.Go | ( | ) |
Outputs the lines to the document. It is equivalent to go(false)
.
NO_MORE_TEXT
and/or NO_MORE_COLUMN
DocumentException | on error |
int iTextSharp.text.pdf.ColumnText.Go | ( | bool | simulate | ) |
Outputs the lines to the document. The output can be simulated.
simulate | true to simulate the writting to the document |
NO_MORE_TEXT
and/or NO_MORE_COLUMN
DocumentException | on error |
|
protected |
|
static |
Checks the status variable and looks if there's still some text.
ColumnText iTextSharp.text.pdf.ColumnText.SetACopy | ( | ColumnText | org | ) |
void iTextSharp.text.pdf.ColumnText.SetColumns | ( | float[] | leftLine, |
float[] | rightLine | ||
) |
Sets the columns bounds. Each column bound is described by a float[]
with the line points [x1,y1,x2,y2,...]. The array must have at least 4 elements.
leftLine | the left column bound |
rightLine | the right column bound |
void iTextSharp.text.pdf.ColumnText.SetLeading | ( | float | fixedLeading, |
float | multipliedLeading | ||
) |
Sets the leading fixed and variable. The resultant leading will be fixedLeading+multipliedLeading*maxFontSize where maxFontSize is the size of the bigest font in the line.
fixedLeading | the fixed leading |
multipliedLeading | the variable leading |
void iTextSharp.text.pdf.ColumnText.SetSimpleColumn | ( | float | llx, |
float | lly, | ||
float | urx, | ||
float | ury | ||
) |
Simplified method for rectangular columns.
llx | |
lly | |
urx | |
ury |
void iTextSharp.text.pdf.ColumnText.SetSimpleColumn | ( | float | llx, |
float | lly, | ||
float | urx, | ||
float | ury, | ||
float | leading, | ||
int | alignment | ||
) |
Simplified method for rectangular columns.
llx | the lower left x corner |
lly | the lower left y corner |
urx | the upper right x corner |
ury | the upper right y corner |
leading | the leading |
alignment | the column alignment |
void iTextSharp.text.pdf.ColumnText.SetSimpleColumn | ( | Phrase | phrase, |
float | llx, | ||
float | lly, | ||
float | urx, | ||
float | ury, | ||
float | leading, | ||
int | alignment | ||
) |
Simplified method for rectangular columns.
phrase | a Phrase |
llx | the lower left x corner |
lly | the lower left y corner |
urx | the upper right x corner |
ury | the upper right y corner |
leading | the leading |
alignment | the column alignment |
void iTextSharp.text.pdf.ColumnText.SetText | ( | Phrase | phrase | ) |
Replaces the current text array with this Phrase
. Anything added previously with AddElement() is lost.
phrase | the text |
|
static |
Shows a line of text. Only the first line is written.
canvas | where the text is to be written to |
alignment | the alignment |
phrase | the Phrase with the text |
x | the x reference position |
y | the y reference position |
rotation | the rotation to be applied in degrees counterclockwise |
|
static |
Shows a line of text. Only the first line is written.
canvas | where the text is to be written to |
alignment | the alignment. It is not influenced by the run direction |
phrase | the Phrase with the text |
x | the x reference position |
y | the y reference position |
rotation | the rotation to be applied in degrees counterclockwise |
runDirection | the run direction |
arabicOptions | the options for the arabic shaping |
void iTextSharp.text.pdf.ColumnText.UpdateFilledWidth | ( | float | w | ) |
Replaces the filledWidth
if greater than the existing one.
w | the new filledWidth if greater than the existing one |
bool iTextSharp.text.pdf.ColumnText.ZeroHeightElement | ( | ) |
Checks if the element has a height of 0.
|
protected |
|
static |
Compose the tashkeel in the ligatures.
|
static |
Do some extra double ligatures.
int iTextSharp.text.pdf.ColumnText.AR_NOVOWEL = ArabicLigaturizer.ar_novowel |
Eliminate the arabic vowels
|
protected |
The chunks that form the text.
|
protected |
The PdfContent
where the text will be written to.
|
protected |
|
protected |
|
protected |
|
protected |
The leading for the current line.
|
protected |
|
static |
Digit type option: Use Arabic-Indic digits (U+0660...U+0669).
|
static |
Digit type option: Use Eastern (Extended) Arabic-Indic digits (U+06f0...U+06f9).
|
static |
Digit shaping option: Replace Arabic-Indic digits by European digits (U+0030...U+0039).
|
static |
Digit shaping option: Replace European digits (U+0030...U+0039) by Arabic-Indic digits.
|
static |
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.
|
static |
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.
|
protected |
The extra space between paragraphs.
|
protected |
The fixed text leading.
|
protected |
The following paragraph lines indent.
|
static |
|
protected |
The first paragraph line indent.
|
protected |
The left column bound.
|
protected |
|
staticprotected |
The line cannot fit this column position.
|
staticprotected |
The line is out the column limits.
|
staticprotected |
The column is valid.
|
protected |
The line status when trying to fit a line to a column.
|
protected |
|
protected |
Upper bound of the column.
|
protected |
Lower bound of the column.
|
protected |
The text leading that is multiplied by the biggest font size in the line.
|
static |
Signals that there is no more column.
|
static |
Signals that there is no more text available.
|
protected |
|
protected |
The width of the line when the column is defined as a simple rectangle.
|
protected |
The right paragraph lines indent.
|
protected |
The right column bound.
|
protected |
|
protected |
|
protected |
|
protected |
The current y line location. Text will be written at this line minus the leading.
|
getset |
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 is true
by default but can be changed if several objects are to be placed one after the other in the same column calling go() several times.
adjustFirstLine | true to adjust the first line, false otherwise |
|
getset |
Gets the Element.
|
getset |
Sets the arabic shaping options. The option can be AR_NOVOWEL, AR_COMPOSEDTASHKEEL and AR_LIG.
arabicOptions | the arabic shaping options |
|
getset |
Sets the canvas.
canvas |
|
getset |
Sets the canvases.
canvas |
|
get |
Gets the biggest descender value of the last line written.
|
getset |
Sets the extra space between paragraphs.
|
getset |
Sets the real width used by the largest line. Only used to set it to zero to start another measurement.
filledWidth | the real width used by the largest line |
|
getset |
Gets the following paragraph lines indent.
|
getset |
Gets the first paragraph line indent.
|
getset |
Gets the fixed leading
|
get |
Gets the number of lines written.
|
get |
Gets the variable leading
|
getset |
Gets the right paragraph lines indent.
|
getset |
Gets the run direction.
|
getset |
Gets the space/character extra spacing ratio for fully justified text.
|
getset |
Enables/Disables adjustment of first line height based on max ascender.
use | enable adjustment if true |
|
getset |
Gets the yLine.