public class PDFMultiPageTable extends java.lang.Object implements PDFPageBandSection
Modifier and Type | Class and Description |
---|---|
protected class |
PDFMultiPageTable.CellText
Holds information about a single cell display
|
Modifier and Type | Field and Description |
---|---|
protected float[] |
columnwidthinmm |
Constructor and Description |
---|
PDFMultiPageTable(float[] columnrelativewidth)
Creates a table of columns with different width taking the full page width
|
PDFMultiPageTable(float leftmargin,
float rightmargin,
float[] columnrelativewidth) |
PDFMultiPageTable(float leftmargin,
float rightmargin,
int columnnumber) |
PDFMultiPageTable(int columnnumber)
Creates a table of columns with similar width taking the full page width
|
Modifier and Type | Method and Description |
---|---|
void |
addBlankLine()
Creates a new line without content.
|
void |
addBlankLine(boolean drawlineabove)
Creates a new line without content.
|
void |
addOneLineContent(java.lang.String[] linecontent)
create a new line with the given content and a line above
|
boolean |
breakableSection()
This method specifies if the section can be broken (and so printed across
several pages.
|
java.lang.String |
dropContentSample()
this class drops a content sample for logging purposes.
|
PDFMultiPageTable.CellText |
getCellContent(int row,
int column) |
protected float |
getCellHeight(float columnwidth,
int lineindex,
int columnindex)
calculates the height of the cell.
|
int |
getColumnNumber() |
float |
getSectionHeight(float leftinmm,
float rightinmm)
the height of section that needs to be printed
|
void |
initialize()
This method allows sections to initialize themselves knowning the full
reference of the document before the page number is calculated
|
void |
print(PDFPageBand pageband,
PDFPage currentpage,
float mmfromtopforsection,
float leftinmm,
float rightinmm) |
protected void |
printOneCell(PDFPage currentpage,
int rowindex,
int columnindex,
float mmfromtopforsection,
float currentleft,
float currentcolumnwidth)
This method prints the content of one row of a table.
|
PDFPageBand.PartialPrintFeedback |
printPartial(PDFPageBand pageband,
float spaceleft,
PDFPage currentpage,
float mmfromtopforsection,
float leftinmm,
float rightinmm) |
void |
setCellContent(java.lang.String cellcontent,
int columnindex) |
void |
setCellContent(java.lang.String cellcontent,
int columnindex,
boolean showasnumber) |
void |
setHeader(java.lang.String headertext,
int columnindex) |
void |
setHeaders(java.lang.String[] headertexts) |
void |
setParentDocument(PDFDocument document)
Provides automatically the PDFDocument to the PDFPageBandSection.
|
public PDFMultiPageTable(int columnnumber)
columnnumber
- number of columns of same sizepublic PDFMultiPageTable(float[] columnrelativewidth)
columnrelativewidth
- a table of strictly positive float numbers. It
does not need to be the width of columns in
milimeter as the utility will resize the columns
according to width available, so you can also use
percentage or another scalepublic PDFMultiPageTable(float leftmargin, float rightmargin, int columnnumber)
leftmargin
- space left blank on the left size of the table (betweeen
left border of the page band and table)rightmargin
- space left blank on the right size of the table (betweeen
table and left border of the page band)columnnumber
- number of columns of same sizepublic PDFMultiPageTable(float leftmargin, float rightmargin, float[] columnrelativewidth)
leftmargin
- space left blank on the left size of the table
(betweeen left border of the page band and table)rightmargin
- space left blank on the right size of the table
(betweeen table and left border of the page band)columnrelativewidth
- a table of strictly positive float numbers. It
does not need to be the width of columns in
milimeter as the utility will resize the columns
according to width available, so you can also usepublic int getColumnNumber()
public PDFMultiPageTable.CellText getCellContent(int row, int column)
row
- index of row, starting by 0column
- index of column, starting by 0public void setHeaders(java.lang.String[] headertexts)
headertexts
- the list of header texts (should be consistent with the
column number)public void setHeader(java.lang.String headertext, int columnindex)
headertext
- the text to print as headercolumnindex
- index of column between 0 (included) and columnnumber
(excluded)public void addOneLineContent(java.lang.String[] linecontent)
linecontent
- content of the linepublic void addBlankLine(boolean drawlineabove)
drawlineabove
- if true,draws a line abovepublic void addBlankLine()
public void setCellContent(java.lang.String cellcontent, int columnindex, boolean showasnumber)
cellcontent
- text to include in the cellcolumnindex
- index of the column, starting with zeroshowasnumber
- if true, will display as right aligned constant space
numberpublic void setCellContent(java.lang.String cellcontent, int columnindex)
cellcontent
- columnindex
- protected float getCellHeight(float columnwidth, int lineindex, int columnindex) throws java.io.IOException
columnwidth
- width of the table columnlineindex
- line index starting with 0columnindex
- column index starting with 0java.io.IOException
protected void printOneCell(PDFPage currentpage, int rowindex, int columnindex, float mmfromtopforsection, float currentleft, float currentcolumnwidth) throws java.io.IOException
currentpage
- page to print inrowindex
- index of the row (starting with 0)columnindex
- index of the column (starting with 0)mmfromtopforsection
- vertical position for printing as per pageband
mechanismcurrentleft
- left of the cellcurrentcolumnwidth
- with of the celljava.io.IOException
- if any exception is raised regarding printing of the
contentpublic void print(PDFPageBand pageband, PDFPage currentpage, float mmfromtopforsection, float leftinmm, float rightinmm) throws java.io.IOException
print
in interface PDFPageBandSection
pageband
- pageband calling the method. That allows for
recursive callingcurrentpage
- the page to print intommfromtopforsection
- the cursor location to start printing atleftinmm
- the index of the left most printable space of the
printing sectionrightinmm
- the index of the right most printable space of the
printing sectionjava.io.IOException
public float getSectionHeight(float leftinmm, float rightinmm) throws java.io.IOException
PDFPageBandSection
getSectionHeight
in interface PDFPageBandSection
leftinmm
- the index of the left most printable space of the printing
sectionrightinmm
- the index of the right most printable space of the printing
sectionjava.io.IOException
public boolean breakableSection()
PDFPageBandSection
breakableSection
in interface PDFPageBandSection
public PDFPageBand.PartialPrintFeedback printPartial(PDFPageBand pageband, float spaceleft, PDFPage currentpage, float mmfromtopforsection, float leftinmm, float rightinmm) throws java.io.IOException
printPartial
in interface PDFPageBandSection
pageband
- pageband calling the method. That allows for
recursive callingspaceleft
- the space (height) in mmcurrentpage
- the page to print intommfromtopforsection
- the cursor location to start printing atleftinmm
- the index of the left most printable space of the
printing sectionrightinmm
- the index of the right most printable space of the
printing sectionjava.io.IOException
public java.lang.String dropContentSample()
PDFPageBandSection
dropContentSample
in interface PDFPageBandSection
public void setParentDocument(PDFDocument document)
PDFPageBandSection
setParentDocument
in interface PDFPageBandSection
document
- the parent document to the PDFPageBand.public void initialize()
PDFPageBandSection
initialize
in interface PDFPageBandSection