Package com.lowagie.text
Interface DocListener
- All Superinterfaces:
ElementListener,EventListener
- All Known Implementing Classes:
Document,DocWriter,HTMLWorker,HtmlWriter,PdfCopy,PdfDocument,PdfSmartCopy,PdfStamperImp,PdfWriter,UnembedFontPdfSmartCopy
A class that implements
DocListener will perform some
actions when some actions are performed on a Document.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Signals that theDocumentwas closed and that no otherElementswill be added.booleannewPage()Signals that an new page has to be started.voidopen()Signals that theDocumenthas been opened and thatElementscan be added.voidResets the footer of this document.voidResets the header of this document.voidSets the page number to 0.voidsetFooter(HeaderFooter footer) Changes the footer of this document.voidsetHeader(HeaderFooter header) Changes the header of this document.booleansetMarginMirroring(boolean marginMirroring) Parameter that allows you to do left/right margin mirroring (odd/even pages)booleansetMarginMirroringTopBottom(boolean marginMirroringTopBottom) Parameter that allows you to do top/bottom margin mirroring (odd/even pages)booleansetMargins(float marginLeft, float marginRight, float marginTop, float marginBottom) Sets the margins.voidsetPageCount(int pageN) Sets the page number.booleansetPageSize(Rectangle pageSize) Sets the pagesize.Methods inherited from interface com.lowagie.text.ElementListener
add
-
Method Details
-
open
void open()Signals that theDocumenthas been opened and thatElementscan be added. -
close
void close()Signals that theDocumentwas closed and that no otherElementswill be added.The outputstream of every writer implementing
DocListenerwill be closed. -
newPage
boolean newPage()Signals that an new page has to be started.- Returns:
trueif the page was added,falseif not.
-
setPageSize
Sets the pagesize.- Parameters:
pageSize- the new pagesize- Returns:
- a
boolean
-
setMargins
boolean setMargins(float marginLeft, float marginRight, float marginTop, float marginBottom) Sets the margins.- Parameters:
marginLeft- the margin on the leftmarginRight- the margin on the rightmarginTop- the margin on the topmarginBottom- the margin on the bottom- Returns:
- a
boolean
-
setMarginMirroring
boolean setMarginMirroring(boolean marginMirroring) Parameter that allows you to do left/right margin mirroring (odd/even pages)- Parameters:
marginMirroring-- Returns:
- true if successful
-
setMarginMirroringTopBottom
boolean setMarginMirroringTopBottom(boolean marginMirroringTopBottom) Parameter that allows you to do top/bottom margin mirroring (odd/even pages)- Parameters:
marginMirroringTopBottom-- Returns:
- true if successful
- Since:
- 2.1.6
-
setPageCount
void setPageCount(int pageN) Sets the page number.- Parameters:
pageN- the new page number
-
resetPageCount
void resetPageCount()Sets the page number to 0. -
resetHeader
void resetHeader()Resets the header of this document.
-