Interface DocListener
- All Superinterfaces:
ElementListener
,EventListener
- All Known Implementing Classes:
Document
,DocWriter
,FdfWriter.Wrt
,PdfCopy
,PdfCopyFieldsImp
,PdfDocument
,PdfStamperImp
,PdfWriter
A class that implements
DocListener
will perform some
actions when some actions are performed on a Document
.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clears text wrapping around images (if applicable).void
close()
Signals that theDocument
was closed and that no otherElements
will be added.boolean
newPage()
Signals that an new page has to be started.void
open()
Signals that theDocument
has been opened and thatElements
can be added.void
Sets the page number to 0.boolean
setMarginMirroring
(boolean marginMirroring) Parameter that allows you to do margin mirroring (odd/even pages)boolean
setMargins
(float marginLeft, float marginRight, float marginTop, float marginBottom) Sets the margins.void
setPageCount
(int pageN) Sets the page number.boolean
setPageSize
(Rectangle pageSize) Sets the pagesize.Methods inherited from interface com.gitlab.pdftk_java.com.lowagie.text.ElementListener
add
-
Method Details
-
open
void open()Signals that theDocument
has been opened and thatElements
can be added. -
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 margin mirroring (odd/even pages)- Parameters:
marginMirroring
-- Returns:
- true if succesfull
-
newPage
Signals that an new page has to be started.- Returns:
true
if the page was added,false
if 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
Clears text wrapping around images (if applicable). Method suggested by Pelikan Stephan- Throws:
DocumentException
-
close
void close()Signals that theDocument
was closed and that no otherElements
will be added.The outputstream of every writer implementing
DocListener
will be closed.
-