HiraokaHyperTools.iTextSharp-LGPL
0.2.5
|
A Table is a Rectangle that contains Cells, ordered in some kind of matrix. More...
Public Member Functions | |
Table (int columns) | |
Constructs a Table with a certain number of columns. More... | |
Table (int columns, int rows) | |
Constructs a Table with a certain number of columns and a certain number of Rows. More... | |
override bool | Process (IElementListener listener) |
Processes the element by adding it (or the different parts) to an IElementListener. More... | |
override bool | IsNestable () |
void | AddCell (Cell aCell, int row, int column) |
Adds a Cell to the Table at a certain row and column. More... | |
void | AddCell (Cell aCell, object aLocation) |
Adds a Cell to the Table at a certain location. More... | |
void | AddCell (Cell cell) |
Adds a Cell to the Table. More... | |
void | AddCell (Phrase content) |
Adds a Cell to the Table. More... | |
void | AddCell (Phrase content, System.Drawing.Point location) |
Adds a Cell to the Table. More... | |
void | AddCell (string content) |
Adds a Cell to the Table. More... | |
void | AddCell (string content, System.Drawing.Point location) |
Adds a Cell to the Table. More... | |
void | InsertTable (Table aTable) |
To put a table within the existing table at the current position generateTable will of course re-arrange the widths of the columns. More... | |
void | InsertTable (Table aTable, int row, int column) |
To put a table within the existing table at the given position generateTable will of course re-arrange the widths of the columns. More... | |
void | InsertTable (Table aTable, System.Drawing.Point p) |
To put a table within the existing table at the given position generateTable will of course re-arrange the widths of the columns. More... | |
void | Complete () |
Will fill empty cells with valid blank Cells More... | |
void | DeleteColumn (int column) |
Deletes a column in this table. More... | |
bool | DeleteRow (int row) |
Deletes a row. More... | |
void | DeleteAllRows () |
bool | DeleteLastRow () |
Deletes the last row in this table. More... | |
int | EndHeaders () |
Marks the last row of the table headers. More... | |
void | SetAlignment (string alignment) |
Sets the alignment of this paragraph. More... | |
void | SetWidths (int[] widths) |
Sets the widths of the different columns (percentages). More... | |
IEnumerator | GetEnumerator () |
Gets an Iterator of all the Rows. More... | |
object | GetElement (int row, int column) |
returns the element at the position row, column (Cast to Cell or Table) More... | |
void | AddColumns (int aColumns) |
Gives you the posibility to add columns. More... | |
float[] | GetWidths (float left, float totalWidth) |
Gets an array with the positions of the borders between every column. More... | |
override float | GetBottom (float margin) |
Returns the lower left y-coordinate, considering a given margin. More... | |
override float | GetLeft (float margin) |
Returns the lower left x-coordinate, considering a given margin. More... | |
override float | GetRight (float margin) |
Returns the upper right x-coordinate, considering a given margin. More... | |
override float | GetTop (float margin) |
Returns the upper right y-coordinate, considering a given margin. More... | |
PdfPTable | CreatePdfPTable () |
void | FlushContent () |
![]() | |
Rectangle (float llx, float lly, float urx, float ury) | |
Constructs a Rectangle-object. More... | |
Rectangle (float urx, float ury) | |
Constructs a Rectangle-object starting from the origin (0, 0). More... | |
Rectangle (Rectangle rect) | |
Constructs a Rectangle-object. More... | |
virtual void | CloneNonPositionParameters (Rectangle rect) |
virtual void | SoftCloneNonPositionParameters (Rectangle rect) |
bool | IsContent () |
virtual void | Normalize () |
Rectangle | GetRectangle (float top, float bottom) |
Gets a Rectangle that is altered to fit on the page. More... | |
Rectangle | Rotate () |
Swaps the values of urx and ury and of lly and llx in order to rotate the rectangle. More... | |
virtual void | EnableBorderSide (int side) |
virtual void | DisableBorderSide (int side) |
bool | HasBorders () |
Indicates if the table has borders. More... | |
bool | HasBorder (int type) |
Indicates if the table has a some type of border. More... | |
override String | ToString () |
Gets the content of the text element. More... | |
Protected Attributes | |
bool | convert2pdfptable = false |
bool | notAddedYet = true |
bool | complete = true |
![]() | |
float | llx |
the lower left x-coordinate. More... | |
float | lly |
summary> the upper right x-coordinate. More... | |
float | urx |
summary> the upper right y-coordinate. More... | |
float | ury |
summary> This represents the status of the 4 sides of the rectangle. More... | |
int | border = UNDEFINED |
summary> This is the width of the border around this rectangle. More... | |
float | borderWidth = UNDEFINED |
summary> This is the color of the border of this rectangle. More... | |
Color | borderColor = null |
Color | borderColorLeft = null |
Color | borderColorRight = null |
Color | borderColorTop = null |
Color | borderColorBottom = null |
float | borderWidthLeft = UNDEFINED |
float | borderWidthRight = UNDEFINED |
float | borderWidthTop = UNDEFINED |
float | borderWidthBottom = UNDEFINED |
bool | useVariableBorders = false |
summary> This is the color of the background of this rectangle. More... | |
Color | backgroundColor = null |
summary> This is the rotation value of this rectangle. More... | |
int | rotation = 0 |
Properties | |
Cell | DefaultLayout [get, set] |
Cell | DefaultCell [get, set] |
bool | AutoFillEmptyCells [set] |
Enables/disables automatic insertion of empty cells before table is rendered. (default = false) More... | |
bool | TableFitsPage [get, set] |
Allows you to control when a page break occurs. More... | |
bool | CellsFitPage [get, set] |
Allows you to control when a page break occurs. More... | |
float | Offset [get, set] |
Get/set the offset of this table. More... | |
override int | Type [get] |
Gets the type of the text element. More... | |
int | DefaultCellBorder [set] |
Changes the border in the default layout of the Cells added with method AddCell(string content). More... | |
float | DefaultCellBorderWidth [set] |
Changes the width of the borders in the default layout of the Cells added with method AddCell(string content). More... | |
Color | DefaultCellBorderColor [set] |
Changes the bordercolor in the default layout of the Cells added with method AddCell(string content). More... | |
Color | DefaultCellBackgroundColor [set] |
Changes the backgroundcolor in the default layout of the Cells added with method AddCell(string content). More... | |
float | DefaultCellGrayFill [set] |
Changes the grayfill in the default layout of the Cells added with method AddCell(string content). More... | |
int | DefaultHorizontalAlignment [set] |
Changes the horizontalalignment in the default layout of the Cells added with method AddCell(string content). More... | |
int | DefaultVerticalAlignment [set] |
Changes the verticalAlignment in the default layout of the Cells added with method AddCell(string content). More... | |
int | DefaultRowspan [set] |
Changes the rowspan in the default layout of the Cells added with method AddCell(string content). More... | |
int | DefaultColspan [set] |
Changes the colspan in the default layout of the Cells added with method AddCell(string content). More... | |
int | LastHeaderRow [get, set] |
Sets the horizontal Element. More... | |
float | Padding [set] |
Sets the cellpadding. More... | |
float | Spacing [set] |
Sets the cellspacing. More... | |
float[] | Widths [set] |
Sets the widths of the different columns (percentages). More... | |
int | Columns [get] |
Gets the number of columns. More... | |
int | Size [get] |
Gets the number of rows in this Table. More... | |
float[] | ProportionalWidths [get] |
Gets the proportional widths of the columns in this Table. More... | |
int | Alignment [get, set] |
Get/set the horizontal Element. More... | |
float | Cellpadding [get, set] |
Get/set the cellpadding. More... | |
float | Cellspacing [get, set] |
Get/set the cellspacing. More... | |
override float | Width [get, set] |
Get/set the table width (a percentage). More... | |
System.Drawing.Dimension | Dimension [get] |
Gets the dimension of this table More... | |
int | NextRow [get] |
int | NextColumn [get] |
override float | Bottom [get, set] |
override float | Left [get, set] |
override float | Right [get, set] |
override float | Top [get, set] |
bool | Convert2pdfptable [get, set] |
bool | Locked [get, set] |
bool | NotAddedYet [get, set] |
bool | ElementComplete [get, set] |
![]() | |
virtual int | Type [get] |
Gets the type of the text element. More... | |
virtual ArrayList | Chunks [get] |
Gets all the chunks in this element. More... | |
virtual float | Top [get, set] |
Get/set the upper right y-coordinate. More... | |
virtual int | Border [get, set] |
Get/set the border More... | |
virtual float | GrayFill [get, set] |
Get/set the grayscale of the rectangle. More... | |
virtual float | Left [get, set] |
Get/set the lower left x-coordinate. More... | |
virtual float | Right [get, set] |
Get/set the upper right x-coordinate. More... | |
virtual float | Bottom [get, set] |
Get/set the lower left y-coordinate. More... | |
virtual Color | BorderColorBottom [get, set] |
virtual Color | BorderColorTop [get, set] |
virtual Color | BorderColorLeft [get, set] |
virtual Color | BorderColorRight [get, set] |
virtual float | Width [get, set] |
Returns the width of the rectangle. More... | |
float | Height [get] |
Returns the height of the rectangle. More... | |
virtual float | BorderWidth [get, set] |
Get/set the borderwidth. More... | |
virtual Color | BorderColor [get, set] |
Get/set the color of the border. More... | |
virtual Color | BackgroundColor [get, set] |
Get/set the backgroundcolor. More... | |
int | Rotation [get] |
Returns the rotation More... | |
virtual float | BorderWidthLeft [get, set] |
virtual float | BorderWidthRight [get, set] |
virtual float | BorderWidthTop [get, set] |
virtual float | BorderWidthBottom [get, set] |
virtual bool | UseVariableBorders [get, set] |
![]() | |
int | Type [get] |
Gets the type of the text element. More... | |
ArrayList | Chunks [get] |
Gets all the chunks in this element. More... | |
![]() | |
bool | ElementComplete [get, set] |
Additional Inherited Members | |
![]() | |
const int | UNDEFINED = -1 |
This is the value that will be used as undefined. More... | |
const int | TOP_BORDER = 1 |
summary> This represents one side of the border of the Rectangle. More... | |
const int | BOTTOM_BORDER = 2 |
summary> This represents one side of the border of the Rectangle. More... | |
const int | LEFT_BORDER = 4 |
summary> This represents one side of the border of the Rectangle. More... | |
const int | RIGHT_BORDER = 8 |
summary> This represents a rectangle without borders. More... | |
const int | NO_BORDER = 0 |
summary> This represents a type of border. More... | |
const int | BOX = TOP_BORDER + BOTTOM_BORDER + LEFT_BORDER + RIGHT_BORDER |
![]() | |
const int | HEADER = 0 |
This is a possible type of Element. More... | |
const int | TITLE = 1 |
This is a possible type of Element. More... | |
const int | SUBJECT = 2 |
This is a possible type of Element. More... | |
const int | KEYWORDS = 3 |
This is a possible type of Element. More... | |
const int | AUTHOR = 4 |
This is a possible type of Element. More... | |
const int | PRODUCER = 5 |
This is a possible type of Element. More... | |
const int | CREATIONDATE = 6 |
This is a possible type of Element. More... | |
const int | CREATOR = 7 |
This is a possible type of Element. More... | |
const int | CHUNK = 10 |
This is a possible type of Element. More... | |
const int | PHRASE = 11 |
This is a possible type of Element. More... | |
const int | PARAGRAPH = 12 |
This is a possible type of Element. More... | |
const int | SECTION = 13 |
This is a possible type of Element More... | |
const int | LIST = 14 |
This is a possible type of Element More... | |
const int | LISTITEM = 15 |
This is a possible type of Element More... | |
const int | CHAPTER = 16 |
This is a possible type of Element More... | |
const int | ANCHOR = 17 |
This is a possible type of Element More... | |
const int | CELL = 20 |
This is a possible type of Element. More... | |
const int | ROW = 21 |
This is a possible type of Element. More... | |
const int | TABLE = 22 |
This is a possible type of Element. More... | |
const int | PTABLE = 23 |
This is a possible type of Element. More... | |
const int | ANNOTATION = 29 |
This is a possible type of Element. More... | |
const int | RECTANGLE = 30 |
This is a possible type of Element. More... | |
const int | JPEG = 32 |
This is a possible type of Element. More... | |
const int | JPEG2000 = 33 |
const int | IMGRAW = 34 |
This is a possible type of Element. More... | |
const int | IMGTEMPLATE = 35 |
This is a possible type of Element. More... | |
const int | JBIG2 = 36 |
const int | MULTI_COLUMN_TEXT = 40 |
This is a possible type of More... | |
const int | MARKED = 50 |
const int | YMARK = 55 |
const int | ALIGN_UNDEFINED = -1 |
A possible value for paragraph Element. This specifies that the text is aligned to the left indent and extra whitespace should be placed on the right. More... | |
const int | ALIGN_LEFT = 0 |
A possible value for paragraph Element. This specifies that the text is aligned to the left indent and extra whitespace should be placed on the right. More... | |
const int | ALIGN_CENTER = 1 |
A possible value for paragraph Element. This specifies that the text is aligned to the center and extra whitespace should be placed equally on the left and right. More... | |
const int | ALIGN_RIGHT = 2 |
A possible value for paragraph Element. This specifies that the text is aligned to the right indent and extra whitespace should be placed on the left. More... | |
const int | ALIGN_JUSTIFIED = 3 |
A possible value for paragraph Element. This specifies that extra whitespace should be spread out through the rows of the paragraph with the text lined up with the left and right indent except on the last line which should be aligned to the left. More... | |
const int | ALIGN_TOP = 4 |
A possible value for vertical Element. More... | |
const int | ALIGN_MIDDLE = 5 |
A possible value for vertical Element. More... | |
const int | ALIGN_BOTTOM = 6 |
A possible value for vertical Element. More... | |
const int | ALIGN_BASELINE = 7 |
A possible value for vertical Element. More... | |
const int | ALIGN_JUSTIFIED_ALL = 8 |
Does the same as ALIGN_JUSTIFIED but the last line is also spread out. More... | |
const int | CCITTG4 = 0x100 |
Pure two-dimensional encoding (Group 4) More... | |
const int | CCITTG3_1D = 0x101 |
Pure one-dimensional encoding (Group 3, 1-D) More... | |
const int | CCITTG3_2D = 0x102 |
Mixed one- and two-dimensional encoding (Group 3, 2-D) More... | |
const int | CCITT_BLACKIS1 = 1 |
A flag indicating whether 1-bits are to be interpreted as black pixels and 0-bits as white pixels, More... | |
const int | CCITT_ENCODEDBYTEALIGN = 2 |
A flag indicating whether the filter expects extra 0-bits before each encoded line so that the line begins on a byte boundary. More... | |
const int | CCITT_ENDOFLINE = 4 |
A flag indicating whether end-of-line bit patterns are required to be present in the encoding. More... | |
const int | CCITT_ENDOFBLOCK = 8 |
A flag indicating whether the filter expects the encoded data to be terminated by an end-of-block pattern, overriding the Rows parameter. The use of this flag will set the key /EndOfBlock to false. More... | |
A Table is a Rectangle that contains Cells, ordered in some kind of matrix.
Tables that span multiple pages are cut into different parts automatically. If you want a table header to be repeated on every page, you may not forget to mark the end of the header section by using the method EndHeaders().
The matrix of a table is not necessarily an m x n-matrix. It can contain holes or cells that are bigger than the unit. Believe me or not, but it took some serious thinking to make this as userfriendly as possible. I hope you wil find the result quite simple (I love simple solutions, especially for complex problems).
The result of this code is a table:
header | ||
---|---|---|
example cell with colspan 1 and rowspan 2 | 1.1 | 2.1 |
1.2 | 2.2 | |
cell test1 | big cell | |
cell test2 |
iTextSharp.text.Table.Table | ( | int | columns | ) |
Constructs a Table with a certain number of columns.
columns | The number of columns in the table |
<overloads> Has three overloads </overloads>
iTextSharp.text.Table.Table | ( | int | columns, |
int | rows | ||
) |
Constructs a Table with a certain number of columns and a certain number of Rows.
columns | The number of columns in the table |
rows | The number of rows |
<overloads> Has three overloads </overloads>
void iTextSharp.text.Table.AddCell | ( | Cell | aCell, |
int | row, | ||
int | column | ||
) |
void iTextSharp.text.Table.AddCell | ( | Cell | aCell, |
object | aLocation | ||
) |
void iTextSharp.text.Table.AddCell | ( | Phrase | content | ) |
void iTextSharp.text.Table.AddCell | ( | Phrase | content, |
System.Drawing.Point | location | ||
) |
void iTextSharp.text.Table.AddCell | ( | string | content | ) |
This is a shortcut for AddCell(Cell cell). The string will be converted to a Cell.
content | a string |
void iTextSharp.text.Table.AddCell | ( | string | content, |
System.Drawing.Point | location | ||
) |
void iTextSharp.text.Table.AddColumns | ( | int | aColumns | ) |
Gives you the posibility to add columns.
aColumns | the number of columns to add |
void iTextSharp.text.Table.Complete | ( | ) |
Will fill empty cells with valid blank Cells
PdfPTable iTextSharp.text.Table.CreatePdfPTable | ( | ) |
Create a PdfPTable based on this Table object.
BadElementException |
void iTextSharp.text.Table.DeleteAllRows | ( | ) |
Deletes all rows in this table. (contributed by dpere) zcar @fcc. es
void iTextSharp.text.Table.DeleteColumn | ( | int | column | ) |
Deletes a column in this table.
column | the number of the column that has to be deleted |
bool iTextSharp.text.Table.DeleteLastRow | ( | ) |
Deletes the last row in this table.
bool iTextSharp.text.Table.DeleteRow | ( | int | row | ) |
Deletes a row.
row | the number of the row to delete |
int iTextSharp.text.Table.EndHeaders | ( | ) |
Marks the last row of the table headers.
void iTextSharp.text.Table.FlushContent | ( | ) |
Implements iTextSharp.text.ILargeElement.
|
virtual |
Returns the lower left y-coordinate, considering a given margin.
margin | a margin |
Reimplemented from iTextSharp.text.Rectangle.
object iTextSharp.text.Table.GetElement | ( | int | row, |
int | column | ||
) |
IEnumerator iTextSharp.text.Table.GetEnumerator | ( | ) |
Gets an Iterator of all the Rows.
|
virtual |
Returns the lower left x-coordinate, considering a given margin.
margin | a margin |
Reimplemented from iTextSharp.text.Rectangle.
|
virtual |
Returns the upper right x-coordinate, considering a given margin.
margin | a margin |
Reimplemented from iTextSharp.text.Rectangle.
|
virtual |
Returns the upper right y-coordinate, considering a given margin.
margin | a margin |
Reimplemented from iTextSharp.text.Rectangle.
float [] iTextSharp.text.Table.GetWidths | ( | float | left, |
float | totalWidth | ||
) |
Gets an array with the positions of the borders between every column.
This method translates the widths expressed in percentages into the x-coordinate of the borders of the columns on a real document.
left | this is the position of the first border at the left (cellpadding not included) |
totalWidth | this is the space between the first border at the left and the last border at the right (cellpadding not included) |
void iTextSharp.text.Table.InsertTable | ( | Table | aTable | ) |
To put a table within the existing table at the current position generateTable will of course re-arrange the widths of the columns.
aTable | the table you want to insert |
void iTextSharp.text.Table.InsertTable | ( | Table | aTable, |
int | row, | ||
int | column | ||
) |
void iTextSharp.text.Table.InsertTable | ( | Table | aTable, |
System.Drawing.Point | p | ||
) |
To put a table within the existing table at the given position generateTable will of course re-arrange the widths of the columns.
aTable | the table you want to insert |
aLocation | a System.Drawing.Point |
|
virtual |
Gets all the chunks in this element.
Reimplemented from iTextSharp.text.Rectangle.
|
virtual |
Processes the element by adding it (or the different parts) to an IElementListener.
listener | an IElementListener |
Reimplemented from iTextSharp.text.Rectangle.
void iTextSharp.text.Table.SetAlignment | ( | string | alignment | ) |
Sets the alignment of this paragraph.
alignment | the new alignment as a string |
void iTextSharp.text.Table.SetWidths | ( | int[] | widths | ) |
Sets the widths of the different columns (percentages).
You can give up relative values of borderwidths. The sum of these values will be considered 100%. The values will be recalculated as percentages of this sum.
widths | an array with values |
|
protected |
Indicates if the PdfPTable is complete once added to the document.
|
protected |
if you want to generate tables the old way, set this value to false.
|
protected |
Indicates if this is the first time the section was added.
|
getset |
Get/set the horizontal Element.
a value
|
set |
Enables/disables automatic insertion of empty cells before table is rendered. (default = false)
As some people may want to create a table, fill only a couple of the cells and don't bother with investigating which empty ones need to be added, this default behaviour may be very welcome. Disabling is recommended to increase speed. (empty cells should be added through extra code then)
enable/disable autofill
|
getset |
|
getset |
Get/set the cellpadding.
the cellpadding
|
getset |
Allows you to control when a page break occurs.
When a cell doesn't fit a page, it is split in two parts. If you want to avoid this, you should set the cellsFitPage value to true.
a value
|
getset |
Get/set the cellspacing.
the cellspacing
|
get |
Gets the number of columns.
a value
|
getset |
|
getset |
|
set |
Changes the backgroundcolor in the default layout of the Cells added with method AddCell(string content).
the new color
|
set |
Changes the border in the default layout of the Cells added with method AddCell(string content).
the new border value
|
set |
Changes the bordercolor in the default layout of the Cells added with method AddCell(string content).
|
set |
Changes the width of the borders in the default layout of the Cells added with method AddCell(string content).
the new width
|
set |
Changes the grayfill in the default layout of the Cells added with method AddCell(string content).
the new value
|
set |
Changes the colspan in the default layout of the Cells added with method AddCell(string content).
the new colspan value
|
set |
Changes the horizontalalignment in the default layout of the Cells added with method AddCell(string content).
the new alignment value
|
getset |
|
set |
Changes the rowspan in the default layout of the Cells added with method AddCell(string content).
the new rowspan value
|
set |
Changes the verticalAlignment in the default layout of the Cells added with method AddCell(string content).
the new alignment value
|
get |
Gets the dimension of this table
the dimension
|
getset |
|
getset |
Sets the horizontal Element.
the new value
|
getset |
|
getset |
|
get |
Returns the next column 0-based index where a new cell would be added. (contributed by dpere) zcar @fcc. es
|
get |
Returns the next row 0-based index where a new cell would be added. (contributed by dpere) zcar @fcc. es
|
getset |
Indicates if this is the first time the section is added.
|
getset |
Get/set the offset of this table.
the space between this table and the previous element.
|
set |
Sets the cellpadding.
the new value
|
get |
|
getset |
|
get |
|
set |
Sets the cellspacing.
the new value
|
getset |
Allows you to control when a page break occurs.
When a table doesn't fit a page, it is split in two parts. If you want to avoid this, you should set the tableFitsPage value to true.
a value
|
getset |
|
get |
Gets the type of the text element.
a type
|
getset |
Get/set the table width (a percentage).
the table width (a percentage)
|
set |
Sets the widths of the different columns (percentages).
You can give up relative values of borderwidths. The sum of these values will be considered 100%. The values will be recalculated as percentages of this sum.
float[] widths = {2, 1, 1}; table.SetWidths(widths)
The widths will be: a width of 50% for the first column, 25% for the second and third column.
an array with values