Package com.itextpdf.text
Interface DocListener
-
- All Superinterfaces:
ElementListener
,java.util.EventListener
- All Known Implementing Classes:
Document
,DocWriter
,FdfWriter.Wrt
,HTMLWorker
,PdfACopy
,PdfASmartCopy
,PdfAStamperImp
,PdfAWriter
,PdfCopy
,PdfCopyFieldsImp
,PdfCopyFormsImp
,PdfDocument
,PdfSmartCopy
,PdfStamperImp
,PdfWriter
public interface DocListener extends ElementListener
A class that implementsDocListener
will 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 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
resetPageCount()
Sets the page number to 0.boolean
setMarginMirroring(boolean marginMirroring)
Parameter that allows you to do left/right margin mirroring (odd/even pages)boolean
setMarginMirroringTopBottom(boolean marginMirroringTopBottom)
Parameter that allows you to do top/bottom 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.itextpdf.text.ElementListener
add
-
-
-
-
Method Detail
-
open
void open()
Signals that theDocument
has been opened and thatElements
can be added.
-
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.
-
newPage
boolean newPage()
Signals that an new page has to be started.- Returns:
true
if the page was added,false
if not.
-
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 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.
-
-