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 TypeMethodDescriptionvoidaddElement(PageElement pageElement) Adds a PDF page element to this template repeated in each PDF pageGets the template anchoring inside the PDF pagebooleanGets the flag indicating if the the template is rendered in front of the page main contentdocking()Gets the the template docking inside the PDF pagebooleanGets the flag indicating if the template is drawn on the even pagesbooleanGets the flag indicating if the template is drawn on the first pagebooleanGets the flag indicating if the template is drawn on the odd pagesfloatheight()Gets template height for a custom templatebooleanisFooter()Gets a flag indicating if this template was created as document footerbooleanisHeader()Gets a flag indicating if this template was created as document headerintGets the increment for the total number of pages displayed using &P; variable in aTextElementorHtmlToPdfVariableElementadded to the templateintGets the start index for page numbering using the &p; variable in aTextElementorHtmlToPdfVariableElementadded to the templatebooleanGets the flag indicating if the the template is rendered in the back of the page main contentvoidsetAnchoring(TemplateAnchoring anchoring) Sets the template anchoring inside the PDF pagevoidsetBringToFront(boolean bringToFront) Sets the flag indicating if the the template is rendered in front of the page main content.voidsetDocking(TemplateDocking docking) Sets the template docking inside the PDF pagevoidsetDrawOnEvenPages(boolean drawOnEvenPages) Sets the flag indicating if the template is drawn on the even pagesvoidsetDrawOnEvePages(boolean drawOnFirstPage) Sets the flag indicating if the template is drawn on the first pagevoidsetDrawOnOddPages(boolean drawOnOddPages) Sets the flag indicating if the template is drawn on the odd pagesvoidsetPageNumberingPageCountIncrement(int pageNumberingPageCountIncrement) Sets the increment for the total number of pages displayed using &P; variable in aTextElementorHtmlToPdfVariableElementadded to the templatevoidsetPageNumberingStartIndex(int pageNumberingStartIndex) Sets the start index for page numbering using the &p; variable in aTextElementorHtmlToPdfVariableElementadded to the templatevoidsetSendToBackground(boolean sendToBackground) Sets the flag indicating if the the template is rendered in the back of the page main contentfloatwidth()Gets the template width for a custom templatefloatx()Gets template X location for a custom templatefloaty()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 aTextElementorHtmlToPdfVariableElementadded 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 aTextElementorHtmlToPdfVariableElementadded 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 aTextElementorHtmlToPdfVariableElementadded 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 aTextElementorHtmlToPdfVariableElementadded 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:
addElementin classElementsRenderer- Parameters:
pageElement- the page element to add to template
-