Package org.apache.fop.render.rtf
Class RTFHandler
java.lang.Object
org.apache.fop.fo.FOEventHandler
org.apache.fop.render.rtf.RTFHandler
RTF Handler: generates RTF output using the structure events from
the FO Tree sent to this structure handler.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate BuilderContextprivate RtfDocumentAreaprivate static final org.apache.xmlgraphics.image.loader.ImageFlavor[]private static org.apache.commons.logging.Logprivate intprivate final OutputStreamprivate SimplePageMasterprivate PercentContextprivate RtfFileprivate RtfSectionFields inherited from class org.apache.fop.fo.FOEventHandler
fontInfo, foUserAgent -
Constructor Summary
ConstructorsConstructorDescriptionRTFHandler(FOUserAgent userAgent, OutputStream os) Creates a new RTF structure handler. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidvoidvoidendColumn(TableColumn tc) booleanendContainer(Class containerClass) Closes any mismatched tags that are detected in the RTF structure.voidThis method is called to indicate the end of a document run.voidvoidendFooter(TableFooter footer) voidendFootnote(Footnote footnote) Process the ending of a footnote.voidendFootnoteBody(FootnoteBody body) Process the ending of a footnote body.voidendHeader(TableHeader header) voidvoidProcess the end of an InstreamForeignObject.voidProcess end of a Link.voidvoidendListBody(ListItemBody listItemBody) Process end of a ListBody.voidendListItem(ListItem li) voidendListLabel(ListItemLabel listItemLabel) Process end of a ListLabel.voidProcess end of a Markup.voidendPageNumber(PageNumber pagenum) voidendPageSequence(PageSequence pageSeq) private voidvoidvoidendStatic(StaticContent statisContent) Process end of a Static.voidprotected voidCentral exception handler for I/O exceptions.voidimage(ExternalGraphic eg) Process an ExternalGraphic.private voidinvokeDeferredEvent(FONode foNode, boolean bStart) Calls the appropriate event handler for the passed FObj.voidpageRef()Process a pageRef.private voidprepareTable(Table tab) private voidputGraphic(AbstractGraphics abstractGraphic, org.apache.xmlgraphics.image.loader.Image image) Puts a graphic/image into the generated RTF file.private voidputGraphic(AbstractGraphics abstractGraphic, org.apache.xmlgraphics.image.loader.ImageInfo info) Puts a graphic/image into the generated RTF file.private voidrecurseFONode(FONode foNode) Calls the event handlers for the passed FONode and all its elements.voidstartBlock(Block bl) voidvoidvoidvoidvoidThis method is called to indicate the start of a new document run.voidThis method is called to indicate the start of a new fo:flow or fo:static-content.voidstartFooter(TableFooter footer) voidstartFootnote(Footnote footnote) Process the start of a footnote.voidProcess the start of a footnote body.voidstartHeader(TableHeader header) voidstartInline(Inline inl) voidProcess the start of a Leader.voidProcess start of a Link.voidvoidstartListBody(ListItemBody listItemBody) Process start of a ListBody.voidvoidstartListLabel(ListItemLabel listItemLabel) Process start of a ListLabel.voidProcess start of a Markup.voidstartPageNumber(PageNumber pagenum) voidvoidvoidstartPageSequence(PageSequence pageSeq) private voidvoidvoidstartStatic(StaticContent staticContent) Process start of a Static.voidstartTable(Table tbl) voidtext(FOText text, CharSequence characters) private inttoRtfBreakValue(int foBreakValue) Methods inherited from class org.apache.fop.fo.FOEventHandler
character, characters, endExternalDocument, endLeader, endPageNumberCitation, endPageNumberCitationLast, endRetrieveMarker, endRetrieveTableMarker, endRoot, endWrapper, getFontInfo, getResults, getUserAgent, restoreState, restoreState, startExternalDocument, startInstreamForeignObject, startRetrieveMarker, startRetrieveTableMarker, startRoot, startWrapper
-
Field Details
-
rtfFile
-
os
-
log
private static org.apache.commons.logging.Log log -
sect
-
docArea
-
bDefer
private boolean bDefer -
bPrevHeaderSpecified
private boolean bPrevHeaderSpecified -
bHeaderSpecified
private boolean bHeaderSpecified -
builderContext
-
pagemaster
-
nestedTableDepth
private int nestedTableDepth -
percentManager
-
FLAVORS
private static final org.apache.xmlgraphics.image.loader.ImageFlavor[] FLAVORS
-
-
Constructor Details
-
RTFHandler
Creates a new RTF structure handler.- Parameters:
userAgent- the FOUserAgent for this processos- OutputStream to write to
-
-
Method Details
-
handleIOTrouble
Central exception handler for I/O exceptions.- Parameters:
ioe- IOException to handle
-
startDocument
This method is called to indicate the start of a new document run.- Overrides:
startDocumentin classFOEventHandler- Throws:
SAXException- In case of a problem
-
endDocument
This method is called to indicate the end of a document run.- Overrides:
endDocumentin classFOEventHandler- Throws:
SAXException- In case of a problem
-
startPageSequence
- Overrides:
startPageSequencein classFOEventHandler- Parameters:
pageSeq- PageSequence that is starting.
-
endPageSequence
- Overrides:
endPageSequencein classFOEventHandler- Parameters:
pageSeq- PageSequence that is ending.
-
startFlow
This method is called to indicate the start of a new fo:flow or fo:static-content. This method also handles fo:static-content tags, because the StaticContent class is derived from the Flow class.- Overrides:
startFlowin classFOEventHandler- Parameters:
fl- Flow that is starting.
-
endFlow
- Overrides:
endFlowin classFOEventHandler- Parameters:
fl- Flow that is ending.
-
startBlock
- Overrides:
startBlockin classFOEventHandler- Parameters:
bl- Block that is starting.
-
endBlock
- Overrides:
endBlockin classFOEventHandler- Parameters:
bl- Block that is ending.
-
startBlockContainer
- Overrides:
startBlockContainerin classFOEventHandler- Parameters:
blc- BlockContainer that is starting.
-
endBlockContainer
- Overrides:
endBlockContainerin classFOEventHandler- Parameters:
bl- BlockContainer that is ending.
-
toRtfBreakValue
private int toRtfBreakValue(int foBreakValue) -
startTable
- Overrides:
startTablein classFOEventHandler- Parameters:
tbl- Table that is starting.
-
endTable
- Overrides:
endTablein classFOEventHandler- Parameters:
tbl- Table that is ending.
-
startColumn
- Overrides:
startColumnin classFOEventHandler- Parameters:
tc- TableColumn that is starting;
-
endColumn
- Overrides:
endColumnin classFOEventHandler- Parameters:
tc- TableColumn that is ending;
-
startHeader
- Overrides:
startHeaderin classFOEventHandler- Parameters:
header- TableHeader that is starting;
-
endHeader
- Overrides:
endHeaderin classFOEventHandler- Parameters:
header- TableHeader that is ending.
-
startInline
- Overrides:
startInlinein classFOEventHandler- Parameters:
inl- Inline that is starting.
-
endInline
- Overrides:
endInlinein classFOEventHandler- Parameters:
inl- Inline that is ending.
-
startPart
-
endPart
-
startBody
- Overrides:
startBodyin classFOEventHandler- Parameters:
body- TableBody that is starting.
-
endBody
- Overrides:
endBodyin classFOEventHandler- Parameters:
body- TableBody that is ending.
-
startRow
- Overrides:
startRowin classFOEventHandler- Parameters:
tr- TableRow that is starting.
-
endRow
- Overrides:
endRowin classFOEventHandler- Parameters:
tr- TableRow that is ending.
-
startCell
- Overrides:
startCellin classFOEventHandler- Parameters:
tc- TableCell that is starting.
-
endCell
- Overrides:
endCellin classFOEventHandler- Parameters:
tc- TableCell that is ending.
-
startList
- Overrides:
startListin classFOEventHandler- Parameters:
lb- ListBlock that is starting.
-
endList
- Overrides:
endListin classFOEventHandler- Parameters:
lb- ListBlock that is ending.
-
startListItem
- Overrides:
startListItemin classFOEventHandler- Parameters:
li- ListItem that is starting.
-
endListItem
- Overrides:
endListItemin classFOEventHandler- Parameters:
li- ListItem that is ending.
-
startListLabel
Process start of a ListLabel.- Overrides:
startListLabelin classFOEventHandler- Parameters:
listItemLabel- ListItemLabel that is starting
-
endListLabel
Process end of a ListLabel.- Overrides:
endListLabelin classFOEventHandler- Parameters:
listItemLabel- ListItemLabel that is ending
-
startListBody
Process start of a ListBody.- Overrides:
startListBodyin classFOEventHandler- Parameters:
listItemBody- ListItemBody that is starting
-
endListBody
Process end of a ListBody.- Overrides:
endListBodyin classFOEventHandler- Parameters:
listItemBody- ListItemBody that is ending
-
startStatic
Process start of a Static.- Overrides:
startStaticin classFOEventHandler- Parameters:
staticContent- StaticContent that is starting
-
endStatic
Process end of a Static.- Overrides:
endStaticin classFOEventHandler- Parameters:
statisContent- StaticContent that is ending
-
startMarkup
public void startMarkup()Process start of a Markup.- Overrides:
startMarkupin classFOEventHandler
-
endMarkup
public void endMarkup()Process end of a Markup.- Overrides:
endMarkupin classFOEventHandler
-
startLink
Process start of a Link.- Overrides:
startLinkin classFOEventHandler- Parameters:
basicLink- BasicLink that is starting
-
endLink
Process end of a Link.- Overrides:
endLinkin classFOEventHandler- Parameters:
basicLink- BasicLink that is ending
-
image
Process an ExternalGraphic.- Overrides:
imagein classFOEventHandler- Parameters:
eg- ExternalGraphic to process.
-
endInstreamForeignObject
Process the end of an InstreamForeignObject.- Overrides:
endInstreamForeignObjectin classFOEventHandler- Parameters:
ifo- InstreamForeignObject that is ending
-
putGraphic
private void putGraphic(AbstractGraphics abstractGraphic, org.apache.xmlgraphics.image.loader.ImageInfo info) throws IOException Puts a graphic/image into the generated RTF file.- Parameters:
abstractGraphic- the graphic (external-graphic or instream-foreign-object)info- the image info object- Throws:
IOException- In case of an I/O error
-
putGraphic
private void putGraphic(AbstractGraphics abstractGraphic, org.apache.xmlgraphics.image.loader.Image image) throws IOException Puts a graphic/image into the generated RTF file.- Parameters:
abstractGraphic- the graphic (external-graphic or instream-foreign-object)image- the image- Throws:
IOException- In case of an I/O error
-
pageRef
public void pageRef()Process a pageRef.- Overrides:
pageRefin classFOEventHandler
-
startFootnote
Process the start of a footnote.- Overrides:
startFootnotein classFOEventHandler- Parameters:
footnote- Footnote that is starting
-
endFootnote
Process the ending of a footnote.- Overrides:
endFootnotein classFOEventHandler- Parameters:
footnote- Footnote that is ending
-
startFootnoteBody
Process the start of a footnote body.- Overrides:
startFootnoteBodyin classFOEventHandler- Parameters:
body- FootnoteBody that is starting
-
endFootnoteBody
Process the ending of a footnote body.- Overrides:
endFootnoteBodyin classFOEventHandler- Parameters:
body- FootnoteBody that is ending
-
startLeader
Process the start of a Leader.- Overrides:
startLeaderin classFOEventHandler- Parameters:
l- Leader that is starting
-
text
- Parameters:
text- FOText objectcharacters- CharSequence of the characters to process.
-
startPageNumber
- Overrides:
startPageNumberin classFOEventHandler- Parameters:
pagenum- PageNumber that is starting.
-
endPageNumber
- Overrides:
endPageNumberin classFOEventHandler- Parameters:
pagenum- PageNumber that is ending.
-
startPageNumberCitation
- Overrides:
startPageNumberCitationin classFOEventHandler- Parameters:
l- PageNumberCitation that is starting.
-
startPageNumberCitationLast
- Overrides:
startPageNumberCitationLastin classFOEventHandler- Parameters:
l- PageNumberCitationLast that is starting.
-
prepareTable
-
invokeDeferredEvent
Calls the appropriate event handler for the passed FObj.- Parameters:
foNode- FO node whose event is to be calledbStart- TRUE calls the start handler, FALSE the end handler
-
endContainer
Closes any mismatched tags that are detected in the RTF structure.- Parameters:
containerClass- The class representing the tag to close.- Returns:
- Determines whether the tag mismatch has been handled.
-
recurseFONode
Calls the event handlers for the passed FONode and all its elements.- Parameters:
foNode- FONode object which shall be recursed
-