<title>Overview</title>
<p>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 <link href="http://cvs.apache.org/viewcvs.cgi/xml-fop/src/java/org/apache/fop/rtf/rtflib/testdocs/">viewed online</link>.
A quick look at the Abstract <link href="http://cvs.apache.org/viewcvs.cgi/xml-fop/src/java/org/apache/fop/rtf/rtflib/testdocs/TestDocument.java?rev=HEAD&content-type=text/vnd.viewcvs-markup">TestDocument</link> class, and one of the Concrete subclasses, <link href="http://cvs.apache.org/viewcvs.cgi/xml-fop/src/java/org/apache/fop/rtf/rtflib/testdocs/SimpleDocument.java?rev=HEAD&content-type=text/vnd.viewcvs-markup">SimpleDocument</link> will provide the basics of how to use the package.</p>
- <p>There are two basic concepts you will need to understand to use RTFLib:</p>
+ <p>There are two basic concepts you will need to understand in order to use RTFLib:</p>
<ul>
<li>Documents are created by filling bigger containers with successively smaller containers, and eventually with content.</li>
<li>Attributes may be set for each container or content as it is created</li>
<section id="userdoc-structure">
<title>Document Structure</title>
<warning>This section is very incomplete.</warning>
+ <p>The documentation in this section is intended to provide a high-level view of the process of building an RTF document. For more detailed API documentation of the various methods, be sure to consult the Javadocs for RTFLib.</p>
<p>The following table summarizes the various containers that can be created:</p>
<table>
<tr>
<tr>
<td>Document Area</td>
<td>RtfFile.startDocumentArea()</td>
- <td>.</td>
+ <td>Information Group, Document Formatting</td>
<td>Section</td>
</tr>
<tr>
<td>Section</td>
<td>RtfDocumentArea.newSection()</td>
- <td>.</td>
- <td>Paragraph</td>
+ <td>Section Formatting</td>
+ <td>Paragraph, ParagraphKeepTogether, Image, List, Before (Page Heading), After (Page Footer), JforCmd</td>
</tr>
<tr>
<td>Paragraph</td>
<td>RtfSection.newParagraph()</td>
- <td>.</td>
+ <td>Paragraph Formatting, Character Formatting</td>
<td>Text</td>
</tr>
+ <tr>
+ <td>ParagraphKeepTogether</td>
+ <td>RtfSection.newParagraphKeepTogether</td>
+ <td>.</td>
+ <td>.</td>
+ </tr>
+ <tr>
+ <td>Image</td>
+ <td>RtfSection.newImage</td>
+ <td>.</td>
+ <td>.</td>
+ </tr>
+ <tr>
+ <td>Table</td>
+ <td>RtfSection.newTable</td>
+ <td>.</td>
+ <td>.</td>
+ </tr>
+ <tr>
+ <td>List</td>
+ <td>RtfSection.newList</td>
+ <td>.</td>
+ <td>.</td>
+ </tr>
+ <tr>
+ <td>Before (Page Heading)</td>
+ <td>RtfSection.newBefore</td>
+ <td>.</td>
+ <td>.</td>
+ </tr>
+ <tr>
+ <td>After (Page Footer)</td>
+ <td>RtfSection.newAfter</td>
+ <td>.</td>
+ <td>.</td>
+ </tr>
+ <tr>
+ <td>JforCmd</td>
+ <td>RtfSection.newJforCmd</td>
+ <td>.</td>
+ <td>.</td>
+ </tr>
<tr>
<td>Text</td>
<td>RtfParagraph.newText()</td>
- <td>.</td>
+ <td>Character Formatting</td>
<td>N/A</td>
</tr>
</table>
<section id="userdoc-attributes">
<title>Attributes</title>
<warning>This section is very incomplete.</warning>
- <p>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.</p>
+ <p>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. See the Javadoc API documentation for RtfAttributes for details on the syntax for creating an RtfAttributes object. The following information lists the various attributes that can be set for each type of container.</p>
+ <section id="userdoc-attr-ig">
+ <title>Information Group</title>
+ <p>These attributes are set when creating a Document.</p>
+ </section>
+ <section id="userdoc-attr-df">
+ <title>Document Formatting</title>
+ <p>These attributes are set when creating a Document.</p>
+ </section>
+ <section id="userdoc-attr-sf">
+ <title>Section Formatting</title>
+ <p>These attributes are set when creating a Section.</p>
+ </section>
+ <section id="userdoc-attr-pf">
+ <title>Paragraph Formatting</title>
+ <p>These attributes are set when creating a Paragraph.</p>
+ <table>
+ <tr>
+ <th>Description</th>
+ <th>Attribute Name</th>
+ <th>Attribute Value</th>
+ <th>RTF Control Word</th>
+ </tr>
+ <tr>
+ <th colspan="4">Alignment</th>
+ </tr>
+ <tr>
+ <td>Align Left</td>
+ <td>RtfText.ALIGN_LEFT</td>
+ <td>N/A (boolean)</td>
+ <td>\ql</td>
+ </tr>
+ <tr>
+ <td>Align Right</td>
+ <td>RtfText.ALIGN_RIGHT</td>
+ <td>N/A (boolean)</td>
+ <td>\qr</td>
+ </tr>
+ <tr>
+ <td>Align Centered</td>
+ <td>RtfText.ALIGN_CENTER</td>
+ <td>N/A (boolean)</td>
+ <td>\qc</td>
+ </tr>
+ <tr>
+ <td>Align Justified</td>
+ <td>RtfText.ALIGN_JUSTIFIED</td>
+ <td>N/A (boolean)</td>
+ <td>\qj</td>
+ </tr>
+ <tr>
+ <td>Align Distributed</td>
+ <td>RtfText.ALIGN_DISTRIBUTED</td>
+ <td>N/A (boolean)</td>
+ <td>\qd</td>
+ </tr>
+ <tr>
+ <td>Kashida justification</td>
+ <td>not implemented</td>
+ <td>0-20 (integer)</td>
+ <td>\qkN</td>
+ </tr>
+ <tr>
+ <td>Thai Distributed justification</td>
+ <td>not implemented</td>
+ <td>N/A (boolean)</td>
+ <td>\qt</td>
+ </tr>
+ </table>
+ </section>
+ <section id="userdoc-attr-cf">
+ <title>Character Formatting</title>
+ <p>These attributes are set when creating a Paragraph, or Text.</p>
+ </section>
</section>
</section>
</body>