com.lowagie.text

Interface DocListener

public interface DocListener extends ElementListener

A class that implements DocListener will perform some actions when some actions are performed on a Document.

See Also: ElementListener Document DocWriter

Method Summary
voidclose()
Signals that the Document was closed and that no other Elements will be added.
booleannewPage()
Signals that an new page has to be started.
voidopen()
Signals that the Document has been opened and that Elements can be added.
voidresetFooter()
Resets the footer of this document.
voidresetHeader()
Resets the header of this document.
voidresetPageCount()
Sets 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.

Method Detail

close

public void close()
Signals that the Document was closed and that no other Elements will be added.

The outputstream of every writer implementing DocListener will be closed.

newPage

public boolean newPage()
Signals that an new page has to be started.

Returns: true if the page was added, false if not.

open

public void open()
Signals that the Document has been opened and that Elements can be added.

resetFooter

public void resetFooter()
Resets the footer of this document.

resetHeader

public void resetHeader()
Resets the header of this document.

resetPageCount

public void resetPageCount()
Sets the page number to 0.

setFooter

public void setFooter(HeaderFooter footer)
Changes the footer of this document.

Parameters: footer the new footer

setHeader

public void setHeader(HeaderFooter header)
Changes the header of this document.

Parameters: header the new header

setMarginMirroring

public boolean setMarginMirroring(boolean marginMirroring)
Parameter that allows you to do left/right margin mirroring (odd/even pages)

Parameters: marginMirroring

Returns: true if successful

setMarginMirroringTopBottom

public 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

setMargins

public boolean setMargins(float marginLeft, float marginRight, float marginTop, float marginBottom)
Sets the margins.

Parameters: marginLeft the margin on the left marginRight the margin on the right marginTop the margin on the top marginBottom the margin on the bottom

Returns: a boolean

setPageCount

public void setPageCount(int pageN)
Sets the page number.

Parameters: pageN the new page number

setPageSize

public boolean setPageSize(Rectangle pageSize)
Sets the pagesize.

Parameters: pageSize the new pagesize

Returns: a boolean