From: William Victor Mote Date: Mon, 7 Jul 2003 04:04:55 +0000 (+0000) Subject: Add some basic documentation for RTFLib (aka jfor). X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1322 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fb113ce8fac1f1cbf1ecd1d93549241f241ee87f;p=xmlgraphics-fop.git Add some basic documentation for RTFLib (aka jfor). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196631 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/documentation/content/xdocs/dev/book.xml b/src/documentation/content/xdocs/dev/book.xml index fc6f8eb2a..19a0f1e16 100644 --- a/src/documentation/content/xdocs/dev/book.xml +++ b/src/documentation/content/xdocs/dev/book.xml @@ -36,4 +36,7 @@ + + + diff --git a/src/documentation/content/xdocs/dev/rtflib.xml b/src/documentation/content/xdocs/dev/rtflib.xml new file mode 100644 index 000000000..4a97208e3 --- /dev/null +++ b/src/documentation/content/xdocs/dev/rtflib.xml @@ -0,0 +1,89 @@ + + + +
+ FOP Development: RTFLib (jfor) +
+ +
+ General Information +
+ Introduction +

The RTFLib package is an open-source, independent package suitable for writing RTF files in a java environment. +By independent we mean:

+
    +
  • Although it is used by FOP to generate FOP's RTF output, it is not dependent on FOP for any of its functionality.
  • +
  • It does not require FOP as a front-end, nor does it even require XSL-FO for input. +It can be used anywhere RTF output is required and java is available.
  • +
+

The FOP development team intends to keep the RTFLib package independent so that it can be used for other purposes.

+
+
+ History +

RTFLib was originally developed by Bertrand Delacrétaz and the jfor team. jfor was written under an Apache-style license, and the jfor team contributed the code to the Apache Software Foundation in June, 2003. RTFLib is a subset of the original jfor project, which also includes an XSL-FO parsing mechanism for a complete XSL-FO to RTF solution.

+
+
+ Status +

Although FOP's implementation of the RTFLib package is very incomplete, the RTFLib package itself is relatively mature. RTFLib is only available in the trunk line of FOP development.

+ This documentation is a work in progress. If you see errors or omissions, please report them to the fop-dev mailing list. +
+
+
+ User Documentation +
+ Overview +

Perhaps the easiest way to see how to use RTFLib is by looking at an example. A set of test documents is part of the package, and can be viewed online. +A quick look at the Abstract TestDocument class, and one of the Concrete subclasses, SimpleDocument will provide the basics of how to use the package.

+

There are two basic concepts you will need to understand to use RTFLib:

+
    +
  • Documents are created by filling bigger containers with successively smaller containers, and eventually with content.
  • +
  • Attributes may be set for each container or content as it is created
  • +
+

RTFLib handles the process of converting to and writing the RTF content as the document is created. All you need to do is flush the document at the end to make sure that the last pieces get written.

+
+
+ Document Structure + This section is very incomplete. +

The following table summarizes the various containers that can be created:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameClass.Method where createdAttribute Set(s)Valid children
Document AreaRtfFile.startDocumentArea().Section
SectionRtfDocumentArea.newSection().Paragraph
ParagraphRtfSection.newParagraph().Text
TextRtfParagraph.newText().N/A
+
+
+ Attributes + This section is very incomplete. +

Attributes can be set for each container and piece of content in the document. The general approach is to build an RtfAttributes object containing the various attributes, then pass that RtfAttributes object to the method that creates the new container or content. The following information lists the various attributes that can be set for each type of container.

+
+
+ +