xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r1008691 [5/16] - in /websites/staging/xmlgraphics/trunk/content: ./ fop/2.2/ fop/2.2/images/
Date Mon, 20 Mar 2017 14:58:10 GMT
Added: websites/staging/xmlgraphics/trunk/content/fop/2.2/embedding.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/2.2/embedding.html (added)
+++ websites/staging/xmlgraphics/trunk/content/fop/2.2/embedding.html Mon Mar 20 14:58:09 2017
@@ -0,0 +1,880 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <title>Apache(tm) FOP: Embedding</title>
+
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+    <meta property="og:image" content="http://www.apache.org/images/asf_logo.gif" />
+<!--
+    <link rel="stylesheet" type="text/css" media="screen" href="http://www.apache.org/css/style.css">
+-->
+    <link rel="stylesheet" type="text/css" media="screen" href="//www.apache.org/css/code.css">
+    <link href="/css/profile.css" rel="stylesheet" type="text/css" />
+    <link href="/css/xmlgraphics.css" rel="stylesheet" type="text/css" />
+    <link href="/css/print.css" rel="stylesheet" type="text/css" media="print" />
+
+    <script src="//code.jquery.com/jquery.min.js"></script>
+	<script type="text/javascript" src="/js/jquery.stoc.js"></script>
+    <script>
+    $(document).ready(function(){
+        $('ul#navigation a').each(function() {
+		    if (this.href === window.location.href)
+			    { $(this). attr('id', 'forefront');} 
+        });
+        $('ul#navigation a#forefront').each(function() {
+        	
+        });
+    })
+	$(function(){
+		$("#items").stoc({ search: "#content", stocTitle: "<h3>Page Contents</h3>" });
+	});
+    </script>
+
+    
+
+    
+    
+	<style>
+	.highlight {color: red;}
+	</style>
+
+  </head>
+
+  <body>
+
+	<div id="banner">&nbsp;
+	</div>
+
+	<div id="navigation">
+	<style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<p><a href="/"><img alt="Apache XML Graphics Project Logo" src="/images/apache-xml-graphics.gif" title="Apache XML Graphics Project" /></a></p>
+<h1 id="apache-fop">Apache&trade; FOP<a class="headerlink" href="#apache-fop" title="Permanent link">&para;</a></h1>
+<ul>
+<li><a href="/fop/">FOP Home</a></li>
+<li><a href="/fop/download.html">Download</a></li>
+<li><a href="/fop/quickstartguide.html">Quick Start Guide</a></li>
+<li><a href="/fop/compliance.html">Compliance</a></li>
+<li><a href="/fop/gethelp.html">Getting Help</a></li>
+<li><a href="/fop/faq.html">FAQs</a></li>
+<li><a href="/fop/maillist.html">Mailing Lists</a></li>
+<li><a href="/fop/license.html">License</a></li>
+<li>
+<h2 id="resources">Resources<a class="headerlink" href="#resources" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/fo.html">XSL-FO</a></li>
+<li><a href="/fop/examples.html">Examples</a></li>
+<li><a href="/fop/bugs.html">Bugs</a></li>
+<li><a href="http://wiki.apache.org/xmlgraphics-fop/FrontPage">Wiki</a></li>
+<li><a href="/fop/resources.html">Other</a></li>
+</ul>
+</li>
+<li>
+<h2 id="project">Project<a class="headerlink" href="#project" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/news.html">News</a></li>
+<li><a href="/fop/team.html">Who We Are</a></li>
+<li><a href="/fop/status.html">Status</a></li>
+<li><a href="/fop/knownissues.html">Known Issues</a></li>
+<li><a href="/fop/changes.html">Changes</a></li>
+</ul>
+</li>
+<li>
+<h2 id="versions">Versions<a class="headerlink" href="#versions" title="Permanent link">&para;</a></h2>
+<ul>
+<li>
+<h2 id="fop-trunk-dev">FOP Trunk (dev)<a class="headerlink" href="#fop-trunk-dev" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/trunk/">Overview</a></li>
+<li><a href="/fop/trunk/upgrading.html">Upgrading</a></li>
+<li>
+<h3 id="using-apache-fop">Using Apache&trade; FOP<a class="headerlink" href="#using-apache-fop" title="Permanent link">&para;</a></h3>
+<ul>
+<li><a href="/fop/trunk/compiling.html">Build</a></li>
+<li><a href="/fop/trunk/configuration.html">Configure</a></li>
+<li><a href="/fop/trunk/running.html">Run</a></li>
+<li><a href="/fop/trunk/embedding.html">Embed</a></li>
+<li><a href="/fop/trunk/servlets.html">Servlets</a></li>
+<li><a href="/fop/trunk/anttask.html">Ant Task</a></li>
+</ul>
+</li>
+<li>
+<h3 id="features">Features<a class="headerlink" href="#features" title="Permanent link">&para;</a></h3>
+<ul>
+<li><a href="/fop/trunk/accessibility.html">Accessibility</a></li>
+<li><a href="/fop/trunk/complexscripts.html">Complex Scripts</a></li>
+<li><a href="/fop/trunk/events.html">Events</a></li>
+<li><a href="/fop/trunk/extensions.html">Extensions</a></li>
+<li><a href="/fop/trunk/fonts.html">Fonts</a></li>
+<li><a href="/fop/trunk/graphics.html">Graphics</a></li>
+<li><a href="/fop/trunk/hyphenation.html">Hyphenation</a></li>
+<li><a href="/fop/trunk/intermediate.html">Intermediate Format</a></li>
+<li><a href="/fop/trunk/metadata.html">Metadata</a></li>
+<li><a href="/fop/trunk/output.html">Output Targets</a></li>
+<li><a href="/fop/trunk/pdfa.html">PDF/A</a></li>
+<li><a href="/fop/trunk/pdfx.html">PDF/X</a></li>
+<li><a href="/fop/trunk/pdfencryption.html">PDF Encryption</a></li>
+<li><a href="/fop/fop-pdf-images.html">PDF Images</a></li>
+<li><a href="/fop/trunk/whitespacemanagement.html">Whitespace Management</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li>
+<h2 id="fop-21">FOP 2.1<a class="headerlink" href="#fop-21" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/2.1/">FOP 2.1 Overview</a></li>
+<li><a href="/fop/2.1/releaseNotes_2.1.html">Release Notes</a></li>
+<li><a href="/fop/2.1/changes_2.1.html">Changes (2.1)</a></li>
+<li><a href="/fop/2.1/knownissues_overview.html">Known Issues</a></li>
+<li><a href="/fop/2.1/upgrading.html">Upgrading</a></li>
+<li>
+<h3 id="using-apache-fop-21">Using Apache FOP 2.1<a class="headerlink" href="#using-apache-fop-21" title="Permanent link">&para;</a></h3>
+<ul>
+<li><a href="/fop/2.1/compiling.html">Build</a></li>
+<li><a href="/fop/2.1/configuration.html">Configure</a></li>
+<li><a href="/fop/2.1/running.html">Run</a></li>
+<li><a href="/fop/2.1/embedding.html">Embed</a></li>
+<li><a href="/fop/2.1/servlets.html">Servlets</a></li>
+<li><a href="/fop/2.1/anttask.html">Ant Task</a></li>
+</ul>
+</li>
+<li>
+<h3 id="features_1">Features<a class="headerlink" href="#features_1" title="Permanent link">&para;</a></h3>
+<ul>
+<li><a href="/fop/2.1/accessibility.html">Accessibility</a></li>
+<li><a href="/fop/2.1/complexscripts.html">Complex Scripts</a></li>
+<li><a href="/fop/2.1/events.html">Events</a></li>
+<li><a href="/fop/2.1/extensions.html">Extensions</a></li>
+<li><a href="/fop/2.1/fonts.html">Fonts</a></li>
+<li><a href="/fop/2.1/graphics.html">Graphics</a></li>
+<li><a href="/fop/2.1/hyphenation.html">Hyphenation</a></li>
+<li><a href="/fop/2.1/intermediate.html">Intermediate Format</a></li>
+<li><a href="/fop/2.1/metadata.html">Metadata</a></li>
+<li><a href="/fop/2.1/output.html">Output Targets</a></li>
+<li><a href="/fop/2.1/pdfa.html">PDF/A</a></li>
+<li><a href="/fop/2.1/pdfx.html">PDF/X</a></li>
+<li><a href="/fop/2.1/pdfencryption.html">PDF Encryption</a></li>
+<li><a href="/fop/fop-pdf-images.html">PDF Images</a></li>
+<li><a href="/fop/2.1/whitespacemanagement.html">Whitespace Management</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li>
+<h2 id="fop-20">FOP 2.0<a class="headerlink" href="#fop-20" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/2.0/">FOP 2.0 Overview</a></li>
+<li><a href="/fop/2.0/releaseNotes_2.0.html">Release Notes</a></li>
+<li><a href="/fop/2.0/changes_2.0.html">Changes (2.0)</a></li>
+<li><a href="/fop/2.0/knownissues_overview.html">Known Issues</a></li>
+<li><a href="/fop/2.0/upgrading.html">Upgrading</a></li>
+<li>
+<h3 id="using-apache-fop-20">Using Apache FOP 2.0<a class="headerlink" href="#using-apache-fop-20" title="Permanent link">&para;</a></h3>
+<ul>
+<li><a href="/fop/2.0/compiling.html">Build</a></li>
+<li><a href="/fop/2.0/configuration.html">Configure</a></li>
+<li><a href="/fop/2.0/running.html">Run</a></li>
+<li><a href="/fop/2.0/embedding.html">Embed</a></li>
+<li><a href="/fop/2.0/servlets.html">Servlets</a></li>
+<li><a href="/fop/2.0/anttask.html">Ant Task</a></li>
+</ul>
+</li>
+<li>
+<h3 id="features_2">Features<a class="headerlink" href="#features_2" title="Permanent link">&para;</a></h3>
+<ul>
+<li><a href="/fop/2.0/accessibility.html">Accessibility</a></li>
+<li><a href="/fop/2.0/complexscripts.html">Complex Scripts</a></li>
+<li><a href="/fop/2.0/events.html">Events</a></li>
+<li><a href="/fop/2.0/extensions.html">Extensions</a></li>
+<li><a href="/fop/2.0/fonts.html">Fonts</a></li>
+<li><a href="/fop/2.0/graphics.html">Graphics</a></li>
+<li><a href="/fop/2.0/hyphenation.html">Hyphenation</a></li>
+<li><a href="/fop/2.0/intermediate.html">Intermediate Format</a></li>
+<li><a href="/fop/2.0/metadata.html">Metadata</a></li>
+<li><a href="/fop/2.0/output.html">Output Targets</a></li>
+<li><a href="/fop/2.0/pdfa.html">PDF/A</a></li>
+<li><a href="/fop/2.0/pdfx.html">PDF/X</a></li>
+<li><a href="/fop/2.0/pdfencryption.html">PDF Encryption</a></li>
+<li><a href="/fop/fop-pdf-images.html">PDF Images</a></li>
+<li><a href="/fop/2.0/whitespacemanagement.html">Whitespace Management</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li>
+<h2 id="fop-11">FOP 1.1<a class="headerlink" href="#fop-11" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/1.1/">FOP 1.1 Overview</a></li>
+<li><a href="/fop/1.1/releaseNotes_1.1.html">Release Notes</a></li>
+<li><a href="/fop/1.1/changes_1.1.html">Changes (1.1)</a></li>
+<li><a href="/fop/1.1/knownissues_overview.html">Known Issues</a></li>
+<li><a href="/fop/1.1/upgrading.html">Upgrading</a></li>
+<li>
+<h3 id="using-apache-fop-11">Using Apache FOP 1.1<a class="headerlink" href="#using-apache-fop-11" title="Permanent link">&para;</a></h3>
+<ul>
+<li><a href="/fop/1.1/compiling.html">Build</a></li>
+<li><a href="/fop/1.1/configuration.html">Configure</a></li>
+<li><a href="/fop/1.1/running.html">Run</a></li>
+<li><a href="/fop/1.1/embedding.html">Embed</a></li>
+<li><a href="/fop/1.1/servlets.html">Servlets</a></li>
+<li><a href="/fop/1.1/anttask.html">Ant Task</a></li>
+</ul>
+</li>
+<li>
+<h3 id="features_3">Features<a class="headerlink" href="#features_3" title="Permanent link">&para;</a></h3>
+<ul>
+<li><a href="/fop/1.1/accessibility.html">Accessibility</a></li>
+<li><a href="/fop/1.1/complexscripts.html">Complex Scripts</a></li>
+<li><a href="/fop/1.1/events.html">Events</a></li>
+<li><a href="/fop/1.1/extensions.html">Extensions</a></li>
+<li><a href="/fop/1.1/fonts.html">Fonts</a></li>
+<li><a href="/fop/1.1/graphics.html">Graphics</a></li>
+<li><a href="/fop/1.1/hyphenation.html">Hyphenation</a></li>
+<li><a href="/fop/1.1/intermediate.html">Intermediate Format</a></li>
+<li><a href="/fop/1.1/metadata.html">Metadata</a></li>
+<li><a href="/fop/1.1/output.html">Output Targets</a></li>
+<li><a href="/fop/1.1/pdfa.html">PDF/A</a></li>
+<li><a href="/fop/1.1/pdfx.html">PDF/X</a></li>
+<li><a href="/fop/1.1/pdfencryption.html">PDF Encryption</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li>
+<h2 id="fop-10">FOP 1.0<a class="headerlink" href="#fop-10" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/1.0/">FOP 1.0 Overview</a></li>
+<li><a href="/fop/1.0/releaseNotes_1.0.html">Release Notes</a></li>
+<li><a href="/fop/1.0/changes_1.0.html">Changes (1.0)</a></li>
+<li><a href="/fop/1.0/knownissues_overview.html">Known Issues</a></li>
+<li><a href="/fop/1.0/upgrading.html">Upgrading</a></li>
+<li>
+<h3 id="using-apache-fop-10">Using Apache FOP 1.0<a class="headerlink" href="#using-apache-fop-10" title="Permanent link">&para;</a></h3>
+<ul>
+<li><a href="/fop/1.0/compiling.html">Build</a></li>
+<li><a href="/fop/1.0/configuration.html">Configure</a></li>
+<li><a href="/fop/1.0/running.html">Run</a></li>
+<li><a href="/fop/1.0/embedding.html">Embed</a></li>
+<li><a href="/fop/1.0/servlets.html">Servlets</a></li>
+<li><a href="/fop/1.0/anttask.html">Ant Task</a></li>
+</ul>
+</li>
+<li>
+<h3 id="features_4">Features<a class="headerlink" href="#features_4" title="Permanent link">&para;</a></h3>
+<ul>
+<li><a href="/fop/1.0/output.html">Output Targets</a></li>
+<li><a href="/fop/1.0/intermediate.html">Intermediate Format</a></li>
+<li><a href="/fop/1.0/pdfencryption.html">PDF Encryption</a></li>
+<li><a href="/fop/1.0/pdfa.html">PDF/A</a></li>
+<li><a href="/fop/1.0/pdfx.html">PDF/X</a></li>
+<li><a href="/fop/1.0/graphics.html">Graphics</a></li>
+<li><a href="/fop/1.0/fonts.html">Fonts</a></li>
+<li><a href="/fop/1.0/hyphenation.html">Hyphenation</a></li>
+<li><a href="/fop/1.0/extensions.html">Extensions</a></li>
+<li><a href="/fop/1.0/events.html">Events</a></li>
+<li><a href="/fop/1.0/metadata.html">Metadata</a></li>
+<li><a href="/fop/1.0/accessibility.html">Accessibility</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li>
+<h2 id="fop-development">FOP Development<a class="headerlink" href="#fop-development" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/dev/">General Info</a></li>
+<li>
+<h2 id="design">Design<a class="headerlink" href="#design" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/dev/design/">Design Info</a></li>
+</ul>
+</li>
+<li>
+<h2 id="core-process">Core Process<a class="headerlink" href="#core-process" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/dev/design/startup.html">Startup</a></li>
+<li><a href="/fop/dev/design/parsing.html">XML Parsing</a></li>
+<li><a href="/fop/dev/design/fotree.html">FO Tree</a></li>
+<li><a href="/fop/dev/design/properties.html">Properties</a></li>
+<li><a href="/fop/dev/design/layout.html">Layout</a></li>
+<li><a href="/fop/dev/design/breakpos.html">Break Possibility</a></li>
+<li><a href="/fop/dev/design/areas.html">Area Tree</a></li>
+<li><a href="/fop/dev/design/renderers.html">Renderers</a></li>
+</ul>
+</li>
+<li>
+<h2 id="miscellaneous">Miscellaneous<a class="headerlink" href="#miscellaneous" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/dev/design/images.html">Images</a></li>
+<li><a href="/fop/dev/design/pdf-library.html">PDF Library</a></li>
+<li><a href="/fop/dev/design/svg.html">SVG</a></li>
+<li><a href="/fop/dev/design/embedding.html">Embedding</a></li>
+<li><a href="/fop/dev/design/extending.html">Extending</a></li>
+<li><a href="/fop/dev/design/optimise.html">Optimisations</a></li>
+<li><a href="/fop/dev/design/useragent.html">User Agent</a></li>
+</ul>
+</li>
+<li><a href="http://wiki.apache.org/xmlgraphics-fop/FOPProjectPages">Unresolved (Wiki)</a></li>
+<li><a href="/fop/dev/svg.html">SVG</a></li>
+<li><a href="/fop/dev/extensions.html">Extensions</a></li>
+<li>
+<h2 id="develop">Develop<a class="headerlink" href="#develop" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/dev/implement.html">Walk-Thru</a></li>
+<li><a href="https://issues.apache.org/jira/issues/?jql=project%20%3D%20FOP%20AND%20description%20~%20%22\%22[patch]\%22%22%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29">Patch Queue</a></li>
+<li><a href="/fop/dev/conventions.html">Conventions</a></li>
+</ul>
+</li>
+<li>
+<h2 id="test">Test<a class="headerlink" href="#test" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/dev/testing.html">Testing</a></li>
+</ul>
+</li>
+<li>
+<h2 id="deploy">Deploy<a class="headerlink" href="#deploy" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/dev/doc.html">Doc Mgmt</a></li>
+<li><a href="/fop/dev/release.html">Release</a></li>
+<li><a href="https://issues.apache.org/jira/issues/?jql=project%20%3D%20FOP%20AND%20issuetype%20%3D%20Bug%20AND%20status%20in%20%28Open%2C%20%22In%20Progress%22%2C%20Reopened%29">Bugs</a></li>
+</ul>
+</li>
+<li>
+<h2 id="resources_1">Resources<a class="headerlink" href="#resources_1" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/dev/faq.html">FAQs</a></li>
+<li><a href="/fop/dev/tools.html">Tools</a></li>
+<li><a href="http://svn.apache.org/viewvc/xmlgraphics/fop">ViewVC</a></li>
+</ul>
+</li>
+<li>
+<h2 id="subpackages">SubPackages<a class="headerlink" href="#subpackages" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/fop/dev/rtflib.html">RTFlib</a></li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+</li>
+</ul>
+<h1 id="apache-xml-graphics">Apache&trade; XML Graphics<a class="headerlink" href="#apache-xml-graphics" title="Permanent link">&para;</a></h1>
+<ul>
+<li>
+<h2 id="project-overview">Project Overview<a class="headerlink" href="#project-overview" title="Permanent link">&para;</a></h2>
+<ul>
+<li><a href="/team.html">Who We Are</a></li>
+<li><a href="/legal.html">Legal Stuff</a></li>
+<li><a href="/charter.html">Project Charter</a></li>
+<li><a href="/mail.html">Mailing Lists</a></li>
+<li><a href="/repo.html">Code Repositories</a></li>
+<li><a href="http://www.apache.org/foundation/sponsorship.html">ASF Sponsorship Program</a></li>
+<li><a href="http://www.apache.org/foundation/thanks.html">ASF Thanks</a></li>
+<li><a href="http://www.apache.org/licenses/">Licenses</a></li>
+<li><a href="/security.html">Apache XML Graphics Security</a></li>
+<li><a href="http://www.apache.org/security/">ASF Security</a></li>
+</ul>
+</li>
+</ul>
+<h1 id="sub-projects">Sub Projects<a class="headerlink" href="#sub-projects" title="Permanent link">&para;</a></h1>
+<ul>
+<li><a href="/batik/">Apache Batik</a></li>
+<li><a href="/commons/">Apache XML Graphics Commons</a></li>
+</ul>
+<h3 id="search-apache-xml-graphics">Search Apache XML Graphics<a class="headerlink" href="#search-apache-xml-graphics" title="Permanent link">&para;</a></h3>
+<form name="search" id="search" action="https://www.google.com/search" method="get">
+  <input value="xmlgraphics.apache.org" name="sitesearch" type="hidden"/>
+  <input type="text" name="q" id="query" />
+  <input type="submit" id="submit" value="Search" />
+</form>
+
+<h3 id="apachecon-n-america">ApacheCon N. America<a class="headerlink" href="#apachecon-n-america" title="Permanent link">&para;</a></h3>
+<p><a href="http://na.apachecon.com/"><img alt="ApacheCon North America" src="https://farm8.staticflickr.com/7566/15408186664_d08f3881c9_t.jpg" title="ApacheCon North America" /></a></p>
+<ul>
+<li><strong><a href="http://na.apachecon.com/">ApacheCon NA</a></strong></li>
+</ul>
+<p>Hope to see you there!</p>
+<h3 id="apachecon-europe">ApacheCon Europe<a class="headerlink" href="#apachecon-europe" title="Permanent link">&para;</a></h3>
+<!--
+<a href="http://apachecon.eu/" title="ApacheCon Europe"><img alt="ApacheCon Europe" src="http://www.apache.org/ads/ApacheCon/2014-eu-234x60.png" width="225" /></a>
+-->
+
+<ul>
+<li><strong><a href="http://apachecon.eu/">ApacheCon Europe</a></strong></li>
+</ul>
+<p>Hope to see you there!</p>
+<p><a title="Apache Software Foundation Logo" href="http://www.apache.org"><img id="asf_logo_url" alt="Apache Software Foundation " src="/images/asf_logo_url.png" width="200" /></a></p>
+<script>
+$(document).ready(function () {
+    $('#navigation :header').click(function () {
+        var text = $(this).siblings('ul');
+        if (text.is(':hidden')) {
+            text.slideDown('200');
+        } else {
+            text.slideUp('200');
+        }
+    });
+    if ($('#navigation :header').siblings('ul')) {
+      $('#navigation :header').not('#search-apache-xml-graphics, #apachewzxhzdk3-xml-graphics, #sub-projects').append(' &raquo;');
+    }
+  $('#navigation > ul > li > ul > li ul').hide();
+  $('#project-overview').next().hide();
+  $('#versions').next().show();
+  var str=location.href.toLowerCase();
+  $("#navigation li a").each(function() {
+    if (str.indexOf(this.href.toLowerCase()) > -1) {
+      $(this).parents().slideDown('200');
+      $("li.highlight").removeClass("highlight");
+      $(this).parent().addClass("highlight");
+    }
+  });
+})
+</script>
+	</div>
+
+	<div id="bannertext" style="border-bottom: 2px dashed #666666; height: 70px;">
+	  <a href="/fop/"><img src="/images/apache-fop-logo.jpg" alt="The Apache FOP Project" width="120" height="65" style="float:left; margin-right: 15px;" /></a>
+	  <h2>The Apache&trade; FOP Project</h2>
+	</div><!-- <h1>Apache(tm) FOP: Embedding</h1> -->
+
+
+      
+      <div id="content" class="grid_16">
+        <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/2.2/">2.2</a></div> -->
+      	<div class="section-content"><style type="text/css">
+/* The following code is added by mdx_elementid.py
+   It was originally lifted from http://subversion.apache.org/style/site.css */
+/*
+ * Hide class="elementid-permalink", except when an enclosing heading
+ * has the :hover property.
+ */
+.headerlink, .elementid-permalink {
+  visibility: hidden;
+}
+h2:hover > .headerlink, h3:hover > .headerlink, h1:hover > .headerlink, h6:hover > .headerlink, h4:hover > .headerlink, h5:hover > .headerlink, dt:hover > .elementid-permalink { visibility: visible }</style>
+<h1 id="apache-fop-embedding">Apache&trade; FOP: Embedding<a class="headerlink" href="#apache-fop-embedding" title="Permanent link">&para;</a></h1>
+<p><subtitle>How to Embed FOP in a Java application</subtitle></p>
+<h2 id="overview">Overview<a class="headerlink" href="#overview" title="Permanent link">&para;</a></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>
+<p>To embed Apache&trade; FOP in your application, first create a new org.apache.fop.apps.FopFactory instance. This object can be used to launch multiple rendering runs. For each run, create a new org.apache.fop.apps.Fop instance through one of the factory methods of FopFactory. In the method call you specify which output format (i.e. MIME type) to use and, if the selected output format requires an OutputStream, which OutputStream to use for the results of the rendering. You can customize FOP's behaviour in a rendering run by supplying your own FOUserAgent instance. The FOUserAgent can, for example, be used to set your own document handler instance (details below). Finally, you retrieve a SAX DefaultHandler instance from the Fop object and use that as the SAXResult of your transformation.</p>
+<h2 id="API">The API<a class="headerlink" href="#API" title="Permanent link">&para;</a></h2>
+<p>FOP has many classes which express the "public" access modifier, however, this is not indicative of their inclusion into the public API. Every attempt will be made to keep the public API static, to minimize regressions for existing users, however, since the API is not clearly defined, the list of classes below are the generally agreed public API:</p>
+<ul>
+<li>org.apache.fop.apps.*</li>
+<li>org.apache.fop.fo.FOEventHandler</li>
+<li>org.apache.fop.fo.ElementMappingRegistry</li>
+<li>org.apache.fop.fonts.FontManager</li>
+<li>org.apache.fop.events.EventListener</li>
+<li>org.apache.fop.events.Event</li>
+<li>org.apache.fop.events.model.EventSeverity</li>
+<li>org.apache.fop.render.ImageHandlerRegistry</li>
+<li>org.apache.fop.render.RendererFactory</li>
+<li>org.apache.fop.render.intermediate.IFContext</li>
+<li>org.apache.fop.render.intermediate.IFDocumentHandler</li>
+<li>org.apache.fop.render.intermediate.IFException</li>
+<li>org.apache.fop.render.intermediate.IFParser</li>
+<li>org.apache.fop.render.intermediate.IFSerializer</li>
+<li>org.apache.fop.render.intermediate.IFUtil</li>
+<li>org.apache.fop.render.intermediate.util.IFConcatenator</li>
+</ul>
+<h2 id="basics">Basic Usage Pattern<a class="headerlink" href="#basics" title="Permanent link">&para;</a></h2>
+<p>Apache FOP relies heavily on JAXP. It uses SAX events exclusively to receive the XSL-FO input document. It is therefore a good idea that you know a few things about JAXP (which is a good skill anyway). Let's look at the basic usage pattern for FOP...</p>
+<p>Here is the basic pattern to render an XSL-FO file to PDF:</p>
+<div class="codehilite"><pre><span class="kn">import</span> <span class="nn">org.apache.fop.apps.FopFactory</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.apache.fop.apps.Fop</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.apache.fop.apps.MimeConstants</span><span class="o">;</span>
+
+<span class="cm">/*..*/</span>
+
+<span class="c1">// Step 1: Construct a FopFactory by specifying a reference to the configuration file</span>
+<span class="c1">// (reuse if you plan to render multiple documents!)</span>
+<span class="n">FopFactory</span> <span class="n">fopFactory</span> <span class="o">=</span> <span class="n">FopFactory</span><span class="o">.</span><span class="na">newInstance</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/fop.xconf&quot;</span><span class="o">));</span>
+
+<span class="c1">// Step 2: Set up output stream.</span>
+<span class="c1">// Note: Using BufferedOutputStream for performance reasons (helpful with FileOutputStreams).</span>
+<span class="n">OutputStream</span> <span class="n">out</span> <span class="o">=</span> <span class="k">new</span> <span class="n">BufferedOutputStream</span><span class="o">(</span><span class="k">new</span> <span class="n">FileOutputStream</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/myfile.pdf&quot;</span><span class="o">)));</span>
+
+<span class="k">try</span> <span class="o">{</span>
+    <span class="c1">// Step 3: Construct fop with desired output format</span>
+    <span class="n">Fop</span> <span class="n">fop</span> <span class="o">=</span> <span class="n">fopFactory</span><span class="o">.</span><span class="na">newFop</span><span class="o">(</span><span class="n">MimeConstants</span><span class="o">.</span><span class="na">MIME_PDF</span><span class="o">,</span> <span class="n">out</span><span class="o">);</span>
+
+    <span class="c1">// Step 4: Setup JAXP using identity transformer</span>
+    <span class="n">TransformerFactory</span> <span class="n">factory</span> <span class="o">=</span> <span class="n">TransformerFactory</span><span class="o">.</span><span class="na">newInstance</span><span class="o">();</span>
+    <span class="n">Transformer</span> <span class="n">transformer</span> <span class="o">=</span> <span class="n">factory</span><span class="o">.</span><span class="na">newTransformer</span><span class="o">();</span> <span class="c1">// identity transformer</span>
+
+    <span class="c1">// Step 5: Setup input and output for XSLT transformation</span>
+    <span class="c1">// Setup input stream</span>
+    <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/myfile.fo&quot;</span><span class="o">));</span>
+
+    <span class="c1">// Resulting SAX events (the generated FO) must be piped through to FOP</span>
+    <span class="n">Result</span> <span class="n">res</span> <span class="o">=</span> <span class="k">new</span> <span class="n">SAXResult</span><span class="o">(</span><span class="n">fop</span><span class="o">.</span><span class="na">getDefaultHandler</span><span class="o">());</span>
+
+    <span class="c1">// Step 6: Start XSLT transformation and FOP processing</span>
+    <span class="n">transformer</span><span class="o">.</span><span class="na">transform</span><span class="o">(</span><span class="n">src</span><span class="o">,</span> <span class="n">res</span><span class="o">);</span>
+
+<span class="o">}</span> <span class="k">finally</span> <span class="o">{</span>
+    <span class="c1">//Clean-up</span>
+    <span class="n">out</span><span class="o">.</span><span class="na">close</span><span class="o">();</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p>Let's discuss these 5 steps in detail:</p>
+<ul>
+<li>
+<p><strong>Step 1:</strong> You create a new FopFactory instance. The FopFactory is created and holds references to configuration information and cached data. It's important to reuse this instance if you plan to render multiple documents during a JVM's lifetime.</p>
+</li>
+<li>
+<p><strong>Step 2:</strong> You set up an OutputStream that the generated document will be written to. It's a good idea to buffer the OutputStream as demonstrated to improve performance.</p>
+</li>
+<li>
+<p><strong>Step 3:</strong> You create a new Fop instance through one of the factory methods on the FopFactory. You tell the FopFactory what your desired output format is. This is done by using the MIME type of the desired output format (ex. "application/pdf"). You can use one of the MimeConstants.* constants. The second parameter is the OutputStream you've setup up in step 2.</p>
+</li>
+<li>
+<p><strong>Step 4</strong> We recommend that you use JAXP Transformers even if you don't do XSLT transformations to generate the XSL-FO file. This way you can always use the same basic pattern. The example here sets up an "identity transformer" which just passes the input (Source) unchanged to the output (Result). You don't have to work with a SAXParser if you don't do any XSLT transformations.</p>
+</li>
+<li>
+<p><strong>Step 5:</strong> Here you set up the input and output for the XSLT transformation. The Source object is set up to load the "myfile.fo" file. The Result is set up so the output of the XSLT transformation is sent to FOP. The FO file is sent to FOP in the form of SAX events which is the most efficient way. Please always avoid saving intermediate results to a file or a memory buffer because that affects performance negatively.</p>
+</li>
+<li>
+<p><strong>Step 6:</strong> Finally, we start the XSLT transformation by starting the JAXP Transformer. As soon as the JAXP Transformer starts to send its output to FOP, FOP itself starts its processing in the background. When the <code>transform()</code> method returns FOP will also have finished converting the FO file to a PDF file and you can close the OutputStream.</p>
+<p><note label="Tip!">It's a good idea to enclose the whole conversion in a try..finally statement. If you close the OutputStream in the finally section, this will make sure that the OutputStream is properly closed even if an exception occurs during the conversion.</note></p>
+</li>
+</ul>
+<p>If you're not totally familiar with JAXP Transformers, please have a look at the <a href="#examples">Embedding examples</a> below. The section contains examples for all sorts of use cases. If you look at all of them in turn you should be able to see the patterns in use and the flexibility this approach offers without adding too much complexity.</p>
+<p>This may look complicated at first, but it's really just the combination of an XSL transformation and a FOP run. It's also easy to comment out the FOP part for debugging purposes, for example when you're tracking down a bug in your stylesheet. You can easily write the XSL-FO output from the XSL transformation to a file to check if that part generates the expected output. An example for that can be found in the <a href="#examples">Embedding examples</a> (See "ExampleXML2FO").</p>
+<h3 id="basic-logging">Logging<a class="headerlink" href="#basic-logging" title="Permanent link">&para;</a></h3>
+<p>Logging is now a little different than it was in FOP 0.20.5. We've switched from Avalon Logging to <a href="http://commons.apache.org/logging/">Jakarta Commons Logging</a>. While with Avalon Logging the loggers were directly given to FOP, FOP now retrieves its logger(s) through a statically available LogFactory. This is similar to the general pattern that you use when you work with Apache Log4J directly, for example. We call this "static logging" (Commons Logging, Log4J) as opposed to "instance logging" (Avalon Logging). This has a consequence: You can't give FOP a logger for each processing run anymore. The log output of multiple, simultaneously running FOP instances is sent to the same logger.</p>
+<p>By default, <a href="http://commons.apache.org/logging/">Jakarta Commons Logging</a> uses JDK logging (available in JDKs 1.4 or higher) as its backend. You can configure Commons Logging to use an alternative backend, for example Log4J. Please consult the <a href="http://commons.apache.org/logging/">documentation for Jakarta Commons Logging</a> on how to configure alternative backends.</p>
+<p>As a result of the above we differentiate between two kinds of "logging":</p>
+<ul>
+<li>
+<p>(FOP-)Developer-oriented logging</p>
+</li>
+<li>
+<p><a href="events.html">User/Integrator-oriented feedback</a> (NEW!)</p>
+</li>
+</ul>
+<p>The use of "feedback" instead of "logging" is intentional. Most people were using log output as a means to get feedback from events within FOP. Therefore, FOP now includes an <code>event</code> package which can be used to receive feedback from the layout engine and other components within FOP <strong>per rendering run</strong>. This feedback is not just some text but event objects with parameters so these events can be interpreted by code. Of course, there is a facility to turn these events into normal human-readable messages. For details, please read on on the <a href="events.html">Events page</a>. This leaves normal logging to be mostly a thing used by the FOP developers although anyone can surely activate certain logging categories but the feedback from the loggers won't be separated by processing runs. If this is required, the <a href="events.html">Events subsystem</a> is the right approach.</p>
+<h3 id="render">Processing XSL-FO<a class="headerlink" href="#render" title="Permanent link">&para;</a></h3>
+<p>Once the Fop instance is set up, call <code>getDefaultHandler()</code> to obtain a SAX DefaultHandler instance to which you can send the SAX events making up the XSL-FO document you'd like to render. FOP processing starts as soon as the DefaultHandler's <code>startDocument()</code> method is called. Processing stops again when the DefaultHandler's <code>endDocument()</code> method is called. Please refer to the basic usage pattern shown above to render a simple XSL-FO document.</p>
+<h3 id="render-with-xslt">Processing XSL-FO generated from XML+XSLT<a class="headerlink" href="#render-with-xslt" title="Permanent link">&para;</a></h3>
+<p>If you want to process XSL-FO generated from XML using XSLT we recommend again using standard JAXP to do the XSLT part and piping the generated SAX events directly through to FOP. The only thing you'd change to do that on the basic usage pattern above is to set up the Transformer differently:</p>
+<div class="codehilite"><pre><span class="c1">//without XSLT:</span>
+<span class="c1">//Transformer transformer = factory.newTransformer(); // identity transformer</span>
+
+<span class="c1">//with XSLT:</span>
+<span class="n">Source</span> <span class="n">xslt</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;mystylesheet.xsl&quot;</span><span class="o">));</span>
+<span class="n">Transformer</span> <span class="n">transformer</span> <span class="o">=</span> <span class="n">factory</span><span class="o">.</span><span class="na">newTransformer</span><span class="o">(</span><span class="n">xslt</span><span class="o">);</span>
+</pre></div>
+
+
+<h2 id="input">Input Sources<a class="headerlink" href="#input" title="Permanent link">&para;</a></h2>
+<p>The input XSL-FO document is always received by FOP as a SAX stream (see the <a href="../dev/design/parsing.html">Parsing Design Document</a> for the rationale).</p>
+<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></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></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></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></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></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></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>
+</li>
+</ul>
+<p>There are a variety of upstream data manipulations possible. For example, you may have a DOM and an XSL stylesheet; or you may want to set variables in the stylesheet. Interface documentation and some cookbook solutions to these situations are provided in <a href="http://xml.apache.org/xalan-j/usagepatterns.html">Xalan Basic Usage Patterns</a>.</p>
+<h2 id="config-internal">Configuring Apache FOP Programmatically<a class="headerlink" href="#config-internal" title="Permanent link">&para;</a></h2>
+<p>Apache FOP provides two levels on which you can customize FOP's behaviour: the FopFactory and the user agent.</p>
+<h3 id="fop-factory">Customizing the FopFactory<a class="headerlink" href="#fop-factory" title="Permanent link">&para;</a></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>The FopFactoryBuilder is used to construct a FopFactory object. This builder can be used to set configuration values which will determine the behaviour of the FopFactory object. To create the FopFactoryBuilder the following line can be used as a precursor for the following examples:</p>
+<div class="codehilite"><pre><span class="n">FopFactoryBuilder</span> <span class="n">builder</span> <span class="o">=</span> <span class="k">new</span> <span class="n">FopFactoryBuilder</span><span class="o">(</span><span class="n">baseURI</span><span class="o">);</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:</p>
+<div class="codehilite"><pre><span class="c1">// myResourceResolver is a org.apache.xmlgraphics.io.ResourceResolver</span>
+<span class="n">FopFactoryBuilder</span> <span class="n">builder</span> <span class="o">=</span> <span class="k">new</span> <span class="n">FopFactoryBuilder</span><span class="o">(</span><span class="n">baseURI</span><span class="o">,</span> <span class="n">myResourceResolver</span><span class="o">);</span>
+</pre></div>
+
+
+<ul>
+<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">builder</span><span class="o">.</span><span class="na">setStrictFOValidation</span><span class="o">(</span><span class="kc">false</span><span class="o">);</span>
+</pre></div>
+
+
+</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">builder</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>
+
+
+</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">builder</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>
+
+
+</li>
+</ul>
+<p>The following example shows how a FopFactory is created using the settings specified:</p>
+<div class="codehilite"><pre><span class="n">FopFactory</span> <span class="n">fopFactory</span> <span class="o">=</span> <span class="n">builder</span><span class="o">.</span><span class="na">build</span><span class="o">();</span>
+</pre></div>
+
+
+<p>Finally, there are several options which can be set on the FopFactory itself including the following example:</p>
+<ul>
+<li>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:<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>
+
+
+</li>
+</ul>
+<h3 id="user-agent">Customizing the User Agent<a class="headerlink" href="#user-agent" title="Permanent link">&para;</a></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>
+<div class="codehilite"><pre><span class="n">FopFactory</span> <span class="n">fopFactory</span> <span class="o">=</span> <span class="n">FopFactory</span><span class="o">.</span><span class="na">newInstance</span><span class="o">(</span><span class="k">new</span> <span class="n">File</span><span class="o">(</span><span class="s">&quot;.&quot;</span><span class="o">).</span><span class="na">toURI</span><span class="o">());</span> <span class="c1">// Reuse the FopFactory if possible!</span>
+<span class="c1">// do the following for each new rendering run</span>
+<span class="n">FOUserAgent</span> <span class="n">userAgent</span> <span class="o">=</span> <span class="n">fopFactory</span><span class="o">.</span><span class="na">newFOUserAgent</span><span class="o">();</span>
+<span class="c1">// customize userAgent</span>
+<span class="n">Fop</span> <span class="n">fop</span> <span class="o">=</span> <span class="n">fopFactory</span><span class="o">.</span><span class="na">newFop</span><span class="o">(</span><span class="n">MimeConstants</span><span class="o">.</span><span class="na">MIME_POSTSCRIPT</span><span class="o">,</span> <span class="n">userAgent</span><span class="o">,</span> <span class="n">out</span><span class="o">);</span>
+</pre></div>
+
+
+<p>You can do all sorts of things on the user agent:</p>
+<ul>
+<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>
+
+
+</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>
+
+
+</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>
+
+
+</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>
+
+
+</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>
+
+
+</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>
+
+
+</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>
+
+
+</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>
+
+
+</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>
+
+
+</li>
+</ul>
+<p><note>You should not reuse an FOUserAgent instance between FOP rendering runs although you can. Especially in multi-threaded environment, this is a bad idea.</note></p>
+<h2 id="config-external">Using a Configuration File<a class="headerlink" href="#config-external" title="Permanent link">&para;</a></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>
+<div class="codehilite"><pre><span class="kn">import</span> <span class="nn">org.apache.avalon.framework.configuration.Configuration</span><span class="o">;</span>
+<span class="kn">import</span> <span class="nn">org.apache.avalon.framework.configuration.DefaultConfigurationBuilder</span><span class="o">;</span>
+
+<span class="cm">/*..*/</span>
+
+<span class="n">DefaultConfigurationBuilder</span> <span class="n">cfgBuilder</span> <span class="o">=</span> <span class="k">new</span> <span class="n">DefaultConfigurationBuilder</span><span class="o">();</span>
+<span class="n">Configuration</span> <span class="n">cfg</span> <span class="o">=</span> <span class="n">cfgBuilder</span><span class="o">.</span><span class="na">buildFromFile</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/mycfg.xml&quot;</span><span class="o">));</span>
+<span class="n">fopFactoryBuilder</span> <span class="o">=</span> <span class="k">new</span> <span class="n">FopFactoryBuilder</span><span class="o">(</span><span class="n">baseURI</span><span class="o">).</span><span class="na">setConfiguration</span><span class="o">(</span><span class="n">cfg</span><span class="o">);</span>
+</pre></div>
+
+
+<p>The layout of the configuration file is described on the <a href="configuration.html">Configuration page</a>.</p>
+<h2 id="documenthandlers">Document Handlers<a class="headerlink" href="#documenthandlers" title="Permanent link">&para;</a></h2>
+<p>The document handlers are classes that inherit from <code>org.apache.fop.render.intermediate.IFDocumentHandler</code>. This is an interface for which a MIME type specific implementation can be created. This same handler is used either when XSL-FO is used as the input or when Intermediate Format is used. Since IF is output format agnostic, if custom fonts or other configuration information that affect layout (specific to a particular MIME type) are given then FOP needs that contextual information. The document handler provides that context so that when the IF is rendered, it is more visually consistent with FO rendering. The code below shows an example of how a document handler can be used to provide PDF configuration data to the IFSerializer.</p>
+<div class="codehilite"><pre><span class="n">IFDocumentHandler</span> <span class="n">targetHandler</span> <span class="o">=</span> <span class="n">userAgent</span><span class="o">.</span><span class="na">getRendererFactory</span><span class="o">().</span><span class="na">createDocumentHandler</span><span class="o">(</span><span class="n">userAgent</span><span class="o">,</span> <span class="n">MimeConstants</span><span class="o">.</span><span class="na">MIME_PDF</span><span class="o">);</span>
+
+<span class="n">IFSerializer</span> <span class="n">ifSerializer</span> <span class="o">=</span> <span class="k">new</span> <span class="n">IFSerializer</span><span class="o">(</span><span class="k">new</span> <span class="n">IFContext</span><span class="o">(</span><span class="n">userAgent</span><span class="o">));</span>  <span class="c1">//Create the IFSerializer to write the intermediate format</span>
+<span class="n">ifSerializer</span><span class="o">.</span><span class="na">mimicDocumentHandler</span><span class="o">(</span><span class="n">targetHandler</span><span class="o">);</span>   <span class="c1">//Tell the IFSerializer to mimic the target format</span>
+
+<span class="n">userAgent</span><span class="o">.</span><span class="na">setDocumentHandlerOverride</span><span class="o">(</span><span class="n">ifSerializer</span><span class="o">);</span>  <span class="c1">//Make sure the prepared document handler is used</span>
+</pre></div>
+
+
+<p>The rest of the code is the same as in <a href="#basics">Basic Usage Patterns</a>.</p>
+<h2 id="hints">Hints<a class="headerlink" href="#hints" title="Permanent link">&para;</a></h2>
+<h3 id="object-reuse">Object reuse<a class="headerlink" href="#object-reuse" title="Permanent link">&para;</a></h3>
+<p>Fop instances shouldn't (and can't) be reused. Please recreate Fop and FOUserAgent instances for each rendering run using the FopFactory. This is a cheap operation as all reusable information is held in the FopFactory. That's why it's so important to reuse the FopFactory instance.</p>
+<h3 id="awt">AWT issues<a class="headerlink" href="#awt" title="Permanent link">&para;</a></h3>
+<p>If your XSL-FO files contain SVG then Apache Batik will be used. When Batik is initialised it uses certain classes in <code>java.awt</code> that intialise the Java AWT classes. This means that a daemon thread is created by the JVM and on Unix it will need to connect to a DISPLAY.</p>
+<p>The thread means that the Java application may not automatically quit when finished, you will need to call <code>System.exit()</code>. These issues should be fixed in the JDK 1.4.</p>
+<p>If you run into trouble running FOP on a head-less server, please see the <a href="graphics.html#batik">notes on Batik</a>.</p>
+<h3 id="render-info">Getting information on the rendering process<a class="headerlink" href="#render-info" title="Permanent link">&para;</a></h3>
+<p>To get the number of pages that were rendered by FOP you can call <code>Fop.getResults()</code>. This returns a <code>FormattingResults</code> object where you can look up the number of pages produced. It also gives you the page-sequences that were produced along with their id attribute and their numbers of pages. This is particularly useful if you render multiple documents (each enclosed by a page-sequence) and have to know the number of pages of each document.</p>
+<h2 id="performance">Improving performance<a class="headerlink" href="#performance" title="Permanent link">&para;</a></h2>
+<p>There are several options to consider:</p>
+<ul>
+<li>
+<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:</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>
+<p>Cache the stylesheet. If you use the same stylesheet multiple times you can set up a JAXP <code>Templates</code> object and reuse it each time you do the XSL transformation. (More information can be found <a href="http://www.javaworld.com/javaworld/jw-05-2003/jw-0502-xsl.html">here</a>.)</p>
+</li>
+<li>
+<p>Use an XSLT compiler like <a href="http://xml.apache.org/xalan-j/xsltc_usage.html">XSLTC</a> that comes with Xalan-J.</p>
+</li>
+<li>
+<p>Fine-tune your stylesheet to make the XSLT process more efficient and to create XSL-FO that can be processed by FOP more efficiently. Less is more: Try to make use of property inheritance where possible.</p>
+</li>
+<li>
+<p>You may also wish to consider trying to reduce <a href="running.html#memory">memory usage</a>.</p>
+</li>
+</ul>
+<h2 id="multithreading">Multithreading FOP<a class="headerlink" href="#multithreading" title="Permanent link">&para;</a></h2>
+<p>Apache FOP may currently not be completely thread safe. The code has not been fully tested for multi-threading issues, yet. If you encounter any suspicious behaviour, please notify us.</p>
+<p>There is also a known issue with fonts being jumbled between threads when using the Java2D/AWT renderer (which is used by the -awt and -print output options). In general, you cannot safely run multiple threads through the AWT renderer.</p>
+<h2 id="examples">Examples<a class="headerlink" href="#examples" title="Permanent link">&para;</a></h2>
+<p>The directory "{fop-dir}/examples/embedding" contains several working examples.</p>
+<h3 id="ExampleFO2PDF">ExampleFO2PDF.java<a class="headerlink" href="#ExampleFO2PDF" title="Permanent link">&para;</a></h3>
+<p>This <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleFO2PDF.java?view=markup">example</a> demonstrates the basic usage pattern to transform an XSL-FO file to PDF using FOP.</p>
+<p><img alt="Example XSL-FO to PDF" src="images/EmbeddingExampleFO2PDF.png" /></p>
+<h3 id="ExampleXML2FO">ExampleXML2FO.java<a class="headerlink" href="#ExampleXML2FO" title="Permanent link">&para;</a></h3>
+<p>This <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleXML2FO.java?view=markup">example</a> has nothing to do with FOP. It is there to show you how an XML file can be converted to XSL-FO using XSLT. The JAXP API is used to do the transformation. Make sure you've got a JAXP-compliant XSLT processor in your classpath (ex. <a href="http://xml.apache.org/xalan-j">Xalan</a>).</p>
+<p><img alt="Example XML to XSL-FO" src="images/EmbeddingExampleXML2FO.png" /></p>
+<h3 id="ExampleXML2PDF">ExampleXML2PDF.java<a class="headerlink" href="#ExampleXML2PDF" title="Permanent link">&para;</a></h3>
+<p>This <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleXML2PDF.java?view=markup">example</a> demonstrates how you can convert an arbitrary XML file to PDF using XSLT and XSL-FO/FOP. It is a combination of the first two examples above. The example uses JAXP to transform the XML file to XSL-FO and FOP to transform the XSL-FO to PDF.</p>
+<p><img alt="Example XML to PDF (via XSL-FO)" src="images/EmbeddingExampleXML2PDF.png" /></p>
+<p>The output (XSL-FO) from the XSL transformation is piped through to FOP using SAX events. This is the most efficient way to do this because the intermediate result doesn't have to be saved somewhere. Often, novice users save the intermediate result in a file, a byte array or a DOM tree. We strongly discourage you to do this if it isn't absolutely necessary. The performance is significantly higher with SAX.</p>
+<h3 id="ExampleObj2XML">ExampleObj2XML.java<a class="headerlink" href="#ExampleObj2XML" title="Permanent link">&para;</a></h3>
+<p>This <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleObj2XML.java?view=markup">example</a> is a preparatory example for the next one. It's an example that shows how an arbitrary Java object can be converted to XML. It's an often needed task to do this. Often people create a DOM tree from a Java object and use that. This is pretty straightforward. The example here, however, shows how to do this using SAX, which will probably be faster and not even more complicated once you know how this works.</p>
+<p><img alt="Example Java object to XML" src="images/EmbeddingExampleObj2XML.png" /></p>
+<p>For this example we've created two classes: ProjectTeam and ProjectMember (found in xml-fop/examples/embedding/java/embedding/model). They represent the same data structure found in xml-fop/examples/embedding/xml/xml/projectteam.xml. We want to serialize to XML a project team with several members which exist as Java objects. Therefore we created the two classes: ProjectTeamInputSource and ProjectTeamXMLReader (in the same place as ProjectTeam above).</p>
+<p>The XMLReader implementation (regard it as a special kind of XML parser) is responsible for creating SAX events from the Java object. The InputSource class is only used to hold the ProjectTeam object to be used.</p>
+<p>Have a look at the source of ExampleObj2XML.java to find out how this is used. For more detailed information see other resources on JAXP (ex. <a href="http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/xslt/3_generate.html">An older JAXP tutorial</a>).</p>
+<h3 id="ExampleObj2PDF">ExampleObj2PDF.java<a class="headerlink" href="#ExampleObj2PDF" title="Permanent link">&para;</a></h3>
+<p>This <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleObj2PDF.java?view=markup">example</a> combines the previous and the third to demonstrate how you can transform a Java object to a PDF directly in one smooth run by generating SAX events from the Java object that get fed to an XSL transformation. The result of the transformation is then converted to PDF using FOP as before.</p>
+<p><img alt="Example Java object to PDF (via XML and XSL-FO)" src="images/EmbeddingExampleObj2PDF.png" /></p>
+<h3 id="ExampleDOM2PDF">ExampleDOM2PDF.java<a class="headerlink" href="#ExampleDOM2PDF" title="Permanent link">&para;</a></h3>
+<p>This <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleDOM2PDF.java?view=markup">example</a> has FOP use a DOMSource instead of a StreamSource in order to use a DOM tree as input for an XSL transformation.</p>
+<h3 id="ExampleSVG2PDF">ExampleSVG2PDF.java (PDF Transcoder example)<a class="headerlink" href="#ExampleSVG2PDF" title="Permanent link">&para;</a></h3>
+<p>This <a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleSVG2PDF.java?view=markup">example</a> shows the usage of the PDF Transcoder, a sub-application within FOP. It is used to generate a PDF document from an SVG file.</p>
+<h3 id="ExampleConcat">ExampleConcat.java (IF Concatenation example)<a class="headerlink" href="#ExampleConcat" title="Permanent link">&para;</a></h3>
+<p>This can be found in the <code>embedding.intermediate</code> package within the examples and describes how IF can be concatenated to produce a document. Because IF has been through FOPs layout engine, it should be visually consistent with FO rendered documents while allowing the user to merge numerous documents together.</p>
+<h3 id="example-notes">Final notes<a class="headerlink" href="#example-notes" title="Permanent link">&para;</a></h3>
+<p>These examples should give you an idea of what's possible. It should be easy to adjust these examples to your needs. Also, if you have other examples that you think should be added here, please let us know via either the fop-users or fop-dev mailing lists. Finally, for more help please send your questions to the fop-users mailing list.</p></div>
+      </div>
+      
+      <div class="clear"></div>
+
+	  <div id="footer">
+		<div class="copyright">
+		  <div style="float:left; padding: 7px;">
+			<a title="Apache Software Foundation" href="http://www.apache.org"><img id="asf-feather-logo" alt="Apache Software Foundation" src="/images/asf_logo_url.png" width="200" /></a>
+        </div>
+		  <p>
+			Copyright &copy; 2016 The Apache Software Foundation, Licensed under
+			the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.
+			<br />
+			Apache, Apache XML Graphics, Apache FOP, Apache Batik, the Apache feather logo, and the
+			Apache XML Graphics logos are trademarks of <a href="http://www.apache.org">The Apache
+			Software Foundation</a>. All other marks mentioned may be trademarks or registered
+			trademarks of their respective owners.
+			<br />
+		  </p>
+		</div> 
+	  </div>
+	
+
+  </body>
+</html>



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


Mime
View raw message