public class RtfWriter2 extends DocWriter implements DocListener
Modifier and Type | Field and Description |
---|---|
(package private) RtfDocument |
rtfDoc
The RtfDocument this RtfWriter is creating
|
Modifier | Constructor and Description |
---|---|
protected |
RtfWriter2(Document doc,
java.io.OutputStream os)
Constructs a new RtfWriter that listens to the specified Document and
writes its output to the OutputStream.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Element element)
Adds an Element to the Document
|
boolean |
add(Watermark wm)
This method is not supported in the RtfWriter
|
void |
clearTextWrap()
This method is not supported in the RtfWriter
|
void |
close()
Closes the RtfDocument.
|
RtfDocumentSettings |
getDocumentSettings()
Gets the RtfDocumentSettings that specify how the rtf document is generated.
|
static RtfWriter2 |
getInstance(Document doc,
java.io.OutputStream os)
Static method to generate RtfWriters
|
boolean |
newPage()
Adds a page break
|
void |
open()
Opens the RtfDocument
|
void |
removeWatermark()
This method is not supported in the RtfWriter
|
void |
resetFooter()
Resets the footer
|
void |
resetHeader()
Resets the header
|
void |
resetPageCount()
This method is not supported in the RtfWriter
|
void |
setAutogenerateTOCEntries(boolean autogenerate)
Whether to automagically generate table of contents entries when
adding Chapters or Sections.
|
void |
setDataCacheStyle(int dataCacheStyle)
Sets the rtf data cache style to use.
|
void |
setFooter(HeaderFooter hf)
Sets the footer to use
|
void |
setHeader(HeaderFooter hf)
Sets the header to use
|
boolean |
setMargins(float left,
float right,
float top,
float bottom)
Sets the page margins
|
void |
setPageCount(int i)
This method is not supported in the RtfWriter
|
boolean |
setPageSize(Rectangle rect)
Sets the size of the page
|
addTabs, flush, getISOBytes, hasMarkupAttributes, isCloseStream, pause, resume, setCloseStream, setMarginMirroring, write, write, writeEnd, writeEnd, writeMarkupAttributes, writeStart
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setMarginMirroring
RtfDocument rtfDoc
protected RtfWriter2(Document doc, java.io.OutputStream os)
doc
- The Document that this RtfWriter listens toos
- The OutputStream to write topublic static RtfWriter2 getInstance(Document doc, java.io.OutputStream os)
doc
- The Document that this RtfWriter listens toos
- The OutputStream to write topublic void setHeader(HeaderFooter hf)
setHeader
in interface DocListener
setHeader
in class DocWriter
hf
- The HeaderFooter to usepublic void resetHeader()
resetHeader
in interface DocListener
resetHeader
in class DocWriter
public void setFooter(HeaderFooter hf)
setFooter
in interface DocListener
setFooter
in class DocWriter
hf
- The HeaderFooter to usepublic void resetFooter()
resetFooter
in interface DocListener
resetFooter
in class DocWriter
public void setPageCount(int i)
setPageCount
in interface DocListener
setPageCount
in class DocWriter
i
- Unusedpublic void resetPageCount()
resetPageCount
in interface DocListener
resetPageCount
in class DocWriter
public boolean add(Watermark wm)
add
in interface DocListener
add
in class DocWriter
wm
- Unusedfalse
public void removeWatermark()
removeWatermark
in interface DocListener
removeWatermark
in class DocWriter
public void clearTextWrap()
clearTextWrap
in interface DocListener
clearTextWrap
in class DocWriter
DocListener.clearTextWrap()
public void open()
open
in interface DocListener
open
in class DocWriter
public void close()
close
in interface DocListener
close
in class DocWriter
public boolean add(Element element) throws DocumentException
add
in interface ElementListener
add
in class DocWriter
element
- The element to be addedfalse
DocumentException
public boolean newPage()
newPage
in interface DocListener
newPage
in class DocWriter
false
public boolean setMargins(float left, float right, float top, float bottom)
setMargins
in interface DocListener
setMargins
in class DocWriter
left
- The left marginright
- The right margintop
- The top marginbottom
- The bottom marginfalse
public boolean setPageSize(Rectangle rect)
setPageSize
in interface DocListener
setPageSize
in class DocWriter
rect
- A Rectangle representing the pagefalse
public void setAutogenerateTOCEntries(boolean autogenerate)
autogenerate
- Whether to automatically generate TOC entriespublic void setDataCacheStyle(int dataCacheStyle) throws DocumentException, java.io.IOException
dataCacheStyle
- The style to use.DocumentException
- If data has already been written into the data cache.java.io.IOException
- If the disk cache could not be initialised.public RtfDocumentSettings getDocumentSettings()