|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.lowagie.text.DocWriter com.lowagie.text.rtf.RtfWriter2
public class RtfWriter2
The RtfWriter allows the creation of rtf documents via the iText system Version: $Id: RtfWriter2.java 3583 2008-08-12 00:00:09Z xlv $
Field Summary |
---|
Fields inherited from class com.lowagie.text.DocWriter |
---|
closeStream, document, EQUALS, FORWARD, GT, LT, NEWLINE, open, os, pageSize, pause, QUOTE, SPACE, TAB |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
boolean |
add(Element element)
Adds an Element to the Document |
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 |
void |
importRtfDocument(java.io.FileInputStream documentSource)
Adds the complete RTF document to the current RTF document being generated. |
void |
importRtfDocument(java.io.InputStream documentSource,
java.util.EventListener[] events)
Adds the complete RTF document to the current RTF document being generated. |
void |
importRtfDocumentIntoElement(Element elem,
java.io.FileInputStream documentSource)
Adds the complete RTF document to the current RTF element being generated. |
void |
importRtfDocumentIntoElement(Element elem,
java.io.FileInputStream documentSource,
java.util.EventListener[] events)
Adds the complete RTF document to the current RTF element being generated. |
void |
importRtfFragment(java.io.InputStream documentSource,
RtfImportMappings mappings)
Adds a fragment of an RTF document to the current RTF document being generated. |
void |
importRtfFragment(java.io.InputStream documentSource,
RtfImportMappings mappings,
java.util.EventListener[] events)
Adds a fragment of an RTF document to the current RTF document being generated. |
boolean |
newPage()
Adds a page break |
void |
open()
Opens the RtfDocument |
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 |
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 |
Methods inherited from class com.lowagie.text.DocWriter |
---|
addTabs, flush, getISOBytes, isCloseStream, isPaused, pause, resume, setCloseStream, setMarginMirroring, setMarginMirroringTopBottom, write, write, writeEnd, writeEnd, writeMarkupAttributes, writeStart |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected RtfWriter2(Document doc, java.io.OutputStream os)
doc
- The Document that this RtfWriter listens toos
- The OutputStream to write toMethod Detail |
---|
public static RtfWriter2 getInstance(Document doc, java.io.OutputStream os)
doc
- The Document that this RtfWriter listens toos
- The OutputStream to write to
public 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 void 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 added
false
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 margin
false
public boolean setPageSize(Rectangle rect)
setPageSize
in interface DocListener
setPageSize
in class DocWriter
rect
- A Rectangle representing the page
false
public void setAutogenerateTOCEntries(boolean autogenerate)
autogenerate
- Whether to automatically generate TOC entriespublic RtfDocumentSettings getDocumentSettings()
public void importRtfDocument(java.io.FileInputStream documentSource) throws java.io.IOException, DocumentException
documentSource
- The Reader to read the RTF document from.
java.io.IOException
- On errors reading the RTF document.
DocumentException
- On errors adding to this RTF document.public void importRtfDocument(java.io.InputStream documentSource, java.util.EventListener[] events) throws java.io.IOException, DocumentException
documentSource
- The InputStream to read the RTF document from.events
- The array of event listeners. May be null
java.io.IOException
DocumentException
RtfParser
,
RtfParser.importRtfDocument(InputStream, RtfDocument)
public void importRtfFragment(java.io.InputStream documentSource, RtfImportMappings mappings) throws java.io.IOException, DocumentException
documentSource
- The InputStream to read the RTF fragment from.mappings
- The RtfImportMappings that contain font and color mappings to apply to the fragment.
java.io.IOException
- On errors reading the RTF fragment.
DocumentException
- On errors adding to this RTF fragment.public void importRtfFragment(java.io.InputStream documentSource, RtfImportMappings mappings, java.util.EventListener[] events) throws java.io.IOException, DocumentException
documentSource
- The InputStream to read the RTF fragment from.mappings
- The RtfImportMappings that contain font and color mappings to apply to the fragment.events
- The array of event listeners. May be null
java.io.IOException
- On errors reading the RTF fragment.
DocumentException
- On errors adding to this RTF fragment.RtfImportMappings
,
RtfParser
,
RtfParser.importRtfFragment(InputStream, RtfDocument, RtfImportMappings)
public void importRtfDocumentIntoElement(Element elem, java.io.FileInputStream documentSource) throws java.io.IOException, DocumentException
elem
- The Element the RTF document is to be imported into.documentSource
- The Reader to read the RTF document from.
java.io.IOException
- On errors reading the RTF document.
DocumentException
- On errors adding to this RTF document.public void importRtfDocumentIntoElement(Element elem, java.io.FileInputStream documentSource, java.util.EventListener[] events) throws java.io.IOException, DocumentException
elem
- The Element the RTF document is to be imported into.documentSource
- The Reader to read the RTF document from.events
- The event array for listeners.
java.io.IOException
- On errors reading the RTF document.
DocumentException
- On errors adding to this RTF document.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |