Class RtfFile
java.lang.Object
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
org.apache.fop.render.rtf.rtflib.rtfdoc.RtfFile
Models the top-level structure of an RTF file.
This work was authored by Bertrand Delacretaz (bdelacretaz@codeconsult.ch), Andreas Putz (a.putz@skynamics.com), and Christopher Scott (scottc@westinghouse.com).
-
Field Summary
Fields inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
attrib, parent, writer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
flush()
must be called when done creating the documentCall startDocumentArea if needed and return the document area object.Get the list table.Call startPageArea if needed and return the page area object.static void
minimal test and usage exampleCloses the RtfHeader if not done yet, and starts the document area.org.apache.fop.render.rtf.rtflib.rtfdoc.RtfHeader
If called, must be called before startDocumentAreastartListTable
(RtfAttributes attr) Creates the list table.Closes the RtfHeader if not done yet, and starts the docment area.protected void
overridden to write RTF prefix code, what comes before our childrenprotected void
overridden to write RTF suffix code, what comes after our childrenMethods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfContainer
addChild, findChildren, getChildCount, getChildren, isEmpty, okToWriteRtf, setChildren, setOptions, toString, writeRtfContent
Methods inherited from class org.apache.fop.render.rtf.rtflib.rtfdoc.RtfElement
close, getParentOfClass, getRtfAttributes, newLine, writeAttributes, writeControlWord, writeControlWordNS, writeExceptionInRtf, writeGroupMark, writeOneAttribute, writeOneAttributeNS, writeRtf, writeStarControlWord, writeStarControlWordNS
-
Constructor Details
-
RtfFile
Create an RTF file that outputs to the given Writer- Parameters:
w
- the Writer to write to- Throws:
IOException
- for I/O problems
-
-
Method Details
-
startHeader
public org.apache.fop.render.rtf.rtflib.rtfdoc.RtfHeader startHeader() throws IOException, RtfStructureExceptionIf called, must be called before startDocumentArea- Returns:
- the new RtfHeader
- Throws:
IOException
- for I/O problemsRtfStructureException
- for illegal RTF structure
-
startListTable
Creates the list table.- Parameters:
attr
- attributes for the RtfListTable- Returns:
- the new RtfListTable
- Throws:
IOException
- for I/O problems
-
getListTable
Get the list table.- Returns:
- the RtfListTable
-
startPageArea
Closes the RtfHeader if not done yet, and starts the docment area. Like startDocumentArea, is only called once. This is not optimal, must be able to have multiple page definition, and corresponding Document areas- Returns:
- the RtfPageArea
- Throws:
IOException
- for I/O problemsRtfStructureException
- for illegal RTF structure
-
getPageArea
Call startPageArea if needed and return the page area object.- Returns:
- the RtfPageArea
- Throws:
IOException
- for I/O problemsRtfStructureException
- for illegal RTF structure
-
startDocumentArea
Closes the RtfHeader if not done yet, and starts the document area. Must be called once only.- Returns:
- the RtfDocumentArea
- Throws:
IOException
- for I/O problemsRtfStructureException
- for illegal RTF structure
-
getDocumentArea
Call startDocumentArea if needed and return the document area object.- Returns:
- the RtfDocumentArea
- Throws:
IOException
- for I/O problemsRtfStructureException
- for illegal RTF structure
-
writeRtfPrefix
overridden to write RTF prefix code, what comes before our children- Overrides:
writeRtfPrefix
in classRtfElement
- Throws:
IOException
- for I/O problems
-
writeRtfSuffix
overridden to write RTF suffix code, what comes after our children- Overrides:
writeRtfSuffix
in classRtfElement
- Throws:
IOException
- for I/O problems
-
flush
must be called when done creating the document- Throws:
IOException
- for I/O problems
-
main
minimal test and usage example- Parameters:
args
- command-line arguments- Throws:
Exception
- for problems
-