class AbstractReportBuilder.PageCanvas extends java.lang.Object implements AbstractReportBuilder.IPageCanvas
Modifier and Type | Field and Description |
---|---|
private java.util.LinkedList<AbstractReportBuilder.ColumnInfo<?>> |
columnRange
The column range.
|
private org.apache.pdfbox.pdmodel.PDDocument |
doc
The doc.
|
private org.apache.pdfbox.pdmodel.PDPage |
page
The page.
|
private int |
pageNumber
The page number.
|
private AbstractReportBuilder.PageState |
state
The state.
|
Constructor and Description |
---|
PageCanvas(org.apache.pdfbox.pdmodel.PDDocument doc,
org.apache.pdfbox.pdmodel.PDPage page,
int pageNumber,
AbstractReportBuilder.PageState state)
Instantiates a new page canvas.
|
Modifier and Type | Method and Description |
---|---|
private org.apache.pdfbox.pdmodel.PDPageContentStream |
createContentStream()
Creates the content stream.
|
AbstractReportBuilder.PageCanvas |
drawTextAtLeftTopCorner(java.lang.String text,
org.apache.pdfbox.pdmodel.font.PDFont font,
float fontSize,
float lineWidth,
float x,
float y)
Draw the provided text at (x, y) upper left corner
|
AbstractReportBuilder.PageCanvas |
drawTextAtRightTopCorner(java.lang.String text,
org.apache.pdfbox.pdmodel.font.PDFont font,
float fontSize,
float lineWidth,
float x,
float y)
Draw the provided text aligned right at y upper level
|
AbstractReportBuilder.PageCanvas |
drawTextCentered(java.lang.String text,
org.apache.pdfbox.pdmodel.font.PDFont font,
float fontSize,
float lineWidth,
float width,
float x,
float y)
Draw the provided text centered at y upper level
|
java.util.LinkedList<AbstractReportBuilder.ColumnInfo<?>> |
getColumnRange()
Gets the current column range that have been drawn on this page canvas already
|
org.apache.pdfbox.pdmodel.PDDocument |
getDoc()
Gets the doc.
|
org.apache.pdfbox.pdmodel.PDPage |
getPage()
Gets the page.
|
int |
getPageNumber()
Gets the page number.
|
AbstractReportBuilder.PageState |
getState()
Gets the current page state.
|
AbstractReportBuilder.PageCanvas |
strokeHorizontal(float x,
float y,
float width,
float lineWidth)
Draws the horizontal starting at (x, y) upper left corner provided with its width
and its line width.
|
AbstractReportBuilder.PageCanvas |
strokeRectangle(float x,
float y,
float width,
float height)
Draws the shape of a rectangle provided by its (x, y) upper left corner and its size.
|
AbstractReportBuilder.PageCanvas |
strokeVertical(float x,
float y,
float height,
float lineWidth)
Draws the vertical starting at (x, y) upper left corner provided with its height
and its line width.
|
private org.apache.pdfbox.pdmodel.PDDocument doc
private org.apache.pdfbox.pdmodel.PDPage page
private int pageNumber
private AbstractReportBuilder.PageState state
private java.util.LinkedList<AbstractReportBuilder.ColumnInfo<?>> columnRange
PageCanvas(org.apache.pdfbox.pdmodel.PDDocument doc, org.apache.pdfbox.pdmodel.PDPage page, int pageNumber, AbstractReportBuilder.PageState state)
doc
- The current docpage
- The pagepageNumber
- The page numberstate
- The statepublic org.apache.pdfbox.pdmodel.PDDocument getDoc()
public org.apache.pdfbox.pdmodel.PDPage getPage()
public int getPageNumber()
getPageNumber
in interface AbstractReportBuilder.IPageCanvas
AbstractReportBuilder.IPageCanvas.getPageNumber()
public AbstractReportBuilder.PageState getState()
getState
in interface AbstractReportBuilder.IPageCanvas
AbstractReportBuilder.IPageCanvas.getState()
public java.util.LinkedList<AbstractReportBuilder.ColumnInfo<?>> getColumnRange()
getColumnRange
in interface AbstractReportBuilder.IPageCanvas
AbstractReportBuilder.IPageCanvas.getColumnRange()
private org.apache.pdfbox.pdmodel.PDPageContentStream createContentStream() throws java.io.IOException
java.io.IOException
- The IO exception if there is a failed output operationpublic AbstractReportBuilder.PageCanvas strokeRectangle(float x, float y, float width, float height) throws java.io.IOException
strokeRectangle
in interface AbstractReportBuilder.IPageCanvas
x
- The rectangle's left side coordinatey
- The rectangle's top side coordinatewidth
- The rectangle's widthheight
- The rectangle's heightjava.io.IOException
- The IO exception if there is a failed output operationpublic AbstractReportBuilder.PageCanvas strokeVertical(float x, float y, float height, float lineWidth) throws java.io.IOException
strokeVertical
in interface AbstractReportBuilder.IPageCanvas
x
- The vertical's left side coordinatey
- The vertical's top side coordinateheight
- The height of the verticallineWidth
- The line widthjava.io.IOException
- The IO exception if there is a failed output operationpublic AbstractReportBuilder.PageCanvas strokeHorizontal(float x, float y, float width, float lineWidth) throws java.io.IOException
strokeHorizontal
in interface AbstractReportBuilder.IPageCanvas
x
- The horizontal's left side coordinatey
- The horizontal's top side coordinatewidth
- The width of the horizontallineWidth
- The line widthjava.io.IOException
- The IO exception if there is a failed output operationpublic AbstractReportBuilder.PageCanvas drawTextAtLeftTopCorner(java.lang.String text, org.apache.pdfbox.pdmodel.font.PDFont font, float fontSize, float lineWidth, float x, float y) throws java.io.IOException
drawTextAtLeftTopCorner
in interface AbstractReportBuilder.IPageCanvas
text
- The textfont
- The fontfontSize
- The font sizelineWidth
- The line widthx
- The left side text positiony
- The top side text positionjava.io.IOException
- The IO exception if there is a failed output operationpublic AbstractReportBuilder.PageCanvas drawTextCentered(java.lang.String text, org.apache.pdfbox.pdmodel.font.PDFont font, float fontSize, float lineWidth, float width, float x, float y) throws java.io.IOException
drawTextCentered
in interface AbstractReportBuilder.IPageCanvas
text
- The textfont
- The fontfontSize
- The font sizelineWidth
- The line widthx
- The left side text positiony
- The top side text positionjava.io.IOException
- The IO exception if there is a failed output operationpublic AbstractReportBuilder.PageCanvas drawTextAtRightTopCorner(java.lang.String text, org.apache.pdfbox.pdmodel.font.PDFont font, float fontSize, float lineWidth, float x, float y) throws java.io.IOException
drawTextAtRightTopCorner
in interface AbstractReportBuilder.IPageCanvas
text
- The textfont
- The fontfontSize
- The font sizelineWidth
- The line widthx
- The left side text positiony
- The top side text positionjava.io.IOException
- The IO exception if there is a failed output operation