You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xmlgraphics.apache.org by bu...@apache.org on 2012/12/11 14:32:27 UTC

svn commit: r841686 [3/3] - in /websites/staging/xmlgraphics/trunk/content: ./ fop/ fop/1.0/ fop/1.1/ fop/trunk/

Modified: websites/staging/xmlgraphics/trunk/content/fop/download.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/download.html (original)
+++ websites/staging/xmlgraphics/trunk/content/fop/download.html Tue Dec 11 13:32:25 2012
@@ -378,11 +378,11 @@ $(document).ready(function () {
 <p><strong>Web view:</strong> <a href="http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-1_0/">http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-1_0/</a></p>
 <h3 id="trunk">Trunk</h3>
 <h4 id="repository-url">Repository URL</h4>
-<p><em>Main Repository:</em> <a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/">http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/</a>
-<em>European Mirror:</em> <a href="http://svn.eu.apache.org/repos/asf/xmlgraphics/fop/trunk/">http://svn.eu.apache.org/repos/asf/xmlgraphics/fop/trunk/</a></p>
+<p><em>Main Repository:</em> <a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/">http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/</a></p>
+<p><em>European Mirror:</em> <a href="http://svn.eu.apache.org/repos/asf/xmlgraphics/fop/trunk/">http://svn.eu.apache.org/repos/asf/xmlgraphics/fop/trunk/</a></p>
 <h4 id="web-view">Web View</h4>
 <p><em>Main Repository:</em> <a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/">http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/</a></p>
-<p>European Mirror: <a href="http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/">http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/</a></p>
+<p><em>European Mirror:</em> <a href="http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/">http://svn.eu.apache.org/viewvc/xmlgraphics/fop/trunk/</a></p>
 <p>With any source distribution, you will need to build FOP from the source files. For details please see the "Build" page on the documentation tab for the version you've downloaded.</p>
 <h2 id="archives">Archive Download</h2>
 <p>FOP Archive distributions are linked from the upper portion of the Apache FOP Download Mirror Page and can be downloaded from the FOP Archives <a href="http://archive.apache.org/dist/xmlgraphics/fop/binaries/">binaries</a> &amp; <a href="http://archive.apache.org/dist/xmlgraphics/fop/source/">source</a> links.</p></div>

Modified: websites/staging/xmlgraphics/trunk/content/fop/trunk/embedding.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/trunk/embedding.html (original)
+++ websites/staging/xmlgraphics/trunk/content/fop/trunk/embedding.html Tue Dec 11 13:32:25 2012
@@ -341,7 +341,7 @@ $(document).ready(function () {
         <div id="items">
         </div>
       	<!-- <div id="breadcrumb"><a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/fop/">Fop</a>&nbsp;&raquo&nbsp;<a href="/fop/trunk/">Trunk</a></div> -->
-      	<div class="section-content"><h1 id="apachewzxhzdk23-fop-embedding">Apache&trade; FOP: Embedding</h1>
+      	<div class="section-content"><h1 id="apachewzxhzdk30-fop-embedding">Apache&trade; FOP: Embedding</h1>
 <p><subtitle>How to Embed FOP in a Java application</subtitle></p>
 <h2 id="overview">Overview</h2>
 <p>Review <a href="running.html">Running Apache&trade; FOP</a> for important information that applies to embedded applications as well as command-line use, such as options and performance.</p>
@@ -462,22 +462,46 @@ $(document).ready(function () {
 <p>However, you may not always have your input document available as a SAX stream. But with JAXP it's easy to convert different input sources to a SAX stream so you can pipe it into FOP. That sounds more difficult than it is. You simply have to set up the right Source instance as input for the JAXP transformation. A few examples:</p>
 <ul>
 <li>
-<p><strong>URL:</strong>  <code>Source src = new StreamSource("http://localhost:8080/testfile.xml");</code></p>
+<p><strong>URL:</strong></p>
+<div class="codehilite"><pre><span class="n">Source</span> <span class="n">src</span> <span class="o">=</span> <span class="k">new</span> <span class="n">StreamSource</span><span class="o">(</span><span class="s">&quot;http://localhost:8080/testfile.xml&quot;</span><span class="o">);</span>
+</pre></div>
+
+
 </li>
 <li>
-<p><strong>File:</strong>  <code>Source src = new StreamSource(new File("C:/Temp/myinputfile.xml"));</code></p>
+<p><strong>File:</strong></p>
+<div class="codehilite"><pre><span class="n">Source</span> <span class="n">src</span> <span class="o">=</span> <span class="k">new</span> <span class="n">StreamSource</span><span class="o">(</span><span class="k">new</span> <span class="n">File</span><span class="o">(</span><span class="s">&quot;C:/Temp/myinputfile.xml&quot;</span><span class="o">));</span>
+</pre></div>
+
+
 </li>
 <li>
-<p><strong>String:</strong>  <code>Source src = new StreamSource(new StringReader(myString)); // myString is a String</code></p>
+<p><strong>String:</strong></p>
+<div class="codehilite"><pre><span class="n">Source</span> <span class="n">src</span> <span class="o">=</span> <span class="k">new</span> <span class="n">StreamSource</span><span class="o">(</span><span class="k">new</span> <span class="n">StringReader</span><span class="o">(</span><span class="n">myString</span><span class="o">));</span> <span class="c1">// myString is a String</span>
+</pre></div>
+
+
 </li>
 <li>
-<p><strong>InputStream:</strong>  <code>Source src = new StreamSource(new MyInputStream(something));</code></p>
+<p><strong>InputStream:</strong></p>
+<div class="codehilite"><pre><span class="n">Source</span> <span class="n">src</span> <span class="o">=</span> <span class="k">new</span> <span class="n">StreamSource</span><span class="o">(</span><span class="k">new</span> <span class="n">MyInputStream</span><span class="o">(</span><span class="n">something</span><span class="o">));</span>
+</pre></div>
+
+
 </li>
 <li>
-<p><strong>Byte Array:</strong>  <code>Source src = new StreamSource(new ByteArrayInputStream(myBuffer)); // myBuffer is a byte[] here</code></p>
+<p><strong>Byte Array:</strong></p>
+<div class="codehilite"><pre><span class="n">Source</span> <span class="n">src</span> <span class="o">=</span> <span class="k">new</span> <span class="n">StreamSource</span><span class="o">(</span><span class="k">new</span> <span class="n">ByteArrayInputStream</span><span class="o">(</span><span class="n">myBuffer</span><span class="o">));</span> <span class="c1">// myBuffer is a byte[] here</span>
+</pre></div>
+
+
 </li>
 <li>
-<p><strong>DOM:</strong>  <code>Source src = new DOMSource(myDocument); // myDocument is a Document or a Node</code></p>
+<p><strong>DOM:</strong></p>
+<div class="codehilite"><pre><span class="n">Source</span> <span class="n">src</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DOMSource</span><span class="o">(</span><span class="n">myDocument</span><span class="o">);</span> <span class="c1">// myDocument is a Document or a Node</span>
+</pre></div>
+
+
 </li>
 <li>
 <p><strong>Java Objects:</strong> Please have a look at the <a href="#examples">Embedding examples</a> which contain an example for this.</p>
@@ -489,48 +513,57 @@ $(document).ready(function () {
 <h3 id="fop-factory">Customizing the FopFactory</h3>
 <p>The FopFactory holds configuration data and references to objects which are reusable over multiple rendering runs. It's important to instantiate it only once (except in special environments) and reuse it every time to create new FOUserAgent and Fop instances.</p>
 <p>You can set all sorts of things on the FopFactory:</p>
-<p>-
-The <strong>font base URL</strong> to use when resolving relative URLs for fonts. Example:</p>
-<div class="codehilite"><pre><span class="sb">`fopFactory.getFontManager().setFontBaseURL(&quot;file:///C:/Temp/fonts&quot;);`</span>
+<ul>
+<li>
+<p>The <strong>font base URL</strong> to use when resolving relative URLs for fonts. Example:</p>
+<div class="codehilite"><pre><span class="n">fopFactory</span><span class="o">.</span><span class="na">getFontManager</span><span class="o">().</span><span class="na">setFontBaseURL</span><span class="o">(</span><span class="s">&quot;file:///C:/Temp/fonts&quot;</span><span class="o">);</span>
 </pre></div>
 
 
-<p>-
-The <strong>hyphenation base URL</strong> to use when resolving relative URLs for hyphenation patterns. Example:</p>
-<div class="codehilite"><pre><span class="sb">`fopFactory.setHyphenBaseURL(&quot;file:///C:/Temp/hyph&quot;);`</span>
+</li>
+<li>
+<p>The <strong>hyphenation base URL</strong> to use when resolving relative URLs for hyphenation patterns. Example:</p>
+<div class="codehilite"><pre><span class="n">fopFactory</span><span class="o">.</span><span class="na">setHyphenBaseURL</span><span class="o">(</span><span class="s">&quot;file:///C:/Temp/hyph&quot;</span><span class="o">);</span>
 </pre></div>
 
 
-<p>-
-Disable <strong>strict validation</strong>. When disabled FOP is less strict about the rules established by the XSL-FO specification. Example:</p>
-<div class="codehilite"><pre><span class="sb">`fopFactory.setStrictValidation(false);`</span>
+</li>
+<li>
+<p>Disable <strong>strict validation</strong>. When disabled FOP is less strict about the rules established by the XSL-FO specification. Example:</p>
+<div class="codehilite"><pre><span class="n">fopFactory</span><span class="o">.</span><span class="na">setStrictValidation</span><span class="o">(</span><span class="kc">false</span><span class="o">);</span>
 </pre></div>
 
 
-<p>-
-Enable an <strong>alternative set of rules for text indents</strong> that tries to mimic the behaviour of many commercial FO implementations, that chose to break the specification in this respect. The default of this option is 'false', which causes Apache FOP to behave exactly as described in the specification. To enable the alternative behaviour, call:</p>
-<div class="codehilite"><pre><span class="sb">`fopFactory.setBreakIndentInheritanceOnReferenceAreaBoundary(true);`</span>
+</li>
+<li>
+<p>Enable an <strong>alternative set of rules for text indents</strong> that tries to mimic the behaviour of many commercial FO implementations, that chose to break the specification in this respect. The default of this option is 'false', which causes Apache FOP to behave exactly as described in the specification. To enable the alternative behaviour, call:</p>
+<div class="codehilite"><pre><span class="n">fopFactory</span><span class="o">.</span><span class="na">setBreakIndentInheritanceOnReferenceAreaBoundary</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
 </pre></div>
 
 
-<p>-
-Set the <strong>source resolution</strong> for the document. This is used internally to determine the pixel size for SVG images and bitmap images without resolution information. Default: 72 dpi. Example:</p>
-<div class="codehilite"><pre><span class="sb">`fopFactory.setSourceResolution(96); // =96dpi (dots/pixels per Inch)`</span>
+</li>
+<li>
+<p>Set the <strong>source resolution</strong> for the document. This is used internally to determine the pixel size for SVG images and bitmap images without resolution information. Default: 72 dpi. Example:</p>
+<div class="codehilite"><pre><span class="n">fopFactory</span><span class="o">.</span><span class="na">setSourceResolution</span><span class="o">(</span><span class="mi">96</span><span class="o">);</span> <span class="c1">// =96dpi (dots/pixels per Inch)</span>
 </pre></div>
 
 
-<p>-
-Manually add an <strong>ElementMapping instance</strong>. If you want to supply a special FOP extension you can give the instance to the FOUserAgent. Normally, the FOP extensions can be automatically detected (see the documentation on extension for more info). Example:</p>
-<div class="codehilite"><pre><span class="sb">`fopFactory.addElementMapping(myElementMapping); // myElementMapping is a org.apache.fop.fo.ElementMapping`</span>
+</li>
+<li>
+<p>Manually add an <strong>ElementMapping instance</strong>. If you want to supply a special FOP extension you can give the instance to the FOUserAgent. Normally, the FOP extensions can be automatically detected (see the documentation on extension for more info). Example:</p>
+<div class="codehilite"><pre><span class="n">fopFactory</span><span class="o">.</span><span class="na">addElementMapping</span><span class="o">(</span><span class="n">myElementMapping</span><span class="o">);</span> <span class="c1">// myElementMapping is a org.apache.fop.fo.ElementMapping</span>
 </pre></div>
 
 
-<p>-
-Set a <strong>URIResolver</strong> for custom URI resolution. By supplying a JAXP URIResolver you can add custom URI resolution functionality to FOP. For example, you can use <a href="http://xml.apache.org/commons/components/resolver/">Apache XML Commons Resolver</a> to make use of XCatalogs. Example:</p>
-<div class="codehilite"><pre><span class="sb">`fopFactory.setURIResolver(myResolver); // myResolver is a javax.xml.transform.URIResolver`</span>
+</li>
+<li>
+<p>Set a <strong>URIResolver</strong> for custom URI resolution. By supplying a JAXP URIResolver you can add custom URI resolution functionality to FOP. For example, you can use <a href="http://xml.apache.org/commons/components/resolver/">Apache XML Commons Resolver</a> to make use of XCatalogs. Example:</p>
+<div class="codehilite"><pre><span class="n">fopFactory</span><span class="o">.</span><span class="na">setURIResolver</span><span class="o">(</span><span class="n">myResolver</span><span class="o">);</span> <span class="c1">// myResolver is a javax.xml.transform.URIResolver</span>
 </pre></div>
 
 
+</li>
+</ul>
 <p>Both the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FopFactory is primarily used to resolve URIs on factory-level (hyphenation patterns, for example) and it is always used if no other URIResolver (for example on the FOUserAgent) resolved the URI first.</p>
 <h3 id="user-agent">Customizing the User Agent</h3>
 <p>The user agent is the entity that allows you to interact with a single rendering run, i.e. the processing of a single document. If you wish to customize the user agent's behaviour, the first step is to create your own instance of FOUserAgent using the appropriate factory method on FopFactory and pass that to the factory method that will create a new Fop instance:</p>
@@ -543,72 +576,85 @@ Set a <strong>URIResolver</strong> for c
 
 
 <p>You can do all sorts of things on the user agent:</p>
-<p>-
-The <strong>base URL</strong> to use when resolving relative URLs. Example:</p>
-<div class="codehilite"><pre><span class="sb">`userAgent.setBaseURL(&quot;file:///C:/Temp/&quot;);`</span>
+<ul>
+<li>
+<p>The <strong>base URL</strong> to use when resolving relative URLs. Example:</p>
+<div class="codehilite"><pre><span class="n">userAgent</span><span class="o">.</span><span class="na">setBaseURL</span><span class="o">(</span><span class="s">&quot;file:///C:/Temp/&quot;</span><span class="o">);</span>
 </pre></div>
 
 
-<p>-
-Set the <strong>producer</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. The default producer is "Apache FOP". Example:</p>
-<div class="codehilite"><pre><span class="sb">`userAgent.setProducer(&quot;MyKillerApplication&quot;);`</span>
+</li>
+<li>
+<p>Set the <strong>producer</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. The default producer is "Apache FOP". Example:</p>
+<div class="codehilite"><pre><span class="n">userAgent</span><span class="o">.</span><span class="na">setProducer</span><span class="o">(</span><span class="s">&quot;MyKillerApplication&quot;</span><span class="o">);</span>
 </pre></div>
 
 
-<p>-
-Set the <strong>creating user</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:</p>
-<div class="codehilite"><pre><span class="sb">`userAgent.setCreator(&quot;John Doe&quot;);`</span>
+</li>
+<li>
+<p>Set the <strong>creating user</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:</p>
+<div class="codehilite"><pre><span class="n">userAgent</span><span class="o">.</span><span class="na">setCreator</span><span class="o">(</span><span class="s">&quot;John Doe&quot;</span><span class="o">);</span>
 </pre></div>
 
 
-<p>-
-Set the <strong>author</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:</p>
-<div class="codehilite"><pre><span class="sb">`userAgent.setAuthor(&quot;John Doe&quot;);`</span>
+</li>
+<li>
+<p>Set the <strong>author</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:</p>
+<div class="codehilite"><pre><span class="n">userAgent</span><span class="o">.</span><span class="na">setAuthor</span><span class="o">(</span><span class="s">&quot;John Doe&quot;</span><span class="o">);</span>
 </pre></div>
 
 
-<p>-
-Override the <strong>creation date and time</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:</p>
-<div class="codehilite"><pre><span class="sb">`userAgent.setCreationDate(new Date());`</span>
+</li>
+<li>
+<p>Override the <strong>creation date and time</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:</p>
+<div class="codehilite"><pre><span class="n">userAgent</span><span class="o">.</span><span class="na">setCreationDate</span><span class="o">(</span><span class="k">new</span> <span class="n">Date</span><span class="o">());</span>
 </pre></div>
 
 
-<p>-
-Set the <strong>title</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:</p>
-<div class="codehilite"><pre><span class="sb">`userAgent.setTitle(&quot;Invoice No 138716847&quot;);`</span>
+</li>
+<li>
+<p>Set the <strong>title</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:</p>
+<div class="codehilite"><pre><span class="n">userAgent</span><span class="o">.</span><span class="na">setTitle</span><span class="o">(</span><span class="s">&quot;Invoice No 138716847&quot;</span><span class="o">);</span>
 </pre></div>
 
 
-<p>-
-Set the <strong>keywords</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:</p>
-<div class="codehilite"><pre><span class="sb">`userAgent.setKeywords(&quot;XML XSL-FO&quot;);`</span>
+</li>
+<li>
+<p>Set the <strong>keywords</strong> of the document. This is metadata information that can be used for certain output formats such as PDF. Example:</p>
+<div class="codehilite"><pre><span class="n">userAgent</span><span class="o">.</span><span class="na">setKeywords</span><span class="o">(</span><span class="s">&quot;XML XSL-FO&quot;</span><span class="o">);</span>
 </pre></div>
 
 
-<p>-
-Set the <strong>target resolution</strong> for the document. This is used to specify the output resolution for bitmap images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter effects and such. Default: 72 dpi. Example:</p>
-<div class="codehilite"><pre><span class="sb">`userAgent.setTargetResolution(300); // =300dpi (dots/pixels per Inch)`</span>
+</li>
+<li>
+<p>Set the <strong>target resolution</strong> for the document. This is used to specify the output resolution for bitmap images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter effects and such. Default: 72 dpi. Example:</p>
+<div class="codehilite"><pre><span class="n">userAgent</span><span class="o">.</span><span class="na">setTargetResolution</span><span class="o">(</span><span class="mi">300</span><span class="o">);</span> <span class="c1">// =300dpi (dots/pixels per Inch)</span>
 </pre></div>
 
 
-<p>-
-Set <strong>your own Document Handler</strong>. This feature can be used for several purposes, the most likey usage of which would probably be binding a MIME type when the output is Intermediate Format (see <a href="#documenthandlers">Document Handlers</a>). This also allows advanced users to create their own implementation of the document handler.</p>
-<div class="codehilite"><pre><span class="sb">`userAgent.setDocumentHandlerOverride(documentHandler) // documentHandler is an instance of org.apache.fop.render.intermediate.IFDocumentHandler`</span>
+</li>
+<li>
+<p>Set <strong>your own Document Handler</strong>. This feature can be used for several purposes, the most likey usage of which would probably be binding a MIME type when the output is Intermediate Format (see <a href="#documenthandlers">Document Handlers</a>). This also allows advanced users to create their own implementation of the document handler.</p>
+<div class="codehilite"><pre><span class="n">userAgent</span><span class="o">.</span><span class="na">setDocumentHandlerOverride</span><span class="o">(</span><span class="n">documentHandler</span><span class="o">)</span> <span class="c1">// documentHandler is an instance of org.apache.fop.render.intermediate.IFDocumentHandler</span>
 </pre></div>
 
 
-<p>-
-Set <strong>your own FOEventHandler instance</strong>. If you want to supply your own FOEventHandler or configure an FOEventHandler subclass in a special way you can give the instance to the FOUserAgent. Normally, the FOEventHandler instance is created by FOP. Example:</p>
-<div class="codehilite"><pre><span class="sb">`userAgent.setFOEventHandlerOverride(myFOEventHandler); // myFOEventHandler is an org.apache.fop.fo.FOEventHandler`</span>
+</li>
+<li>
+<p>Set <strong>your own FOEventHandler instance</strong>. If you want to supply your own FOEventHandler or configure an FOEventHandler subclass in a special way you can give the instance to the FOUserAgent. Normally, the FOEventHandler instance is created by FOP. Example:</p>
+<div class="codehilite"><pre><span class="n">userAgent</span><span class="o">.</span><span class="na">setFOEventHandlerOverride</span><span class="o">(</span><span class="n">myFOEventHandler</span><span class="o">);</span> <span class="c1">// myFOEventHandler is an org.apache.fop.fo.FOEventHandler</span>
 </pre></div>
 
 
-<p>-
-Set a <strong>URIResolver</strong> for custom URI resolution. By supplying a JAXP URIResolver you can add custom URI resolution functionality to FOP. For example, you can use <a href="http://xml.apache.org/commons/components/resolver/">Apache XML Commons Resolver</a> to make use of XCatalogs. Example:</p>
-<div class="codehilite"><pre><span class="sb">`userAgent.setURIResolver(myResolver); // myResolver is a javax.xml.transform.URIResolver`</span>
+</li>
+<li>
+<p>Set a <strong>URIResolver</strong> for custom URI resolution. By supplying a JAXP URIResolver you can add custom URI resolution functionality to FOP. For example, you can use <a href="http://xml.apache.org/commons/components/resolver/">Apache XML Commons Resolver</a> to make use of XCatalogs. Example:</p>
+<div class="codehilite"><pre><span class="n">userAgent</span><span class="o">.</span><span class="na">setURIResolver</span><span class="o">(</span><span class="n">myResolver</span><span class="o">);</span> <span class="c1">// myResolver is a javax.xml.transform.URIResolver</span>
 </pre></div>
 
 
+</li>
+</ul>
 <p>Both the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FOUserAgent is used for resolving URIs which are document-related. If it's not set or cannot resolve a URI, the URIResolver from the FopFactory is used. You should not reuse an FOUserAgent instance between FOP rendering runs although you can. Especially in multi-threaded environment, this is a bad idea.</p>
 <h2 id="config-external">Using a Configuration File</h2>
 <p>Instead of setting the parameters manually in code as shown above you can also set many values from an XML configuration file:</p>
@@ -657,7 +703,11 @@ Set a <strong>URIResolver</strong> for c
 <p>Whenever possible, try to use SAX to couple the individual components involved (parser, XSL transformer, SQL datasource etc.).</p>
 </li>
 <li>
-<p>Depending on the target OutputStream (in case of a FileOutputStream, but not for a ByteArrayOutputStream, for example) it may improve performance considerably if you buffer the OutputStream using a BufferedOutputStream: <code>out = new java.io.BufferedOutputStream(out);</code></p>
+<p>Depending on the target OutputStream (in case of a FileOutputStream, but not for a ByteArrayOutputStream, for example) it may improve performance considerably if you buffer the OutputStream using a BufferedOutputStream:</p>
+<div class="codehilite"><pre><span class="n">out</span> <span class="o">=</span> <span class="k">new</span> <span class="n">java</span><span class="o">.</span><span class="na">io</span><span class="o">.</span><span class="na">BufferedOutputStream</span><span class="o">(</span><span class="n">out</span><span class="o">);</span>
+</pre></div>
+
+
 <p>Make sure you properly close the OutputStream when FOP is finished.</p>
 </li>
 <li>

Modified: websites/staging/xmlgraphics/trunk/content/fop/trunk/output.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/trunk/output.html (original)
+++ websites/staging/xmlgraphics/trunk/content/fop/trunk/output.html Tue Dec 11 13:32:25 2012
@@ -341,7 +341,7 @@ $(document).ready(function () {
         <div id="items">
         </div>
       	<!-- <div id="breadcrumb"><a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/fop/">Fop</a>&nbsp;&raquo&nbsp;<a href="/fop/trunk/">Trunk</a></div> -->
-      	<div class="section-content"><h1 id="apachewzxhzdk41-fop-output-formats">Apache&trade; FOP Output Formats</h1>
+      	<div class="section-content"><h1 id="apachewzxhzdk42-fop-output-formats">Apache&trade; FOP Output Formats</h1>
 <p><authors><person email="keiron@aftexsw.com" name="Keiron Liddle"></person><person email="" name="Art Welch"></person></authors></p>
 <p>Apache&trade; FOP supports multiple output formats by using a different renderer for each format. The renderers do not all have the same set of capabilities, sometimes because of the output format itself, sometimes because some renderers get more development attention than others.</p>
 <h2 id="general">General Information</h2>
@@ -351,11 +351,17 @@ $(document).ready(function () {
 <p>With a work-around, it is possible to match the PDF/PS output in a Java2D-based renderer pretty closely. The clue is to use the <a href="intermediate.html">intermediate format</a>. The trick is to layout the document using FOP's own font subsystem but then render the document using Java2D. Here are the necessary steps (using the command-line):</p>
 <ol>
 <li>
-<p>Produce an IF file: <code>fop -fo myfile.fo -at application/pdf myfile.at.xml</code></p>
-<p>Specifying "application/pdf" for the "-at" parameter causes FOP to use FOP's own font subsystem (which is used by the PDF renderer). Note that no PDF file is created in this step.</p>
+<p>Produce an IF file:</p>
+<ul>
+<li><code>fop -fo myfile.fo -at application/pdf myfile.at.xml</code></li>
+</ul>
+<p>Specifying "application/pdf" for the "<code>-at</code>" parameter causes FOP to use FOP's own font subsystem (which is used by the PDF renderer). Note that no PDF file is created in this step.</p>
 </li>
 <li>
-<p>Render to a PDF file: <code>fop -atin myfile.at.xml -pdf myfile.pdf</code></p>
+<p>Render to a PDF file:</p>
+<ul>
+<li><code>fop -atin myfile.at.xml -pdf myfile.pdf</code></li>
+</ul>
 </li>
 <li>
 <p>Render to a Java2D-based renderer:</p>
@@ -374,17 +380,21 @@ $(document).ready(function () {
 </ol>
 <h3 id="general-direct-output">Output to a Printer or Other Device</h3>
 <p>The most obvious way to print your document is to use the FOP <a href="#print">print renderer</a>, which uses the Java2D API (AWT). However, you can also send output from the Postscript renderer directly to a Postscript device, or output from the PCL renderer directly to a PCL device.</p>
-<p>Here are Windows command-line examples for Postscript and PCL:
-fop ... -ps \computername\printerfop ... -pcl \computername\printer
-Here is some Java code to accomplish the task in UNIX:
-proc = Runtime.getRuntime().exec("lp -d" + print_queue + " -o -dp -");
-out = proc.getOutputStream();
-Set the output MIME type to "application/x-pcl" (MimeConstants.MIME_PCL) and it happily sends the PCL to the UNIX printer queue.</p>
+<p>Here are Windows command-line examples for Postscript and PCL:</p>
+<p><code>fop ... -ps \\computername\printerfop ... -pcl \\computername\printer</code></p>
+<p>Here is some Java code to accomplish the task in UNIX:</p>
+<div class="codehilite"><pre><span class="n">proc</span> <span class="o">=</span> <span class="n">Runtime</span><span class="o">.</span><span class="na">getRuntime</span><span class="o">().</span><span class="na">exec</span><span class="o">(</span><span class="s">&quot;lp -d&quot;</span> <span class="o">+</span> <span class="n">print_queue</span> <span class="o">+</span> <span class="s">&quot; -o -dp -&quot;</span><span class="o">);</span>
+<span class="n">out</span> <span class="o">=</span> <span class="n">proc</span><span class="o">.</span><span class="na">getOutputStream</span><span class="o">();</span>
+</pre></div>
+
+
+<p>Set the output MIME type to "application/x-pcl" (MimeConstants.MIME_PCL) and it happily sends the PCL to the UNIX printer queue.</p>
 <h2 id="pdf">PDF</h2>
 <p>PDF is the best supported output format. It is also the most accurate with text and layout. This creates a PDF document that is streamed out as each page is rendered. This means that the internal page index information is stored near the end of the document. The PDF version supported is 1.4. PDF versions are forwards/backwards compatible.</p>
 <p>Note that FOP does not currently support PDF/A-1a. Support for <a href="accessibility.html">Tagged PDF</a>, <a href="pdfa.html">PDF/A-1b</a> and <a href="pdfx.html">PDF/X</a> has recently been added, however.</p>
 <h3 id="pdf-fonts">Fonts</h3>
-<p>PDF has a set of fonts that are always available to all PDF viewers; to quote from the PDF Specification: <em>"PDF prescribes a set of 14 standard fonts that can be used without prior definition. These include four faces each of three Latin text typefaces (Courier, Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf Dingbats). These fonts, or suitable substitute fonts with the same metrics, are guaranteed to be available in all PDF viewer applications."</em></p>
+<p>PDF has a set of fonts that are always available to all PDF viewers; to quote from the PDF Specification:</p>
+<p><em>"PDF prescribes a set of 14 standard fonts that can be used without prior definition. These include four faces each of three Latin text typefaces (Courier, Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf Dingbats). These fonts, or suitable substitute fonts with the same metrics, are guaranteed to be available in all PDF viewer applications."</em></p>
 <h3 id="pdf-postprocess">Post-processing</h3>
 <p>FOP does not currently support several desirable PDF features: watermarks and signatures. One workaround is to use Adobe Acrobat (the full version, not the Reader) to process the file manually or with scripting that it supports.</p>
 <p>Another popular post-processing tool is <a href="http://www.lowagie.com/iText">iText</a>, which has tools for adding security features, document properties, watermarks, and many other features to PDF files.

Modified: websites/staging/xmlgraphics/trunk/content/fop/trunk/pdfencryption.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/trunk/pdfencryption.html (original)
+++ websites/staging/xmlgraphics/trunk/content/fop/trunk/pdfencryption.html Tue Dec 11 13:32:25 2012
@@ -581,10 +581,10 @@ then you don't have the needed infrastru
 </li>
 <li>
 <p>Open the <code>java.security</code> file and add</p>
-</li>
-</ol>
 <p><code>security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider</code>,</p>
 <p>preferably at the end of the block defining the other crypto providers. For JDK 1.4 this is detailed on <a href="http://java.sun.com/j2se/1.4/docs/guide/security/jce/JCERefGuide.html#InstallProvider">Sun's web site</a>.</p>
+</li>
+</ol>
 <p>If you have any experience with Mozilla JSS or any other cryptography provider, please post it to the fop-user list.</p></div>
       </div>
       

Modified: websites/staging/xmlgraphics/trunk/content/fop/trunk/servlets.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/trunk/servlets.html (original)
+++ websites/staging/xmlgraphics/trunk/content/fop/trunk/servlets.html Tue Dec 11 13:32:25 2012
@@ -341,7 +341,7 @@ $(document).ready(function () {
         <div id="items">
         </div>
       	<!-- <div id="breadcrumb"><a href="/">Home</a>&nbsp;&raquo&nbsp;<a href="/fop/">Fop</a>&nbsp;&raquo&nbsp;<a href="/fop/trunk/">Trunk</a></div> -->
-      	<div class="section-content"><h1 id="apachewzxhzdk4-fop-servlets">Apache&trade; FOP: Servlets</h1>
+      	<div class="section-content"><h1 id="apachewzxhzdk5-fop-servlets">Apache&trade; FOP: Servlets</h1>
 <p><subtitle>How to use Apache&trade; FOP in a Servlet</subtitle></p>
 <h2 id="overview">Overview</h2>
 <p>This page discusses topic all around using Apache&trade; FOP in a servlet environment.</p>
@@ -494,7 +494,10 @@ The <code>Source</code> instance used ab
 </li>
 <li>
 <p>Give IEx the opportunity to cache. In particular, ensure the server does not set any headers causing IEx not to cache the content. This may be a real problem if the document is sent over HTTPS, because most IEx installations will by default <em>not</em> cache any content retrieved over HTTPS. Setting the <code>Expires</code> header entry may help in this case:</p>
-<p><code>response.setDateHeader("Expires", System.currentTimeMillis() + cacheExpiringDuration * 1000);</code></p>
+<div class="codehilite"><pre><span class="err">`</span><span class="n">response</span><span class="o">.</span><span class="na">setDateHeader</span><span class="o">(</span><span class="s">&quot;Expires&quot;</span><span class="o">,</span> <span class="n">System</span><span class="o">.</span><span class="na">currentTimeMillis</span><span class="o">()</span> <span class="o">+</span> <span class="n">cacheExpiringDuration</span> <span class="o">*</span> <span class="mi">1000</span><span class="o">);</span><span class="err">`</span>
+</pre></div>
+
+
 <p>Consult your server manual and the relevant RFCs for further details on HTTP headers and caching.</p>
 </li>
 <li>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: commits-help@xmlgraphics.apache.org