Author: ltheussl
Date: Sat May 23 13:57:55 2009
New Revision: 777929
URL: http://svn.apache.org/viewvc?rev=777929&view=rev
Log:
Update limitations, add an example of embedded use.
Modified:
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/site/xdoc/index.xml
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/site/xdoc/usage.xml
Modified:
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/site/xdoc/index.xml
URL:
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/site/xdoc/index.xml?rev=777929&r1=777928&r2=777929&view=diff
==============================================================================
---
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/site/xdoc/index.xml
(original)
+++
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/site/xdoc/index.xml
Sat May 23 13:57:55 2009
@@ -33,20 +33,20 @@
</p>
<p>
Currently only a sink is available, ie you can generate FO files
- from other formats supported by Doxia, but you cannot parse them.
+ either programmatically or by converting from any other
+ <a href="http://maven.apache.org/doxia/references/index.html">input
format</a>
+ supported by Doxia, but you cannot parse them.
</p>
<p>
The generated FO files can then be converted into other formats,
eg pdf, using <a href="http://xmlgraphics.apache.org/fop/">Apache
Fop</a>.
+ Check out the <a href="usage.html"></a> examples.
</p>
<subsection name="Current limitations">
<ul>
- <li>Not configurable</li>
<li>Table captions not implemented</li>
- <li>Table header cells not implemented</li>
- <li>Table width is fixed</li>
- <li>Only supported graphics format is png.</li>
+ <li>Table width is fixed and column widths are uniformly
distributed</li>
</ul>
</subsection>
Modified:
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/site/xdoc/usage.xml
URL:
http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/site/xdoc/usage.xml?rev=777929&r1=777928&r2=777929&view=diff
==============================================================================
---
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/site/xdoc/usage.xml
(original)
+++
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/site/xdoc/usage.xml
Sat May 23 13:57:55 2009
@@ -28,6 +28,12 @@
<body>
<section name="Usage">
+ <macro name="toc">
+ <param name="section" value="1"/>
+ <param name="fromDepth" value="1"/>
+ <param name="toDepth" value="1"/>
+ </macro>
+
<subsection name="Converting single documents">
<p>
@@ -92,7 +98,7 @@
If you want to parse several source documents into a single fo file,
so you can generate a single pdf from multiple source files, you should
use the FoAggregateSink. A simple example is outlined below,
- refer to the API docs for more information.
+ refer to the <a href="apidocs/index.html">API docs</a> for more
information.
</p>
<source>
@@ -128,6 +134,67 @@
</subsection>
+ <subsection name="Embedded use">
+
+ <p>
+ To compile and run the following example,
+ you need the following jars on your classpath:
+ <code>doxia-core-1.1.1</code>, <code>doxia-module-fo-1.1.1</code>,
+ <code>doxia-sink-api-1.1.1</code>,
<code>doxia-logging-api-1.1.1</code>,
+ <code>commons-configuration-1.4</code>, <code>commons-lang-2.4</code>,
+ <code>plexus-utils-1.5.8</code>, <code>commons-collections-3.2</code>,
+ <code>commons-logging-1.1.1</code>.
+ </p>
+
+ <source>import java.io.File;
+import java.io.IOException;
+
+import org.apache.maven.doxia.module.fo.FoSinkFactory;
+import org.apache.maven.doxia.sink.Sink;
+
+public class TestPDF
+{
+ public static void main( String[] args )
+ {
+ Sink sink = null;
+
+ try
+ {
+ sink = new FoSinkFactory().createSink( new File( "." ), "test.fo"
);
+ populateSink( sink );
+ }
+ catch ( IOException ex )
+ {
+ ex.printStackTrace();
+ }
+ finally
+ {
+ sink.close();
+ }
+ }
+
+ private static void populateSink( Sink sink )
+ {
+ sink.head();
+ sink.title();
+ sink.text( "Title" );
+ sink.title_();
+ sink.author();
+ sink.text( "Author" );
+ sink.author_();
+ sink.date();
+ sink.text( "Date" );
+ sink.date_();
+ sink.head_();
+ sink.body();
+ sink.paragraph();
+ sink.text( "Hello world!" );
+ sink.paragraph_();
+ sink.body_();
+ }
+}</source>
+ </subsection>
+
</section>