public class RtfWriter2
extends com.lowagie.text.DocWriter
| Modifier | Constructor and Description |
|---|---|
protected |
RtfWriter2(com.lowagie.text.Document doc,
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(com.lowagie.text.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(com.lowagie.text.Document doc,
OutputStream os)
Static method to generate RtfWriters
|
void |
importRtfDocument(FileInputStream documentSource)
Adds the complete RTF document to the current RTF document being generated.
|
void |
importRtfDocument(InputStream documentSource,
EventListener[] events)
Adds the complete RTF document to the current RTF document being generated.
|
void |
importRtfDocumentIntoElement(com.lowagie.text.Element elem,
FileInputStream documentSource)
Adds the complete RTF document to the current RTF element being generated.
|
void |
importRtfDocumentIntoElement(com.lowagie.text.Element elem,
FileInputStream documentSource,
EventListener[] events)
Adds the complete RTF document to the current RTF element being generated.
|
void |
importRtfFragment(InputStream documentSource,
RtfImportMappings mappings)
Adds a fragment of an RTF document to the current RTF document being generated.
|
void |
importRtfFragment(InputStream documentSource,
RtfImportMappings mappings,
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(com.lowagie.text.HeaderFooter hf)
Sets the footer to use
|
void |
setHeader(com.lowagie.text.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(com.lowagie.text.Rectangle rect)
Sets the size of the page
|
protected RtfWriter2(com.lowagie.text.Document doc,
OutputStream os)
doc - The Document that this RtfWriter listens toos - The OutputStream to write topublic static RtfWriter2 getInstance(com.lowagie.text.Document doc, OutputStream os)
doc - The Document that this RtfWriter listens toos - The OutputStream to write topublic void setHeader(com.lowagie.text.HeaderFooter hf)
setHeader in interface com.lowagie.text.DocListenersetHeader in class com.lowagie.text.DocWriterhf - The HeaderFooter to usepublic void resetHeader()
resetHeader in interface com.lowagie.text.DocListenerresetHeader in class com.lowagie.text.DocWriterpublic void setFooter(com.lowagie.text.HeaderFooter hf)
setFooter in interface com.lowagie.text.DocListenersetFooter in class com.lowagie.text.DocWriterhf - The HeaderFooter to usepublic void resetFooter()
resetFooter in interface com.lowagie.text.DocListenerresetFooter in class com.lowagie.text.DocWriterpublic void setPageCount(int i)
setPageCount in interface com.lowagie.text.DocListenersetPageCount in class com.lowagie.text.DocWriteri - Unusedpublic void resetPageCount()
resetPageCount in interface com.lowagie.text.DocListenerresetPageCount in class com.lowagie.text.DocWriterpublic void clearTextWrap()
public void open()
open in interface com.lowagie.text.DocListeneropen in class com.lowagie.text.DocWriterpublic void close()
close in interface com.lowagie.text.DocListenerclose in class com.lowagie.text.DocWriterpublic boolean add(com.lowagie.text.Element element)
throws com.lowagie.text.DocumentException
add in interface com.lowagie.text.ElementListeneradd in class com.lowagie.text.DocWriterelement - The element to be addedfalsecom.lowagie.text.DocumentExceptionpublic boolean newPage()
newPage in interface com.lowagie.text.DocListenernewPage in class com.lowagie.text.DocWriterfalsepublic boolean setMargins(float left,
float right,
float top,
float bottom)
setMargins in interface com.lowagie.text.DocListenersetMargins in class com.lowagie.text.DocWriterleft - The left marginright - The right margintop - The top marginbottom - The bottom marginfalsepublic boolean setPageSize(com.lowagie.text.Rectangle rect)
setPageSize in interface com.lowagie.text.DocListenersetPageSize in class com.lowagie.text.DocWriterrect - A Rectangle representing the pagefalsepublic void setAutogenerateTOCEntries(boolean autogenerate)
autogenerate - Whether to automatically generate TOC entriespublic RtfDocumentSettings getDocumentSettings()
public void importRtfDocument(FileInputStream documentSource) throws IOException, com.lowagie.text.DocumentException
documentSource - The Reader to read the RTF document from.IOException - On errors reading the RTF document.com.lowagie.text.DocumentException - On errors adding to this RTF document.public void importRtfDocument(InputStream documentSource, EventListener[] events) throws IOException, com.lowagie.text.DocumentException
documentSource - The InputStream to read the RTF document from.events - The array of event listeners. May be nullIOExceptioncom.lowagie.text.DocumentExceptionRtfParser,
RtfParser.importRtfDocument(InputStream, RtfDocument)public void importRtfFragment(InputStream documentSource, RtfImportMappings mappings) throws IOException, com.lowagie.text.DocumentException
documentSource - The InputStream to read the RTF fragment from.mappings - The RtfImportMappings that contain font and color mappings to apply to the fragment.IOException - On errors reading the RTF fragment.com.lowagie.text.DocumentException - On errors adding to this RTF fragment.public void importRtfFragment(InputStream documentSource, RtfImportMappings mappings, EventListener[] events) throws IOException, com.lowagie.text.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 nullIOException - On errors reading the RTF fragment.com.lowagie.text.DocumentException - On errors adding to this RTF fragment.RtfImportMappings,
RtfParser,
RtfParser.importRtfFragment(InputStream, RtfDocument, RtfImportMappings)public void importRtfDocumentIntoElement(com.lowagie.text.Element elem,
FileInputStream documentSource)
throws IOException,
com.lowagie.text.DocumentException
elem - The Element the RTF document is to be imported into.documentSource - The Reader to read the RTF document from.IOException - On errors reading the RTF document.com.lowagie.text.DocumentException - On errors adding to this RTF document.public void importRtfDocumentIntoElement(com.lowagie.text.Element elem,
FileInputStream documentSource,
EventListener[] events)
throws IOException,
com.lowagie.text.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.IOException - On errors reading the RTF document.com.lowagie.text.DocumentException - On errors adding to this RTF document.Copyright © 2017. All rights reserved.