Package com.evopdf
Class Template
java.lang.Object
com.evopdf.ElementsRenderer
com.evopdf.Template
Represents a template element which can be repeated in all PDF document
pages. You can use variables like current PDF page number and the total
number of PDF pages in a template
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addElement
(PageElement pageElement) Adds a PDF page element to this template repeated in each PDF pageGets the template anchoring inside the PDF pageboolean
Gets the flag indicating if the the template is rendered in front of the page main contentdocking()
Gets the the template docking inside the PDF pageboolean
Gets the flag indicating if the template is drawn on the even pagesboolean
Gets the flag indicating if the template is drawn on the first pageboolean
Gets the flag indicating if the template is drawn on the odd pagesfloat
height()
Gets template height for a custom templateboolean
isFooter()
Gets a flag indicating if this template was created as document footerboolean
isHeader()
Gets a flag indicating if this template was created as document headerint
Gets the increment for the total number of pages displayed using &P; variable in aTextElement
orHtmlToPdfVariableElement
added to the templateint
Gets the start index for page numbering using the &p; variable in aTextElement
orHtmlToPdfVariableElement
added to the templateboolean
Gets the flag indicating if the the template is rendered in the back of the page main contentvoid
setAnchoring
(TemplateAnchoring anchoring) Sets the template anchoring inside the PDF pagevoid
setBringToFront
(boolean bringToFront) Sets the flag indicating if the the template is rendered in front of the page main content.void
setDocking
(TemplateDocking docking) Sets the template docking inside the PDF pagevoid
setDrawOnEvenPages
(boolean drawOnEvenPages) Sets the flag indicating if the template is drawn on the even pagesvoid
setDrawOnEvePages
(boolean drawOnFirstPage) Sets the flag indicating if the template is drawn on the first pagevoid
setDrawOnOddPages
(boolean drawOnOddPages) Sets the flag indicating if the template is drawn on the odd pagesvoid
setPageNumberingPageCountIncrement
(int pageNumberingPageCountIncrement) Sets the increment for the total number of pages displayed using &P; variable in aTextElement
orHtmlToPdfVariableElement
added to the templatevoid
setPageNumberingStartIndex
(int pageNumberingStartIndex) Sets the start index for page numbering using the &p; variable in aTextElement
orHtmlToPdfVariableElement
added to the templatevoid
setSendToBackground
(boolean sendToBackground) Sets the flag indicating if the the template is rendered in the back of the page main contentfloat
width()
Gets the template width for a custom templatefloat
x()
Gets template X location for a custom templatefloat
y()
Gets template Y location for a custom templateMethods inherited from class com.evopdf.ElementsRenderer
parentDocument, setParentDocument
-
Method Details
-
width
public float width()Gets the template width for a custom template- Returns:
- the template width
-
height
public float height()Gets template height for a custom template- Returns:
- the template height
-
x
public float x()Gets template X location for a custom template- Returns:
- the template X location
-
y
public float y()Gets template Y location for a custom template- Returns:
- the template Y location
-
isHeader
public boolean isHeader()Gets a flag indicating if this template was created as document header- Returns:
- the flag indicating if this template was created as document header
-
docking
Gets the the template docking inside the PDF page- Returns:
- the template docking inside the PDF page
-
setDocking
Sets the template docking inside the PDF page- Parameters:
docking
- the template docking to set
-
anchoring
Gets the template anchoring inside the PDF page- Returns:
- the template anchoring inside the PDF page
-
setAnchoring
Sets the template anchoring inside the PDF page- Parameters:
anchoring
- the template anchoring to set
-
drawOnOddPages
public boolean drawOnOddPages()Gets the flag indicating if the template is drawn on the odd pages- Returns:
- the flag value
-
setDrawOnOddPages
public void setDrawOnOddPages(boolean drawOnOddPages) Sets the flag indicating if the template is drawn on the odd pages- Parameters:
drawOnOddPages
- the flag value to set
-
drawOnEvenPages
public boolean drawOnEvenPages()Gets the flag indicating if the template is drawn on the even pages- Returns:
- the flag value
-
setDrawOnEvenPages
public void setDrawOnEvenPages(boolean drawOnEvenPages) Sets the flag indicating if the template is drawn on the even pages- Parameters:
drawOnEvenPages
- the flag value to set
-
drawOnFirstPage
public boolean drawOnFirstPage()Gets the flag indicating if the template is drawn on the first page- Returns:
- the flag value
-
setDrawOnEvePages
public void setDrawOnEvePages(boolean drawOnFirstPage) Sets the flag indicating if the template is drawn on the first page- Parameters:
drawOnFirstPage
- the flag value to set
-
pageNumberingStartIndex
public int pageNumberingStartIndex()Gets the start index for page numbering using the &p; variable in aTextElement
orHtmlToPdfVariableElement
added to the template- Returns:
- the current start index
-
setPageNumberingStartIndex
public void setPageNumberingStartIndex(int pageNumberingStartIndex) Sets the start index for page numbering using the &p; variable in aTextElement
orHtmlToPdfVariableElement
added to the template- Parameters:
pageNumberingStartIndex
- the start index to set
-
pageNumberingPageCountIncrement
public int pageNumberingPageCountIncrement()Gets the increment for the total number of pages displayed using &P; variable in aTextElement
orHtmlToPdfVariableElement
added to the template- Returns:
- the current increment
-
setPageNumberingPageCountIncrement
public void setPageNumberingPageCountIncrement(int pageNumberingPageCountIncrement) Sets the increment for the total number of pages displayed using &P; variable in aTextElement
orHtmlToPdfVariableElement
added to the template- Parameters:
pageNumberingPageCountIncrement
- the increment to set
-
bringToFront
public boolean bringToFront()Gets the flag indicating if the the template is rendered in front of the page main content- Returns:
- the flag value
-
setBringToFront
public void setBringToFront(boolean bringToFront) Sets the flag indicating if the the template is rendered in front of the page main content. By default this property is true- Parameters:
bringToFront
- the flag value to set
-
sendToBackground
public boolean sendToBackground()Gets the flag indicating if the the template is rendered in the back of the page main content- Returns:
- the flag value
-
setSendToBackground
public void setSendToBackground(boolean sendToBackground) Sets the flag indicating if the the template is rendered in the back of the page main content- Parameters:
sendToBackground
- the flag value to set
-
addElement
Adds a PDF page element to this template repeated in each PDF page- Specified by:
addElement
in classElementsRenderer
- Parameters:
pageElement
- the page element to add to template
-