blob: 856cb5bda01aa9f463402f0805aa5c1e62bc0dd3 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<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="https://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="https://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">
[![Apache XML Graphics Project Logo](/images/apache-xml-graphics.gif "Apache XML Graphics Project")](/)
# Apache&trade; FOP
- [FOP Home](/fop/)
- [Download](/fop/download.html)
- [Quick Start Guide](/fop/quickstartguide.html)
- [Compliance](/fop/compliance.html)
- [Getting Help](/fop/gethelp.html)
- [FAQs](/fop/faq.html)
- [FOP Wiki](https://cwiki.apache.org/confluence/display/XMLGRAPHICSFOP)
- [Mailing Lists](/fop/maillist.html)
- [License](/fop/license.html)
- ## Resources
- [XSL-FO](/fop/fo.html)
- [Examples](/fop/examples.html)
- [Bugs](/fop/bugs.html)
- [Wiki](https://cwiki.apache.org/confluence/display/XMLGRAPHICSFOP/FrontPage)
- [Other](/fop/resources.html)
- ## Project
- [News](/fop/news.html)
- [Who We Are](/fop/team.html)
- [Status](/fop/status.html)
- [Known Issues](/fop/knownissues.html)
- [Changes](/fop/changes.html)
- ## Versions
- ## FOP Trunk (dev)
- [Overview](/fop/trunk/)
- [Upgrading](/fop/trunk/upgrading.html)
- ### Using Apache&trade; FOP
- [Build](/fop/trunk/compiling.html)
- [Configure](/fop/trunk/configuration.html)
- [Run](/fop/trunk/running.html)
- [Embed](/fop/trunk/embedding.html)
- [Servlets](/fop/trunk/servlets.html)
- [Ant Task](/fop/trunk/anttask.html)
- ### Features
- [Accessibility](/fop/trunk/accessibility.html)
- [Complex Scripts](/fop/trunk/complexscripts.html)
- [Events](/fop/trunk/events.html)
- [Extensions](/fop/trunk/extensions.html)
- [Fonts](/fop/trunk/fonts.html)
- [Graphics](/fop/trunk/graphics.html)
- [Hyphenation](/fop/trunk/hyphenation.html)
- [Intermediate Format](/fop/trunk/intermediate.html)
- [Metadata](/fop/trunk/metadata.html)
- [Output Targets](/fop/trunk/output.html)
- [PDF/A](/fop/trunk/pdfa.html)
- [PDF/X](/fop/trunk/pdfx.html)
- [PDF Encryption](/fop/trunk/pdfencryption.html)
- [PDF Images](/fop/fop-pdf-images.html)
- [Whitespace Management](/fop/trunk/whitespacemanagement.html)
- ## FOP 2.5
- [FOP 2.5 Overview](/fop/2.5/)
- [Release Notes](/fop/2.5/releaseNotes_2.5.html)
- [Changes (2.5)](/fop/2.5/changes_2.5.html)
- [Known Issues](/fop/2.5/knownissues_overview.html)
- [Upgrading](/fop/2.5/upgrading.html)
- ### Using Apache FOP 2.5
- [Build](/fop/2.5/compiling.html)
- [Configure](/fop/2.5/configuration.html)
- [Run](/fop/2.5/running.html)
- [Embed](/fop/2.5/embedding.html)
- [Servlets](/fop/2.5/servlets.html)
- [Ant Task](/fop/2.5/anttask.html)
- ### Features
- [Accessibility](/fop/2.5/accessibility.html)
- [Complex Scripts](/fop/2.5/complexscripts.html)
- [Events](/fop/2.5/events.html)
- [Extensions](/fop/2.5/extensions.html)
- [Fonts](/fop/2.5/fonts.html)
- [Graphics](/fop/2.5/graphics.html)
- [Hyphenation](/fop/2.5/hyphenation.html)
- [Intermediate Format](/fop/2.5/intermediate.html)
- [Metadata](/fop/2.5/metadata.html)
- [Output Targets](/fop/2.5/output.html)
- [PDF/A](/fop/2.5/pdfa.html)
- [PDF/X](/fop/2.5/pdfx.html)
- [PDF Encryption](/fop/2.5/pdfencryption.html)
- [PDF Images](/fop/fop-pdf-images.html)
- [Whitespace Management](/fop/2.5/whitespacemanagement.html)
- ## FOP 2.4
- [FOP 2.4 Overview](/fop/2.4/)
- [Release Notes](/fop/2.4/releaseNotes_2.4.html)
- [Changes (2.4)](/fop/2.4/changes_2.4.html)
- [Known Issues](/fop/2.4/knownissues_overview.html)
- [Upgrading](/fop/2.4/upgrading.html)
- ### Using Apache FOP 2.4
- [Build](/fop/2.4/compiling.html)
- [Configure](/fop/2.4/configuration.html)
- [Run](/fop/2.4/running.html)
- [Embed](/fop/2.4/embedding.html)
- [Servlets](/fop/2.4/servlets.html)
- [Ant Task](/fop/2.4/anttask.html)
- ### Features
- [Accessibility](/fop/2.4/accessibility.html)
- [Complex Scripts](/fop/2.4/complexscripts.html)
- [Events](/fop/2.4/events.html)
- [Extensions](/fop/2.4/extensions.html)
- [Fonts](/fop/2.4/fonts.html)
- [Graphics](/fop/2.4/graphics.html)
- [Hyphenation](/fop/2.4/hyphenation.html)
- [Intermediate Format](/fop/2.4/intermediate.html)
- [Metadata](/fop/2.4/metadata.html)
- [Output Targets](/fop/2.4/output.html)
- [PDF/A](/fop/2.4/pdfa.html)
- [PDF/X](/fop/2.4/pdfx.html)
- [PDF Encryption](/fop/2.4/pdfencryption.html)
- [PDF Images](/fop/fop-pdf-images.html)
- [Whitespace Management](/fop/2.4/whitespacemanagement.html)
- ## FOP 2.3
- [FOP 2.3 Overview](/fop/2.3/)
- [Release Notes](/fop/2.3/releaseNotes_2.3.html)
- [Changes (2.3)](/fop/2.3/changes_2.3.html)
- [Known Issues](/fop/2.3/knownissues_overview.html)
- [Upgrading](/fop/2.3/upgrading.html)
- ### Using Apache FOP 2.3
- [Build](/fop/2.3/compiling.html)
- [Configure](/fop/2.3/configuration.html)
- [Run](/fop/2.3/running.html)
- [Embed](/fop/2.3/embedding.html)
- [Servlets](/fop/2.3/servlets.html)
- [Ant Task](/fop/2.3/anttask.html)
- ### Features
- [Accessibility](/fop/2.3/accessibility.html)
- [Complex Scripts](/fop/2.3/complexscripts.html)
- [Events](/fop/2.3/events.html)
- [Extensions](/fop/2.3/extensions.html)
- [Fonts](/fop/2.3/fonts.html)
- [Graphics](/fop/2.3/graphics.html)
- [Hyphenation](/fop/2.3/hyphenation.html)
- [Intermediate Format](/fop/2.3/intermediate.html)
- [Metadata](/fop/2.3/metadata.html)
- [Output Targets](/fop/2.3/output.html)
- [PDF/A](/fop/2.3/pdfa.html)
- [PDF/X](/fop/2.3/pdfx.html)
- [PDF Encryption](/fop/2.3/pdfencryption.html)
- [PDF Images](/fop/fop-pdf-images.html)
- [Whitespace Management](/fop/2.3/whitespacemanagement.html)
- ## FOP 2.2
- [FOP 2.2 Overview](/fop/2.2/)
- [Release Notes](/fop/2.2/releaseNotes_2.2.html)
- [Changes (2.2)](/fop/2.2/changes_2.2.html)
- [Known Issues](/fop/2.2/knownissues_overview.html)
- [Upgrading](/fop/2.2/upgrading.html)
- ### Using Apache FOP 2.2
- [Build](/fop/2.2/compiling.html)
- [Configure](/fop/2.2/configuration.html)
- [Run](/fop/2.2/running.html)
- [Embed](/fop/2.2/embedding.html)
- [Servlets](/fop/2.2/servlets.html)
- [Ant Task](/fop/2.2/anttask.html)
- ### Features
- [Accessibility](/fop/2.2/accessibility.html)
- [Complex Scripts](/fop/2.2/complexscripts.html)
- [Events](/fop/2.2/events.html)
- [Extensions](/fop/2.2/extensions.html)
- [Fonts](/fop/2.2/fonts.html)
- [Graphics](/fop/2.2/graphics.html)
- [Hyphenation](/fop/2.2/hyphenation.html)
- [Intermediate Format](/fop/2.2/intermediate.html)
- [Metadata](/fop/2.2/metadata.html)
- [Output Targets](/fop/2.2/output.html)
- [PDF/A](/fop/2.2/pdfa.html)
- [PDF/X](/fop/2.2/pdfx.html)
- [PDF Encryption](/fop/2.2/pdfencryption.html)
- [PDF Images](/fop/fop-pdf-images.html)
- [Whitespace Management](/fop/2.2/whitespacemanagement.html)
- ## FOP 2.1
- [FOP 2.1 Overview](/fop/2.1/)
- [Release Notes](/fop/2.1/releaseNotes_2.1.html)
- [Changes (2.1)](/fop/2.1/changes_2.1.html)
- [Known Issues](/fop/2.1/knownissues_overview.html)
- [Upgrading](/fop/2.1/upgrading.html)
- ### Using Apache FOP 2.1
- [Build](/fop/2.1/compiling.html)
- [Configure](/fop/2.1/configuration.html)
- [Run](/fop/2.1/running.html)
- [Embed](/fop/2.1/embedding.html)
- [Servlets](/fop/2.1/servlets.html)
- [Ant Task](/fop/2.1/anttask.html)
- ### Features
- [Accessibility](/fop/2.1/accessibility.html)
- [Complex Scripts](/fop/2.1/complexscripts.html)
- [Events](/fop/2.1/events.html)
- [Extensions](/fop/2.1/extensions.html)
- [Fonts](/fop/2.1/fonts.html)
- [Graphics](/fop/2.1/graphics.html)
- [Hyphenation](/fop/2.1/hyphenation.html)
- [Intermediate Format](/fop/2.1/intermediate.html)
- [Metadata](/fop/2.1/metadata.html)
- [Output Targets](/fop/2.1/output.html)
- [PDF/A](/fop/2.1/pdfa.html)
- [PDF/X](/fop/2.1/pdfx.html)
- [PDF Encryption](/fop/2.1/pdfencryption.html)
- [PDF Images](/fop/fop-pdf-images.html)
- [Whitespace Management](/fop/2.1/whitespacemanagement.html)
- ## FOP 2.0
- [FOP 2.0 Overview](/fop/2.0/)
- [Release Notes](/fop/2.0/releaseNotes_2.0.html)
- [Changes (2.0)](/fop/2.0/changes_2.0.html)
- [Known Issues](/fop/2.0/knownissues_overview.html)
- [Upgrading](/fop/2.0/upgrading.html)
- ### Using Apache FOP 2.0
- [Build](/fop/2.0/compiling.html)
- [Configure](/fop/2.0/configuration.html)
- [Run](/fop/2.0/running.html)
- [Embed](/fop/2.0/embedding.html)
- [Servlets](/fop/2.0/servlets.html)
- [Ant Task](/fop/2.0/anttask.html)
- ### Features
- [Accessibility](/fop/2.0/accessibility.html)
- [Complex Scripts](/fop/2.0/complexscripts.html)
- [Events](/fop/2.0/events.html)
- [Extensions](/fop/2.0/extensions.html)
- [Fonts](/fop/2.0/fonts.html)
- [Graphics](/fop/2.0/graphics.html)
- [Hyphenation](/fop/2.0/hyphenation.html)
- [Intermediate Format](/fop/2.0/intermediate.html)
- [Metadata](/fop/2.0/metadata.html)
- [Output Targets](/fop/2.0/output.html)
- [PDF/A](/fop/2.0/pdfa.html)
- [PDF/X](/fop/2.0/pdfx.html)
- [PDF Encryption](/fop/2.0/pdfencryption.html)
- [PDF Images](/fop/fop-pdf-images.html)
- [Whitespace Management](/fop/2.0/whitespacemanagement.html)
- ## FOP 1.1
- [FOP 1.1 Overview](/fop/1.1/)
- [Release Notes](/fop/1.1/releaseNotes_1.1.html)
- [Changes (1.1)](/fop/1.1/changes_1.1.html)
- [Known Issues](/fop/1.1/knownissues_overview.html)
- [Upgrading](/fop/1.1/upgrading.html)
- ### Using Apache FOP 1.1
- [Build](/fop/1.1/compiling.html)
- [Configure](/fop/1.1/configuration.html)
- [Run](/fop/1.1/running.html)
- [Embed](/fop/1.1/embedding.html)
- [Servlets](/fop/1.1/servlets.html)
- [Ant Task](/fop/1.1/anttask.html)
- ### Features
- [Accessibility](/fop/1.1/accessibility.html)
- [Complex Scripts](/fop/1.1/complexscripts.html)
- [Events](/fop/1.1/events.html)
- [Extensions](/fop/1.1/extensions.html)
- [Fonts](/fop/1.1/fonts.html)
- [Graphics](/fop/1.1/graphics.html)
- [Hyphenation](/fop/1.1/hyphenation.html)
- [Intermediate Format](/fop/1.1/intermediate.html)
- [Metadata](/fop/1.1/metadata.html)
- [Output Targets](/fop/1.1/output.html)
- [PDF/A](/fop/1.1/pdfa.html)
- [PDF/X](/fop/1.1/pdfx.html)
- [PDF Encryption](/fop/1.1/pdfencryption.html)
- ## FOP 1.0
- [FOP 1.0 Overview](/fop/1.0/)
- [Release Notes](/fop/1.0/releaseNotes_1.0.html)
- [Changes (1.0)](/fop/1.0/changes_1.0.html)
- [Known Issues](/fop/1.0/knownissues_overview.html)
- [Upgrading](/fop/1.0/upgrading.html)
- ### Using Apache FOP 1.0
- [Build](/fop/1.0/compiling.html)
- [Configure](/fop/1.0/configuration.html)
- [Run](/fop/1.0/running.html)
- [Embed](/fop/1.0/embedding.html)
- [Servlets](/fop/1.0/servlets.html)
- [Ant Task](/fop/1.0/anttask.html)
- ### Features
- [Output Targets](/fop/1.0/output.html)
- [Intermediate Format](/fop/1.0/intermediate.html)
- [PDF Encryption](/fop/1.0/pdfencryption.html)
- [PDF/A](/fop/1.0/pdfa.html)
- [PDF/X](/fop/1.0/pdfx.html)
- [Graphics](/fop/1.0/graphics.html)
- [Fonts](/fop/1.0/fonts.html)
- [Hyphenation](/fop/1.0/hyphenation.html)
- [Extensions](/fop/1.0/extensions.html)
- [Events](/fop/1.0/events.html)
- [Metadata](/fop/1.0/metadata.html)
- [Accessibility](/fop/1.0/accessibility.html)
- ## FOP Development
- [General Info](/fop/dev/)
- ## Design
- [Design Info](/fop/dev/design/)
- ## Core Process
- [Startup](/fop/dev/design/startup.html)
- [XML Parsing](/fop/dev/design/parsing.html)
- [FO Tree](/fop/dev/design/fotree.html)
- [Properties](/fop/dev/design/properties.html)
- [Layout](/fop/dev/design/layout.html)
- [Break Possibility](/fop/dev/design/breakpos.html)
- [Area Tree](/fop/dev/design/areas.html)
- [Renderers](/fop/dev/design/renderers.html)
- ## Miscellaneous
- [Images](/fop/dev/design/images.html)
- [PDF Library](/fop/dev/design/pdf-library.html)
- [SVG](/fop/dev/design/svg.html)
- [Embedding](/fop/dev/design/embedding.html)
- [Extending](/fop/dev/design/extending.html)
- [Optimisations](/fop/dev/design/optimise.html)
- [User Agent](/fop/dev/design/useragent.html)
- [Unresolved (Wiki)](https://cwiki.apache.org/confluence/display/XMLGRAPHICSFOP/FOPProjectPages)
- [SVG](/fop/dev/svg.html)
- [Extensions](/fop/dev/extensions.html)
- ## Develop
- [Walk-Thru](/fop/dev/implement.html)
- [Patch Queue](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)
- [Conventions](/fop/dev/conventions.html)
- ## Test
- [Testing](/fop/dev/testing.html)
- ## Deploy
- [Doc Mgmt](/fop/dev/doc.html)
- [Release](/fop/dev/release.html)
- [Bugs](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)
- ## Resources
- [FAQs](/fop/dev/faq.html)
- [Tools](/fop/dev/tools.html)
- [ViewVC](http://svn.apache.org/viewvc/xmlgraphics/fop)
- ## SubPackages
- [RTFlib](/fop/dev/rtflib.html)
# Apache&trade; XML Graphics
- ## Project Overview
- [Who We Are](/team.html)
- [Legal Stuff](/legal.html)
- [Project Charter](/charter.html)
- [Mailing Lists](/mail.html)
- [Code Repositories](/repo.html)
- [ASF Sponsorship Program](https://www.apache.org/foundation/sponsorship.html)
- [ASF Thanks](https://www.apache.org/foundation/thanks.html)
- [Licenses](https://www.apache.org/licenses/)
- [Apache XML Graphics Security](/security.html)
- [ASF Security](https://www.apache.org/security/)
# Sub Projects
- [Apache Batik](/batik/)
- [Apache XML Graphics Commons](/commons/)
### Search Apache XML Graphics
<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>
### ApacheCon N. America
<a title="ApacheCon North America" href="https://www.apachecon.com"><img class="apachecon_logo" alt="ApacheCon North America" src="https://www.apachecon.com/images/landingpage/apachecon-logo.png" width="200" /></a><br /><br />
* **[ApacheCon NA](https://www.apachecon.com/)**
Hope to see you there!
### ApacheCon Europe
<a title="ApacheCon Europe" href="https://www.apachecon.com"><img class="apachecon_logo" alt="ApacheCon Europe" src="https://www.apachecon.com/images/landingpage/apachecon-logo.png" width="200" /></a><br /><br />
* **[ApacheCon Europe](https://www.apachecon.com/)**
Hope to see you there!
<a title="Apache Software Foundation" href="https://www.apache.org"><img id="asf_logo_url" alt="Apache Software Foundation " src="/images/asf_logo_url.png" width="200" /></a><br /><br />
<a title="Support the Apache Software Foundation" href="https://donate.apache.org/"><img id="asf_support_url" alt="Support the Apache Software Foundation " src="https://blogs.apache.org/foundation/mediaresource/d67ca611-a57c-462d-ac23-95063f81d175" width="200" /></a>
<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 Development: Adding an Extension</h1>
<h1>Apache&trade; FOP Development: Adding an Extension</h1>
<h2 id="overview">Overview</h2>
<p>For documentation of standard Apache&trade; FOP extensions, see the <a href="../trunk/extensions.html">User FOP Extensions</a> document.</p>
<p>If the default funtionality of FOP needs to be extended for some reason then you can write an extension.</p>
<p>There are three types of extensions possible:</p>
<ul>
<li>
<p>An output document extension such as the PDF bookmarks</p>
</li>
<li>
<p>an instream-foreign-object extensions such as SVG</p>
</li>
<li>
<p>an fo extension that creates an area in the area tree where normal xsl:fo is not possible</p>
</li>
</ul>
<h2 id="adding">Adding Your Own</h2>
<p>To add your own extension you need to do the following things.</p>
<ol>
<li>
<p>Write code that implements your extension functionality. The easiest place to start is by looking at the code in org.apache.fop.fo.extensions, and by looking at the examples in the <code>examples</code> directory.</p>
</li>
<li>
<p>Create a class that extends the abstract org.apache.fop.fo.ElementMapping class. ElementMapping is a hashmap of all of the elements in a particular namespace, which makes it easier for FOP to create a different object for each element. ElementMapping objects are static to save on memory. They are loaded by FOP when parsing starts to validate input.</p>
</li>
<li>
<p>Create the following file: "/META-INF/services/org.apache.fop.fo.ElementMapping", which should contain the fully qualified classname of your ElementMapping implementation class.</p>
</li>
<li>
<p>Create a jar file containing all of the above files.</p>
</li>
<li>
<p>Create your XSL-FO file with the extra XML data embedded in the file with the correct name space. The examples for SVG and pdfoutline.fo show how this can be done. The pdf documents on the FOP site use this extension. See also <a href="../examples.html">Examples</a> for more examples.</p>
</li>
<li>
<p>Put your jar file in the classpath</p>
</li>
<li>
<p>Run FOP using your XSL-FO file as input.</p>
</li>
</ol>
<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>