public interface DocListener extends ElementListener
DocListener will perform some
actions when some actions are performed on a Document.ElementListener,
Document,
DocWriter| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Watermark watermark)
Signals that a
Watermark was added to the Document. |
void |
clearTextWrap()
Clears text wrapping around images (if applicable).
|
void |
close()
Signals that the
Document was closed and that no other
Elements will be added. |
boolean |
newPage()
Signals that an new page has to be started.
|
void |
open()
Signals that the
Document has been opened and that
Elements can be added. |
void |
removeWatermark()
Signals that a
Watermark was removed from the Document. |
void |
resetFooter()
Resets the footer of this document.
|
void |
resetHeader()
Resets the header of this document.
|
void |
resetPageCount()
Sets the page number to 0.
|
void |
setFooter(HeaderFooter footer)
Changes the footer of this document.
|
void |
setHeader(HeaderFooter header)
Changes the header of this document.
|
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.
|
addvoid open()
Document has been opened and that
Elements can be added.boolean setPageSize(Rectangle pageSize)
pageSize - the new pagesizebooleanboolean add(Watermark watermark)
Watermark was added to the Document.watermark - the Watermark objecttrue if the element was added, false if not.void removeWatermark()
Watermark was removed from the Document.boolean setMargins(float marginLeft,
float marginRight,
float marginTop,
float marginBottom)
marginLeft - the margin on the leftmarginRight - the margin on the rightmarginTop - the margin on the topmarginBottom - the margin on the bottombooleanboolean setMarginMirroring(boolean marginMirroring)
marginMirroring - boolean newPage()
throws DocumentException
true if the page was added, false if not.DocumentException - when a document isn't open yet, or has been closedvoid setHeader(HeaderFooter header)
header - the new headervoid resetHeader()
void setFooter(HeaderFooter footer)
footer - the new footervoid resetFooter()
void resetPageCount()
void setPageCount(int pageN)
pageN - the new page numbervoid clearTextWrap()
throws DocumentException
DocumentExceptionvoid close()
Document was closed and that no other
Elements will be added.
The outputstream of every writer implementing DocListener will be closed.