Author: ltheussl Date: Wed Sep 19 08:03:36 2007 New Revision: 577327 URL: http://svn.apache.org/viewvc?rev=577327&view=rev Log: Update docs
Modified: maven/sandbox/trunk/doxia/doxia-module-fo/src/site/xdoc/index.xml maven/sandbox/trunk/doxia/doxia-module-fo/src/site/xdoc/usage.xml Modified: maven/sandbox/trunk/doxia/doxia-module-fo/src/site/xdoc/index.xml URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-module-fo/src/site/xdoc/index.xml?rev=577327&r1=577326&r2=577327&view=diff ============================================================================== --- maven/sandbox/trunk/doxia/doxia-module-fo/src/site/xdoc/index.xml (original) +++ maven/sandbox/trunk/doxia/doxia-module-fo/src/site/xdoc/index.xml Wed Sep 19 08:03:36 2007 @@ -43,7 +43,6 @@ <subsection name="Current limitations"> <ul> <li>Not configurable</li> - <li>No page headers, page numbering</li> <li>Table captions not implemented</li> <li>Table header cells not implemented</li> <li>Table width is fixed</li> Modified: maven/sandbox/trunk/doxia/doxia-module-fo/src/site/xdoc/usage.xml URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/doxia/doxia-module-fo/src/site/xdoc/usage.xml?rev=577327&r1=577326&r2=577327&view=diff ============================================================================== --- maven/sandbox/trunk/doxia/doxia-module-fo/src/site/xdoc/usage.xml (original) +++ maven/sandbox/trunk/doxia/doxia-module-fo/src/site/xdoc/usage.xml Wed Sep 19 08:03:36 2007 @@ -28,8 +28,10 @@ <body> <section name="Usage"> + <subsection name="Converting single documents"> + <p> - Here's an example that converts an apt input file into a fo document. + Here's an example that converts a single apt input file into a fo document. To produce a pdf from the result using Apache FOP, see eg <a href="http://xmlgraphics.apache.org/fop/0.93/embedding.html#ExampleFO2PDF">ExampleFO2PDF</a>. </p> @@ -53,10 +55,12 @@ try { // Open input apt document: - FileReader source = new FileReader( new File( "resources", "test.apt" ) ); + FileReader source = new FileReader( + new File( "resources", "test.apt" ) ); // Create FO sink: - FoSink fosink = new FoSink( new FileWriter( new File( "output", "test.fo" ) ) ); + FoSink fosink = new FoSink( new FileWriter( + new File( "output", "test.fo" ) ) ); AptParser parser = new AptParser(); parser.parse( source, fosink ); @@ -80,6 +84,51 @@ } } </source> + + </subsection> + + <subsection name="Converting multiple documents"> + + <p> + 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. + </p> + + <source> + AptParser parser = new AptParser(); + + FoAggregateSink fosink = new FoAggregateSink( + new FileWriter( new File( "out", "aggregate.fo" ) ) ); + + fosink.beginDocument(); + + // getMeta() should return a DocumentMeta object + fosink.coverPage( getMeta() ); + + // getToc() should return a DocumentTOC object + fosink.toc( getToc() ); + + // first document + FileReader source1 = + new FileReader( new File( "resources", "test1.apt" ) ); + fosink.setDocumentName( "doc1" ); + fosink.setDocumentTitle( "Document 1" ); + parser.parse( source1, fosink ); + + // second document + FileReader source2 = + new FileReader( new File( "resources", "test2.apt" ) ); + fosink.setDocumentName( "doc2" ); + fosink.setDocumentTitle( "Document 2" ); + parser.parse( source2, fosink ); + + fosink.endDocument(); + </source> + + </subsection> + </section>