Interface DocListener
-
- All Superinterfaces:
ElementListener,EventListener
- All Known Implementing Classes:
Document,DocWriter,PdfCopy,PdfStamperImp,PdfWriter
public interface DocListener extends ElementListener
A class that implementsDocListenerwill perform some actions when some actions are performed on aDocument.- See Also:
ElementListener,Document,DocWriter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclearTextWrap()Clears text wrapping around images (if applicable).voidclose()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.voidresetPageCount()Sets the page number to 0.booleansetMarginMirroring(boolean marginMirroring)Parameter that allows you to do 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.gitlab.pdftk_java.com.lowagie.text.ElementListener
add
-
-
-
-
Method Detail
-
open
void open()
Signals that theDocumenthas been opened and thatElementscan be added.
-
setPageSize
boolean setPageSize(Rectangle pageSize)
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 margin mirroring (odd/even pages)- Parameters:
marginMirroring-- Returns:
- true if succesfull
-
newPage
boolean newPage() throws DocumentExceptionSignals that an new page has to be started.- Returns:
trueif the page was added,falseif not.- Throws:
DocumentException- when a document isn't open yet, or has been closed
-
resetPageCount
void resetPageCount()
Sets the page number to 0.
-
setPageCount
void setPageCount(int pageN)
Sets the page number.- Parameters:
pageN- the new page number
-
clearTextWrap
void clearTextWrap() throws DocumentExceptionClears text wrapping around images (if applicable). Method suggested by Pelikan Stephan- Throws:
DocumentException
-
close
void close()
Signals that theDocumentwas closed and that no otherElementswill be added.The outputstream of every writer implementing
DocListenerwill be closed.
-
-