xmlgraphics-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r840560 [5/16] - in /websites/staging/xmlgraphics/trunk/content: ./ fop/0.95/ fop/1.0/ fop/1.1/ fop/trunk/
Date Mon, 03 Dec 2012 15:47:54 GMT
Modified: websites/staging/xmlgraphics/trunk/content/fop/1.0/events.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/1.0/events.html (original)
+++ websites/staging/xmlgraphics/trunk/content/fop/1.0/events.html Mon Dec  3 15:47:41 2012
@@ -341,12 +341,12 @@ $(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/1.0/">1.0</a></div> -->
-      	<div class="section-content"><h1 id="apachewzxhzdk4-fop-eventsprocessing-feedback">Apache&trade; FOP: Events/Processing Feedback</h1>
-<h2 id="introduction-wzxhzdk5wzxhzdk6">Introduction <a id="introduction"></a></h2>
+      	<div class="section-content"><h1 id="apachewzxhzdk8-fop-eventsprocessing-feedback">Apache&trade; FOP: Events/Processing Feedback</h1>
+<h2 id="introduction-wzxhzdk9wzxhzdk10">Introduction <a id="introduction"></a></h2>
 <p>In versions until 0.20.5, Apache&trade; FOP used <a href="http://excalibur.apache.org/framework/index.html">Avalon-style Logging</a> where it was possible to supply a logger per processing run. During the redesign the logging infrastructure was switched over to <a href="http://commons.apache.org/logging/">Commons Logging</a> which is (like Log4J or java.util.logging) a "static" logging framework (the logger is accessed through static variables). This made it very difficult in a multi-threaded system to retrieve information for a single processing run.</p>
 <p>With FOP's event subsystem, we'd like to close this gap again and even go further. The first point is to realize that we have two kinds of "logging". Firstly, we have the logging infrastructure for the (FOP) developer who needs to be able to enable finer log messages for certain parts of FOP to track down a certain problem. Secondly, we have the user who would like to be informed about missing images, overflowing lines or substituted fonts. These messages (or events) are targeted at less technical people and may ideally be localized (translated). Furthermore, tool and solution builders would like to integrate FOP into their own solutions. For example, an FO editor should be able to point the user to the right place where a particular problem occurred while developing a document template. Finally, some integrators would like to abort processing if a resource (an image or a font) has not been found, while others would simply continue. The event system allows to react on the
 se events.</p>
 <p>On this page, we won't discuss logging as such. We will show how the event subsystem can be used for various tasks. We'll first look at the event subsystem from the consumer side. Finally, the production of events inside FOP will be discussed (this is mostly interesting for FOP developers only).</p>
-<h2 id="the-consumer-side-wzxhzdk8wzxhzdk9">The consumer side <a id="consumer"></a></h2>
+<h2 id="the-consumer-side-wzxhzdk12wzxhzdk13">The consumer side <a id="consumer"></a></h2>
 <p>The event subsystem is located in the <code>org.apache.fop.events</code> package and its base is the <code>Event</code> class. An instance is created for each event and is sent to a set of <code>EventListener</code> instances by the <code>EventBroadcaster</code> . An <code>Event</code> contains:</p>
 <ul>
 <li>
@@ -364,127 +364,144 @@ $(document).ready(function () {
 </ul>
 <p>The <code>EventFormatter</code> class can be used to translate the events into human-readable, localized messages.</p>
 <p>A full example of what is shown here can be found in the <code>examples/embedding/java/embedding/events</code> directory in the FOP distribution. The example can also be accessed <a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/events/">via the web</a> .</p>
-<h3 id="writing-an-eventlistener-wzxhzdk10wzxhzdk11">Writing an EventListener <a id="write-listener"></a></h3>
-<p>The following code sample shows a very simple EventListener. It basically just sends all events to System.out (stdout) or System.err (stderr) depending on the event severity.
-import org.apache.fop.events.Event;
-import org.apache.fop.events.EventFormatter;
-import org.apache.fop.events.EventListener;
-import org.apache.fop.events.model.EventSeverity;</p>
-<p>/*<em> A simple event listener that writes the events to stdout and stderr. </em>/
-public class SysOutEventListener implements EventListener {</p>
-<div class="codehilite"><pre><span class="sr">/** {@inheritDoc} */</span>
-<span class="n">public</span> <span class="n">void</span> <span class="n">processEvent</span><span class="p">(</span><span class="n">Event</span> <span class="n">event</span><span class="p">)</span> <span class="p">{</span>
-    <span class="n">String</span> <span class="n">msg</span> <span class="o">=</span> <span class="n">EventFormatter</span><span class="o">.</span><span class="nb">format</span><span class="p">(</span><span class="n">event</span><span class="p">);</span>
-    <span class="n">EventSeverity</span> <span class="n">severity</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">getSeverity</span><span class="p">();</span>
-    <span class="k">if</span> <span class="p">(</span><span class="n">severity</span> <span class="o">==</span> <span class="n">EventSeverity</span><span class="o">.</span><span class="n">INFO</span><span class="p">)</span> <span class="p">{</span>
-        <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;[INFO ] &quot;</span> <span class="o">+</span> <span class="n">msg</span><span class="p">);</span>
-    <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">severity</span> <span class="o">==</span> <span class="n">EventSeverity</span><span class="o">.</span><span class="n">WARN</span><span class="p">)</span> <span class="p">{</span>
-        <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;[WARN ] &quot;</span> <span class="o">+</span> <span class="n">msg</span><span class="p">);</span>
-    <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">severity</span> <span class="o">==</span> <span class="n">EventSeverity</span><span class="o">.</span><span class="n">ERROR</span><span class="p">)</span> <span class="p">{</span>
-        <span class="n">System</span><span class="o">.</span><span class="n">err</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;[ERROR] &quot;</span> <span class="o">+</span> <span class="n">msg</span><span class="p">);</span>
-    <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">severity</span> <span class="o">==</span> <span class="n">EventSeverity</span><span class="o">.</span><span class="n">FATAL</span><span class="p">)</span> <span class="p">{</span>
-        <span class="n">System</span><span class="o">.</span><span class="n">err</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;[FATAL] &quot;</span> <span class="o">+</span> <span class="n">msg</span><span class="p">);</span>
-    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
-        <span class="n">assert</span> <span class="n">false</span><span class="p">;</span>
+<h3 id="writing-an-eventlistener-wzxhzdk14wzxhzdk15">Writing an EventListener <a id="write-listener"></a></h3>
+<p>The following code sample shows a very simple EventListener. It basically just sends all events to System.out (stdout) or System.err (stderr) depending on the event severity.</p>
+<div class="codehilite"><pre><span class="nb">import</span> <span class="n">org</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">fop</span><span class="o">.</span><span class="n">events</span><span class="o">.</span><span class="n">Event</span><span class="p">;</span>
+<span class="nb">import</span> <span class="n">org</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">fop</span><span class="o">.</span><span class="n">events</span><span class="o">.</span><span class="n">EventFormatter</span><span class="p">;</span>
+<span class="nb">import</span> <span class="n">org</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">fop</span><span class="o">.</span><span class="n">events</span><span class="o">.</span><span class="n">EventListener</span><span class="p">;</span>
+<span class="nb">import</span> <span class="n">org</span><span class="o">.</span><span class="n">apache</span><span class="o">.</span><span class="n">fop</span><span class="o">.</span><span class="n">events</span><span class="o">.</span><span class="n">model</span><span class="o">.</span><span class="n">EventSeverity</span><span class="p">;</span>
+
+<span class="sr">/** A simple event listener that writes the events to stdout and stderr. */</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">SysOutEventListener</span> <span class="n">implements</span> <span class="n">EventListener</span> <span class="p">{</span>
+
+    <span class="sr">/** {@inheritDoc} */</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">processEvent</span><span class="p">(</span><span class="n">Event</span> <span class="n">event</span><span class="p">)</span> <span class="p">{</span>
+        <span class="n">String</span> <span class="n">msg</span> <span class="o">=</span> <span class="n">EventFormatter</span><span class="o">.</span><span class="nb">format</span><span class="p">(</span><span class="n">event</span><span class="p">);</span>
+        <span class="n">EventSeverity</span> <span class="n">severity</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="n">getSeverity</span><span class="p">();</span>
+        <span class="k">if</span> <span class="p">(</span><span class="n">severity</span> <span class="o">==</span> <span class="n">EventSeverity</span><span class="o">.</span><span class="n">INFO</span><span class="p">)</span> <span class="p">{</span>
+            <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;[INFO ] &quot;</span> <span class="o">+</span> <span class="n">msg</span><span class="p">);</span>
+        <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">severity</span> <span class="o">==</span> <span class="n">EventSeverity</span><span class="o">.</span><span class="n">WARN</span><span class="p">)</span> <span class="p">{</span>
+            <span class="n">System</span><span class="o">.</span><span class="n">out</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;[WARN ] &quot;</span> <span class="o">+</span> <span class="n">msg</span><span class="p">);</span>
+        <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">severity</span> <span class="o">==</span> <span class="n">EventSeverity</span><span class="o">.</span><span class="n">ERROR</span><span class="p">)</span> <span class="p">{</span>
+            <span class="n">System</span><span class="o">.</span><span class="n">err</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;[ERROR] &quot;</span> <span class="o">+</span> <span class="n">msg</span><span class="p">);</span>
+        <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="n">severity</span> <span class="o">==</span> <span class="n">EventSeverity</span><span class="o">.</span><span class="n">FATAL</span><span class="p">)</span> <span class="p">{</span>
+            <span class="n">System</span><span class="o">.</span><span class="n">err</span><span class="o">.</span><span class="n">println</span><span class="p">(</span><span class="s">&quot;[FATAL] &quot;</span> <span class="o">+</span> <span class="n">msg</span><span class="p">);</span>
+        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+            <span class="n">assert</span> <span class="n">false</span><span class="p">;</span>
+        <span class="p">}</span>
     <span class="p">}</span>
 <span class="p">}</span>
 </pre></div>
 
 
-<p>}
-You can see that for every event the method <code>processEvent</code> of the <code>EventListener</code> will be called. Inside this method you can do whatever processing you would like including throwing a <code>RuntimeException</code> , if you want to abort the current processing run.</p>
+<p>You can see that for every event the method <code>processEvent</code> of the <code>EventListener</code> will be called. Inside this method you can do whatever processing you would like including throwing a <code>RuntimeException</code> , if you want to abort the current processing run.</p>
 <p>The code above also shows how you can turn an event into a human-readable, localized message that can be presented to a user. The <code>EventFormatter</code> class does this for you. It provides additional methods if you'd like to explicitly specify the locale.</p>
 <p>It is possible to gather all events for a whole processing run so they can be evaluated afterwards. However, care should be taken about memory consumption since the events provide references to objects inside FOP which may themselves have references to other objects. So holding on to these objects may mean that whole object trees cannot be released!</p>
-<h3 id="adding-an-eventlistener-wzxhzdk12wzxhzdk13">Adding an EventListener <a id="add-listener"></a></h3>
-<p>To register the event listener with FOP, get the <code>EventBroadcaster</code> which is associated with the user agent ( <code>FOUserAgent</code> ) and add it there:
-FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
-foUserAgent.getEventBroadcaster().addEventListener(new SysOutEventListener());
-Please note that this is done separately for each processing run, i.e. for each new user agent.</p>
-<h3 id="an-additional-listener-example-wzxhzdk14wzxhzdk15">An additional listener example <a id="listener-example1"></a></h3>
+<h3 id="adding-an-eventlistener-wzxhzdk16wzxhzdk17">Adding an EventListener <a id="add-listener"></a></h3>
+<p>To register the event listener with FOP, get the <code>EventBroadcaster</code> which is associated with the user agent ( <code>FOUserAgent</code> ) and add it there:</p>
+<div class="codehilite"><pre><span class="n">FOUserAgent</span> <span class="n">foUserAgent</span> <span class="o">=</span> <span class="n">fopFactory</span><span class="o">.</span><span class="n">newFOUserAgent</span><span class="p">();</span>
+<span class="n">foUserAgent</span><span class="o">.</span><span class="n">getEventBroadcaster</span><span class="p">()</span><span class="o">.</span><span class="n">addEventListener</span><span class="p">(</span><span class="k">new</span> <span class="n">SysOutEventListener</span><span class="p">());</span>
+</pre></div>
+
+
+<p>Please note that this is done separately for each processing run, i.e. for each new user agent.</p>
+<h3 id="an-additional-listener-example-wzxhzdk18wzxhzdk19">An additional listener example <a id="listener-example1"></a></h3>
 <p>Here's an additional example of an event listener:</p>
-<p>By default, FOP continues processing even if an image wasn't found. If you have more strict requirements and want FOP to stop if an image is not available, you can do something like the following in the simplest case:
-public class MyEventListener implements EventListener {</p>
-<div class="codehilite"><pre><span class="n">public</span> <span class="n">void</span> <span class="n">processEvent</span><span class="p">(</span><span class="n">Event</span> <span class="n">event</span><span class="p">)</span> <span class="p">{</span>
-    <span class="k">if</span> <span class="p">(</span><span class="s">&quot;org.apache.fop.ResourceEventProducer&quot;</span><span class="o">.</span><span class="n">equals</span><span class="p">(</span>
-            <span class="n">event</span><span class="o">.</span><span class="n">getEventGroupID</span><span class="p">()))</span> <span class="p">{</span>
-        <span class="n">event</span><span class="o">.</span><span class="n">setSeverity</span><span class="p">(</span><span class="n">EventSeverity</span><span class="o">.</span><span class="n">FATAL</span><span class="p">);</span>
-    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
-        <span class="sr">//ig</span><span class="n">nore</span> <span class="n">all</span> <span class="n">other</span> <span class="n">events</span> <span class="p">(</span><span class="ow">or</span> <span class="k">do</span> <span class="n">something</span> <span class="n">of</span> <span class="n">your</span> <span class="n">choice</span><span class="p">)</span>
+<p>By default, FOP continues processing even if an image wasn't found. If you have more strict requirements and want FOP to stop if an image is not available, you can do something like the following in the simplest case:</p>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">class</span> <span class="n">MyEventListener</span> <span class="n">implements</span> <span class="n">EventListener</span> <span class="p">{</span>
+
+    <span class="n">public</span> <span class="n">void</span> <span class="n">processEvent</span><span class="p">(</span><span class="n">Event</span> <span class="n">event</span><span class="p">)</span> <span class="p">{</span>
+        <span class="k">if</span> <span class="p">(</span><span class="s">&quot;org.apache.fop.ResourceEventProducer&quot;</span><span class="o">.</span><span class="n">equals</span><span class="p">(</span>
+                <span class="n">event</span><span class="o">.</span><span class="n">getEventGroupID</span><span class="p">()))</span> <span class="p">{</span>
+            <span class="n">event</span><span class="o">.</span><span class="n">setSeverity</span><span class="p">(</span><span class="n">EventSeverity</span><span class="o">.</span><span class="n">FATAL</span><span class="p">);</span>
+        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+            <span class="sr">//ig</span><span class="n">nore</span> <span class="n">all</span> <span class="n">other</span> <span class="n">events</span> <span class="p">(</span><span class="ow">or</span> <span class="k">do</span> <span class="n">something</span> <span class="n">of</span> <span class="n">your</span> <span class="n">choice</span><span class="p">)</span>
+        <span class="p">}</span>
     <span class="p">}</span>
+
 <span class="p">}</span>
 </pre></div>
 
 
-<p>}
-Increasing the event severity to FATAL will signal the event broadcaster to throw an exception and stop further processing. In the above case, all resource-related events will cause FOP to stop processing.</p>
-<p>You can also customize the exception to throw (you can may throw a RuntimeException or subclass yourself) and/or which event to respond to:
-public class MyEventListener implements EventListener {</p>
-<div class="codehilite"><pre><span class="n">public</span> <span class="n">void</span> <span class="n">processEvent</span><span class="p">(</span><span class="n">Event</span> <span class="n">event</span><span class="p">)</span> <span class="p">{</span>
-    <span class="k">if</span> <span class="p">(</span><span class="s">&quot;org.apache.fop.ResourceEventProducer.imageNotFound&quot;</span>
-            <span class="o">.</span><span class="n">equals</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">getEventID</span><span class="p">()))</span> <span class="p">{</span>
-
-        <span class="sr">//</span><span class="n">Get</span> <span class="n">the</span> <span class="n">FileNotFoundException</span> <span class="n">that</span><span class="s">&#39;s part of the event&#39;</span><span class="n">s</span> <span class="n">parameters</span>
-        <span class="n">FileNotFoundException</span> <span class="n">fnfe</span> <span class="o">=</span> <span class="p">(</span><span class="n">FileNotFoundException</span><span class="p">)</span><span class="n">event</span><span class="o">.</span><span class="n">getParam</span><span class="p">(</span><span class="s">&quot;fnfe&quot;</span><span class="p">);</span>
-
-        <span class="n">throw</span> <span class="k">new</span> <span class="n">RuntimeException</span><span class="p">(</span><span class="n">EventFormatter</span><span class="o">.</span><span class="nb">format</span><span class="p">(</span><span class="n">event</span><span class="p">),</span> <span class="n">fnfe</span><span class="p">);</span>
-    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
-        <span class="sr">//ig</span><span class="n">nore</span> <span class="n">all</span> <span class="n">other</span> <span class="n">events</span> <span class="p">(</span><span class="ow">or</span> <span class="k">do</span> <span class="n">something</span> <span class="n">of</span> <span class="n">your</span> <span class="n">choice</span><span class="p">)</span>
+<p>Increasing the event severity to FATAL will signal the event broadcaster to throw an exception and stop further processing. In the above case, all resource-related events will cause FOP to stop processing.</p>
+<p>You can also customize the exception to throw (you can may throw a RuntimeException or subclass yourself) and/or which event to respond to:</p>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">class</span> <span class="n">MyEventListener</span> <span class="n">implements</span> <span class="n">EventListener</span> <span class="p">{</span>
+
+    <span class="n">public</span> <span class="n">void</span> <span class="n">processEvent</span><span class="p">(</span><span class="n">Event</span> <span class="n">event</span><span class="p">)</span> <span class="p">{</span>
+        <span class="k">if</span> <span class="p">(</span><span class="s">&quot;org.apache.fop.ResourceEventProducer.imageNotFound&quot;</span>
+                <span class="o">.</span><span class="n">equals</span><span class="p">(</span><span class="n">event</span><span class="o">.</span><span class="n">getEventID</span><span class="p">()))</span> <span class="p">{</span>
+
+            <span class="sr">//</span><span class="n">Get</span> <span class="n">the</span> <span class="n">FileNotFoundException</span> <span class="n">that</span><span class="s">&#39;s part of the event&#39;</span><span class="n">s</span> <span class="n">parameters</span>
+            <span class="n">FileNotFoundException</span> <span class="n">fnfe</span> <span class="o">=</span> <span class="p">(</span><span class="n">FileNotFoundException</span><span class="p">)</span><span class="n">event</span><span class="o">.</span><span class="n">getParam</span><span class="p">(</span><span class="s">&quot;fnfe&quot;</span><span class="p">);</span>
+
+            <span class="n">throw</span> <span class="k">new</span> <span class="n">RuntimeException</span><span class="p">(</span><span class="n">EventFormatter</span><span class="o">.</span><span class="nb">format</span><span class="p">(</span><span class="n">event</span><span class="p">),</span> <span class="n">fnfe</span><span class="p">);</span>
+        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
+            <span class="sr">//ig</span><span class="n">nore</span> <span class="n">all</span> <span class="n">other</span> <span class="n">events</span> <span class="p">(</span><span class="ow">or</span> <span class="k">do</span> <span class="n">something</span> <span class="n">of</span> <span class="n">your</span> <span class="n">choice</span><span class="p">)</span>
+        <span class="p">}</span>
     <span class="p">}</span>
+
 <span class="p">}</span>
 </pre></div>
 
 
-<p>}
-This throws a <code>RuntimeException</code> with the <code>FileNotFoundException</code> as the cause. Further processing effectively stops in FOP. You can catch the exception in your code and react as you see necessary.</p>
-<h2 id="the-producer-side-for-fop-developers-wzxhzdk16wzxhzdk17">The producer side (for FOP developers) <a id="producer"></a></h2>
+<p>This throws a <code>RuntimeException</code> with the <code>FileNotFoundException</code> as the cause. Further processing effectively stops in FOP. You can catch the exception in your code and react as you see necessary.</p>
+<h2 id="the-producer-side-for-fop-developers-wzxhzdk20wzxhzdk21">The producer side (for FOP developers) <a id="producer"></a></h2>
 <p>This section is primarily for FOP and FOP plug-in developers. It describes how to use the event subsystem for producing events.
-The event package has been designed in order to be theoretically useful for use cases outside FOP. If you think this is interesting independently from FOP, please talk to <a href="mailto:fop-dev@xmlgraphics.apache.org">us</a> .</p>
-<h2 id="producing-and-sending-an-event-wzxhzdk18wzxhzdk19">Producing and sending an event <a id="basic-event-production"></a></h2>
-<p>The basics are very simple. Just instantiate an <code>Event</code> object and fill it with the necessary parameters. Then pass it to the <code>EventBroadcaster</code> which distributes the events to the interested listeneners. Here's a code example:
-Event ev = new Event(this, "complain", EventSeverity.WARN,
-        Event.paramsBuilder()
-            .param("reason", "I'm tired")
-            .param("blah", new Integer(23))
-            .build());
-EventBroadcaster broadcaster = [get it from somewhere];
-broadcaster.broadcastEvent(ev);</p>
+The event package has been designed in order to be theoretically useful for use cases outside FOP. If you think this is interesting independently from FOP, please talk to <a href="mailto:fop-dev@xmlgraphics.apache.org">us</a>.</p>
+<h3 id="producing-and-sending-an-event-wzxhzdk22wzxhzdk23">Producing and sending an event <a id="basic-event-production"></a></h3>
+<p>The basics are very simple. Just instantiate an <code>Event</code> object and fill it with the necessary parameters. Then pass it to the <code>EventBroadcaster</code> which distributes the events to the interested listeneners. Here's a code example:</p>
+<div class="codehilite"><pre><span class="n">Event</span> <span class="n">ev</span> <span class="o">=</span> <span class="k">new</span> <span class="n">Event</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="s">&quot;complain&quot;</span><span class="p">,</span> <span class="n">EventSeverity</span><span class="o">.</span><span class="n">WARN</span><span class="p">,</span>
+        <span class="n">Event</span><span class="o">.</span><span class="n">paramsBuilder</span><span class="p">()</span>
+            <span class="o">.</span><span class="n">param</span><span class="p">(</span><span class="s">&quot;reason&quot;</span><span class="p">,</span> <span class="s">&quot;I&#39;m tired&quot;</span><span class="p">)</span>
+            <span class="o">.</span><span class="n">param</span><span class="p">(</span><span class="s">&quot;blah&quot;</span><span class="p">,</span> <span class="k">new</span> <span class="n">Integer</span><span class="p">(</span><span class="mi">23</span><span class="p">))</span>
+            <span class="o">.</span><span class="n">build</span><span class="p">());</span>
+<span class="n">EventBroadcaster</span> <span class="n">broadcaster</span> <span class="o">=</span> <span class="p">[</span><span class="n">get</span> <span class="n">it</span> <span class="n">from</span> <span class="n">somewhere</span><span class="p">];</span>
+<span class="n">broadcaster</span><span class="o">.</span><span class="n">broadcastEvent</span><span class="p">(</span><span class="n">ev</span><span class="p">);</span>
+</pre></div>
+
+
 <p>The <code>Event.paramsBuilder()</code> is a <a href="http://en.wikipedia.org/wiki/Fluent_interface">fluent interface</a> to help with the build-up of the parameters. You could just as well instantiate a <code>Map</code> ( <code>Map&lt;String, Object&gt;</code> ) and fill it with values.</p>
-<h3 id="the-eventproducer-interface-wzxhzdk20wzxhzdk21">The EventProducer interface <a id="event-producer"></a></h3>
+<h3 id="the-eventproducer-interface-wzxhzdk24wzxhzdk25">The EventProducer interface <a id="event-producer"></a></h3>
 <p>To simplify event production, the event subsystem provides the <code>EventProducer</code> interface. You can create interfaces which extend <code>EventProducer</code> . These interfaces will contain one method per event to be generated. By contract, each event method must have as its first parameter a parameter named "source" (Type Object) which indicates the object that generated the event. After that come an arbitrary number of parameters of any type as needed by the event.</p>
 <p>The event producer interface does not need to have any implementation. The implementation is produced at runtime by a dynamic proxy created by <code>DefaultEventBroadcaster</code> . The dynamic proxy creates <code>Event</code> instances for each method call against the event producer interface. Each parameter (except "source") is added to the event's parameter map.</p>
 <p>To simplify the code needed to get an instance of the event producer interface it is suggested to create a public inner provider class inside the interface.</p>
-<p>Here's an example of such an event producer interface:
-public interface MyEventProducer extends EventProducer {</p>
-<div class="codehilite"><pre><span class="n">public</span> <span class="n">class</span> <span class="n">Provider</span> <span class="p">{</span>
+<p>Here's an example of such an event producer interface:</p>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">interface</span> <span class="n">MyEventProducer</span> <span class="n">extends</span> <span class="n">EventProducer</span> <span class="p">{</span>
 
-    <span class="n">public</span> <span class="n">static</span> <span class="n">MyEventProducer</span> <span class="n">get</span><span class="p">(</span><span class="n">EventBroadcaster</span> <span class="n">broadcaster</span><span class="p">)</span> <span class="p">{</span>
-        <span class="k">return</span> <span class="p">(</span><span class="n">MyEventProducer</span><span class="p">)</span><span class="n">broadcaster</span><span class="o">.</span><span class="n">getEventProducerFor</span><span class="p">(</span><span class="n">MyEventProducer</span><span class="o">.</span><span class="n">class</span><span class="p">);</span>
+    <span class="n">public</span> <span class="n">class</span> <span class="n">Provider</span> <span class="p">{</span>
+
+        <span class="n">public</span> <span class="n">static</span> <span class="n">MyEventProducer</span> <span class="n">get</span><span class="p">(</span><span class="n">EventBroadcaster</span> <span class="n">broadcaster</span><span class="p">)</span> <span class="p">{</span>
+            <span class="k">return</span> <span class="p">(</span><span class="n">MyEventProducer</span><span class="p">)</span><span class="n">broadcaster</span><span class="o">.</span><span class="n">getEventProducerFor</span><span class="p">(</span><span class="n">MyEventProducer</span><span class="o">.</span><span class="n">class</span><span class="p">);</span>
+        <span class="p">}</span>
     <span class="p">}</span>
+
+    <span class="o">/**</span>
+     <span class="o">*</span> <span class="n">Complain</span> <span class="n">about</span> <span class="n">something</span><span class="o">.</span>
+     <span class="o">*</span> <span class="nv">@param</span> <span class="n">source</span> <span class="n">the</span> <span class="n">event</span> <span class="n">source</span>
+     <span class="o">*</span> <span class="nv">@param</span> <span class="n">reason</span> <span class="n">the</span> <span class="n">reason</span> <span class="k">for</span> <span class="n">the</span> <span class="n">complaint</span>
+     <span class="o">*</span> <span class="nv">@param</span> <span class="n">blah</span> <span class="n">the</span> <span class="n">complaint</span>
+     <span class="o">*</span> <span class="nv">@event</span><span class="o">.</span><span class="n">severity</span> <span class="n">WARN</span>
+     <span class="o">*/</span>
+    <span class="n">void</span> <span class="n">complain</span><span class="p">(</span><span class="n">Object</span> <span class="n">source</span><span class="p">,</span> <span class="n">String</span> <span class="n">reason</span><span class="p">,</span> <span class="nb">int</span> <span class="n">blah</span><span class="p">);</span>
+
 <span class="p">}</span>
+</pre></div>
 
-<span class="o">/**</span>
- <span class="o">*</span> <span class="n">Complain</span> <span class="n">about</span> <span class="n">something</span><span class="o">.</span>
- <span class="o">*</span> <span class="nv">@param</span> <span class="n">source</span> <span class="n">the</span> <span class="n">event</span> <span class="n">source</span>
- <span class="o">*</span> <span class="nv">@param</span> <span class="n">reason</span> <span class="n">the</span> <span class="n">reason</span> <span class="k">for</span> <span class="n">the</span> <span class="n">complaint</span>
- <span class="o">*</span> <span class="nv">@param</span> <span class="n">blah</span> <span class="n">the</span> <span class="n">complaint</span>
- <span class="o">*</span> <span class="nv">@event</span><span class="o">.</span><span class="n">severity</span> <span class="n">WARN</span>
- <span class="o">*/</span>
-<span class="n">void</span> <span class="n">complain</span><span class="p">(</span><span class="n">Object</span> <span class="n">source</span><span class="p">,</span> <span class="n">String</span> <span class="n">reason</span><span class="p">,</span> <span class="nb">int</span> <span class="n">blah</span><span class="p">);</span>
+
+<p>To produce the same event as in the first example above, you'd use the following code:</p>
+<div class="codehilite"><pre><span class="n">EventBroadcaster</span> <span class="n">broadcaster</span> <span class="o">=</span> <span class="p">[</span><span class="n">get</span> <span class="n">it</span> <span class="n">from</span> <span class="n">somewhere</span><span class="p">];</span>
+<span class="n">TestEventProducer</span> <span class="n">producer</span> <span class="o">=</span> <span class="n">TestEventProducer</span><span class="o">.</span><span class="n">Provider</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="n">broadcaster</span><span class="p">);</span>
+<span class="n">producer</span><span class="o">.</span><span class="n">complain</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="s">&quot;I&#39;m tired&quot;</span><span class="p">,</span> <span class="mi">23</span><span class="p">);</span>
 </pre></div>
 
 
-<p>}
-To produce the same event as in the first example above, you'd use the following code:
-EventBroadcaster broadcaster = [get it from somewhere];
-TestEventProducer producer = TestEventProducer.Provider.get(broadcaster);
-producer.complain(this, "I'm tired", 23);</p>
-<h2 id="the-event-model-wzxhzdk22wzxhzdk23">The event model <a id="event-model"></a></h2>
+<h3 id="the-event-model-wzxhzdk26wzxhzdk27">The event model <a id="event-model"></a></h3>
 <p>Inside an invocation handler for a dynamic proxy, there's no information about the names of each parameter. The JVM doesn't provide it. The only thing you know is the interface and method name. In order to properly fill the <code>Event</code> 's parameter map we need to know the parameter names. These are retrieved from an event object model. This is found in the <code>org.apache.fop.events.model</code> package. The data for the object model is retrieved from an XML representation of the event model that is loaded as a resource. The XML representation is generated using an Ant task at build time ( <code>ant resourcegen</code> ). The Ant task (found in <code>src/codegen/java/org/apache/fop/tools/EventProducerCollectorTask.java</code> ) scans FOP's sources for descendants of the <code>EventProducer</code> interface and uses <a href="http://qdox.codehaus.org/">QDox</a> to parse these interfaces.</p>
 <p>The event model XML files are generated during build by the Ant task mentioned above when running the "resourcegen" task. So just run <code>"ant resourcegen"</code> if you receive a <code>MissingResourceException</code> at runtime indicating that <code>"event-model.xml"</code> is missing.</p>
 <p>Primarily, the QDox-based collector task records the parameters' names and types. Furthermore, it extracts additional attributes embedded as Javadoc comments from the methods. At the moment, the only such attribute is "@event.severity" which indicates the default event severity (which can be changed by event listeners). The example event producer above shows the Javadocs for an event method.</p>
 <p>There's one more information that is extracted from the event producer information for the event model: an optional primary exception. The first exception in the "throws" declaration of an event method is noted. It is used to throw an exception from the invocation handler if the event has an event severity of "FATAL" when all listeners have been called (listeners can update the event severity). Please note that an implementation of <code>org.apache.fop.events.EventExceptionManager$ExceptionFactory</code> has to be registered for the <code>EventExceptionManager</code> to be able to construct the exception from an event.</p>
 <p>For a given application, there can be multiple event models active at the same time. In FOP, each renderer is considered to be a plug-in and provides its own specific event model. The individual event models are provided through an <code>EventModelFactory</code> . This interface is implemented for each event model and registered through the service provider mechanism (see the <a href="#plug-ins">plug-ins section</a> for details).</p>
-<h3 id="event-severity-wzxhzdk24wzxhzdk25">Event severity <a id="event-severity"></a></h3>
+<h3 id="event-severity-wzxhzdk28wzxhzdk29">Event severity <a id="event-severity"></a></h3>
 <p>Four different levels of severity for events has been defined:</p>
 <ol>
 <li>
@@ -501,32 +518,35 @@ producer.complain(this, "I'm tired", 23)
 </li>
 </ol>
 <p>Event listeners can choose to ignore certain events based on their event severity. Please note that you may recieve an event "twice" in a specific case: if there is a fatal error an event is generated and sent to the listeners. After that an exception is thrown with the same information and processing stops. If the fatal event is shown to the user and the following exception is equally presented to the user it may appear that the event is duplicated. Of course, the same information is just published through two different channels.</p>
-<h3 id="plug-ins-to-the-event-subsystem-wzxhzdk26wzxhzdk27">Plug-ins to the event subsystem <a id="plug-ins"></a></h3>
+<h3 id="plug-ins-to-the-event-subsystem-wzxhzdk30wzxhzdk31">Plug-ins to the event subsystem <a id="plug-ins"></a></h3>
 <p>The event subsystem is extensible. There are a number of extension points:</p>
 <ul>
 <li>
-<p><strong> <code>org.apache.fop.events.model.EventModelFactory</code> :</strong> Provides an event model to the event subsystem.</p>
+<p><strong><code>org.apache.fop.events.model.EventModelFactory</code>:</strong> Provides an event model to the event subsystem.</p>
 </li>
 <li>
-<p><strong> <code>org.apache.fop.events.EventExceptionManager$ExceptionFactory</code> :</strong> Creates exceptions for events, i.e. turns an event into a specific exception.</p>
+<p><strong><code>org.apache.fop.events.EventExceptionManager$ExceptionFactory</code>:</strong> Creates exceptions for events, i.e. turns an event into a specific exception.</p>
 </li>
 </ul>
 <p>The names in bold above are used as filenames for the service provider files that are placed in the <code>META-INF/services</code> directory. That way, they are automatically detected. This is a mechanism defined by the <a href="http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Service%20Provider">JAR file specification</a> .</p>
-<h3 id="localization-l10n-wzxhzdk28wzxhzdk29">Localization (L10n) <a id="l10n"></a></h3>
+<h3 id="localization-l10n-wzxhzdk32wzxhzdk33">Localization (L10n) <a id="l10n"></a></h3>
 <p>One goal of the event subsystem was to have localized (translated) event messages. The <code>EventFormatter</code> class can be used to convert an event to a human-readable message. Each <code>EventProducer</code> can provide its own XML-based translation file. If there is none, a central translation file is used, called "EventFormatter.xml" (found in the same directory as the <code>EventFormatter</code> class).</p>
-<p>The XML format used by the <code>EventFormatter</code> is the same as <a href="http://cocoon.apache.org/">Apache Cocoon's</a> catalog format. Here's an example:
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-<catalogue xml:lang="en">
-  <message key="locator">
+<p>The XML format used by the <code>EventFormatter</code> is the same as <a href="http://cocoon.apache.org/">Apache Cocoon's</a> catalog format. Here's an example:</p>
+<div class="codehilite"><pre><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
+<span class="nt">&lt;catalogue</span> <span class="na">xml:lang=</span><span class="s">&quot;en&quot;</span><span class="nt">&gt;</span>
+  <span class="nt">&lt;message</span> <span class="na">key=</span><span class="s">&quot;locator&quot;</span><span class="nt">&gt;</span>
     [ (See position {loc})| (See {#gatherContextInfo})| (No context info available)]
-  </message>
-  <message key="org.apache.fop.render.rtf.RTFEventProducer.explicitTableColumnsRequired">
+  <span class="nt">&lt;/message&gt;</span>
+  <span class="nt">&lt;message</span> <span class="na">key=</span><span class="s">&quot;org.apache.fop.render.rtf.RTFEventProducer.explicitTableColumnsRequired&quot;</span><span class="nt">&gt;</span>
     RTF output requires that all table-columns for a table are defined. Output will be incorrect.{{locator}}
-  </message>
-  <message key="org.apache.fop.render.rtf.RTFEventProducer.ignoredDeferredEvent">
+  <span class="nt">&lt;/message&gt;</span>
+  <span class="nt">&lt;message</span> <span class="na">key=</span><span class="s">&quot;org.apache.fop.render.rtf.RTFEventProducer.ignoredDeferredEvent&quot;</span><span class="nt">&gt;</span>
     Ignored deferred event for {node} ({start,if,start,end}).{{locator}}
-  </message>
-</catalogue></p>
+  <span class="nt">&lt;/message&gt;</span>
+<span class="nt">&lt;/catalogue&gt;</span>
+</pre></div>
+
+
 <p>The example (extracted from the RTF handler's event producer) has message templates for two event methods. The class used to do variable replacement in the templates is <code>org.apache.fop.util.text.AdvancedMessageFormat</code> which is more powerful than the <code>MessageFormat</code> classes provided by the Java class library ( <code>java.util.text</code> package).</p>
 <p>"locator" is a template that is reused by the other message templates by referencing it through "{{locator}}". This is some kind of include command.</p>
 <p>Normal event parameters are accessed by name inside single curly braces, for example: "{node}". For objects, this format just uses the <code>toString()</code> method to turn the object into a string, unless there is an <code>ObjectFormatter</code> registered for that type (there's an example for <code>org.xml.sax.Locator</code> ).</p>

Modified: websites/staging/xmlgraphics/trunk/content/fop/1.0/extensions.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/1.0/extensions.html (original)
+++ websites/staging/xmlgraphics/trunk/content/fop/1.0/extensions.html Mon Dec  3 15:47:41 2012
@@ -341,37 +341,44 @@ $(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/1.0/">1.0</a></div> -->
-      	<div class="section-content"><h1 id="standard-apachewzxhzdk1-fop-extensions">Standard Apache&trade; FOP Extensions</h1>
+      	<div class="section-content"><h1 id="standard-apachewzxhzdk3-fop-extensions">Standard Apache&trade; FOP Extensions</h1>
 <p>By "extension", we mean any data that can be placed in the input XML document that is not addressed by the XSL-FO standard. By having a mechanism for supporting extensions, Apache&trade; FOP is able to add features that are not covered in the specification.</p>
-<p>The extensions documented here are included with FOP, and are automatically available to you. If you wish to add an extension of your own to FOP, please see the <a href="../dev/extensions.html">Developers' Extension Page</a> .
+<p>The extensions documented here are included with FOP, and are automatically available to you. If you wish to add an extension of your own to FOP, please see the <a href="../dev/extensions.html">Developers' Extension Page</a>.
 All extensions require the correct use of an appropriate namespace in your input document.</p>
-<h1 id="svg-wzxhzdk3wzxhzdk4">SVG <a id="svg"></a></h1>
+<h2 id="svg-wzxhzdk5wzxhzdk6">SVG <a id="svg"></a></h2>
 <p>Please see the <a href="graphics.html#svg">SVG documentation</a> for more details.</p>
-<h2 id="fo-extensions-wzxhzdk5wzxhzdk6">FO Extensions <a id="fo-extensions"></a></h2>
-<h3 id="namespace-wzxhzdk7wzxhzdk8">Namespace <a id="fox-namespace"></a></h3>
+<h2 id="fo-extensions-wzxhzdk7wzxhzdk8">FO Extensions <a id="fo-extensions"></a></h2>
+<h3 id="namespace-wzxhzdk9wzxhzdk10">Namespace <a id="fox-namespace"></a></h3>
 <p>By convention, FO extensions in FOP use the "fox" namespace prefix. To use any of the FO extensions, add a namespace entry for <code>http://xmlgraphics.apache.org/fop/extensions</code> to the root element:</p>
 <div class="codehilite"><pre><span class="o">&lt;</span><span class="n">fo:root</span> <span class="n">xmlns:fo</span><span class="o">=</span><span class="s">&quot;http://www.w3.org/1999/XSL/Format&quot;</span>
-           <span class="n">xmlns:fox</span><span class="o">=</span><span class="s">&quot;http://xmlgraphics.apache.org/fop/extensions&quot;</span><span class="o">&gt;</span>
+         <span class="n">xmlns:fox</span><span class="o">=</span><span class="s">&quot;http://xmlgraphics.apache.org/fop/extensions&quot;</span><span class="o">&gt;</span>
 </pre></div>
 
 
-<h2 id="pdf-bookmarks-wzxhzdk9wzxhzdk10">PDF Bookmarks <a id="bookmarks"></a></h2>
+<h3 id="pdf-bookmarks-wzxhzdk11wzxhzdk12">PDF Bookmarks <a id="bookmarks"></a></h3>
 <p>In previous versions of Apache FOP there was a <code>fox:outline</code> element which was used to create outlines in PDF files. The redesigned code makes use of the new <a href="http://www.w3.org/TR/xsl11/#fo_bookmark-tree">bookmark feature defined in the latest XSL 1.1 working draft</a> .</p>
-<h3 id="anchors-or-named-destinations-wzxhzdk11wzxhzdk12">Anchors or Named Destinations <a id="named-destinations"></a></h3>
-<p>Use the fox:destination element to define "named destinations" inside a PDF document. These are useful as fragment identifiers, e.g. "http://server/document.pdf#anchor-name". fox:destination elements can be placed almost anywhere in the fo document, including a child of root, a block-level element, or an inline-level element. For the destination to actually work, it must correspond to an "id" attribute on some fo element within the document. In other words, the "id" attribute actually creates the "view" within the PDF document. The fox:destination simply gives that view an independent name.
-    <fox:destination internal-destination="table-of-contents"/>
-    ...
-    <fo:block id="table-of-contents">Table of Contents</fo:block><warning>It is possible that in some future release of FOP, <em>all</em> elements with "id" attributes will generate named-destinations, which will eliminate the need for fox:destination.</warning></p>
-<h2 id="table-continuation-label-wzxhzdk18wzxhzdk19">Table Continuation Label <a id="table-continue-label"></a></h2>
+<h3 id="anchors-or-named-destinations-wzxhzdk13wzxhzdk14">Anchors or Named Destinations <a id="named-destinations"></a></h3>
+<p>Use the fox:destination element to define "named destinations" inside a PDF document. These are useful as fragment identifiers, e.g. "http://server/document.pdf#anchor-name". fox:destination elements can be placed almost anywhere in the fo document, including a child of root, a block-level element, or an inline-level element. For the destination to actually work, it must correspond to an "id" attribute on some fo element within the document. In other words, the "id" attribute actually creates the "view" within the PDF document. The fox:destination simply gives that view an independent name.</p>
+<div class="codehilite"><pre><span class="nt">&lt;fox:destination</span> <span class="na">internal-destination=</span><span class="s">&quot;table-of-contents&quot;</span><span class="nt">/&gt;</span>
+...
+<span class="nt">&lt;fo:block</span> <span class="na">id=</span><span class="s">&quot;table-of-contents&quot;</span><span class="nt">&gt;</span>Table of Contents<span class="nt">&lt;/fo:block&gt;</span>
+</pre></div>
+
+
+<p><warning>It is possible that in some future release of FOP, <em>all</em> elements with "id" attributes will generate named-destinations, which will eliminate the need for fox:destination.</warning></p>
+<h3 id="table-continuation-label-wzxhzdk17wzxhzdk18">Table Continuation Label <a id="table-continue-label"></a></h3>
 <p>This extension element hasn't been reimplemented for the redesigned code, yet.</p>
-<h3 id="foxorphan-content-limit-and-foxwidow-content-limit-wzxhzdk20wzxhzdk21">fox:orphan-content-limit and fox:widow-content-limit <a id="widow-orphan-content-limit"></a></h3>
-<p>The two proprietary extension properties, fox:orphan-content-limit and fox:widow-content-limit, are used to improve the layout of list-blocks and tables. If you have a table with many entries, you don't want a single row to be left over on a page. You will want to make sure that at least two or three lines are kept together. The properties take an absolute length which specifies the area at the beginning (fox:widow-content-limit) or at the end (fox:orphan-content-limit) of a table or list-block. The properties are inherited and only have an effect on fo:table and fo:list-block. An example: fox:widow-content-limit="3 * 1.2em" would make sure the you'll have at least three lines (assuming line-height="1.2") together on a table or list-block.</p>
-<h3 id="foxexternal-document-wzxhzdk22wzxhzdk23">fox:external-document <a id="external-document"></a></h3>
-<p>This feature is incomplete. Support for multi-page documents will be added shortly. At the moment, only single-page images will work. And this will not work with RTF output.
-This is a proprietary extension element which allows to add whole images as pages to an FO document. For example, if you have a scanned document or a fax as multi-page TIFF file, you can append or insert this document using the <code>fox:external-document</code> element. Each page of the external document will create one full page in the target format.</p>
+<h3 id="foxorphan-content-limit-and-foxwidow-content-limit-wzxhzdk19wzxhzdk20">fox:orphan-content-limit and fox:widow-content-limit <a id="widow-orphan-content-limit"></a></h3>
+<p>The two proprietary extension properties, <code>fox:orphan-content-limit</code> and <code>fox:widow-content-limit</code>, are used to improve the layout of list-blocks and tables. If you have a table with many entries, you don't want a single row to be left over on a page. You will want to make sure that at least two or three lines are kept together. The properties take an absolute length which specifies the area at the beginning (<code>fox:widow-content-limit</code>) or at the end (<code>fox:orphan-content-limit</code>) of a table or list-block. The properties are inherited and only have an effect on <code>fo:table</code> and <code>fo:list-block</code>. An example: <code>fox:widow-content-limit="3 * 1.2em"</code> would make sure the you'll have at least three lines (assuming <code>line-height="1.2"</code>) together on a table or list-block.</p>
+<h3 id="foxexternal-document-wzxhzdk21wzxhzdk22">fox:external-document <a id="external-document"></a></h3>
+<p>This feature is incomplete. Support for multi-page documents will be added shortly. At the moment, only single-page images will work. And this will not work with RTF output.</p>
+<p>This is a proprietary extension element which allows to add whole images as pages to an FO document. For example, if you have a scanned document or a fax as multi-page TIFF file, you can append or insert this document using the <code>fox:external-document</code> element. Each page of the external document will create one full page in the target format.</p>
 <p>The <code>fox:external-document</code> element is structurally a peer to <code>fo:page-sequence</code> , so wherever you can put an <code>fo:page-sequence</code> you could also place a <code>fox:external-document</code> . Therefore, the specified contents for <code>fo:root</code> change to:</p>
-<p><code>(layout-master-set, declarations?, bookmark-tree?, (page-sequence|page-sequence-wrapper|fox:external-document|fox:destination)+)</code> </p>
-<h4 id="specification-wzxhzdk24wzxhzdk25">Specification ## <a id="Specification"></a></h4>
+<div class="codehilite"><pre><span class="p">(</span><span class="n">layout</span><span class="o">-</span><span class="n">master</span><span class="o">-</span><span class="n">set</span><span class="p">,</span> <span class="n">declarations</span><span class="p">?,</span> <span class="n">bookmark</span><span class="o">-</span><span class="n">tree</span><span class="p">?,</span> <span class="p">(</span><span class="n">page</span><span class="o">-</span><span class="n">sequence</span><span class="o">|</span><span class="n">page</span><span class="o">-</span><span class="n">sequence</span><span class="o">-</span><span class="n">wrapper</span><span class="o">|</span><span class="n">fox:external</span><span class="o">-</span><span class="n">document</span><span class="o">|</span><span class="n">fox:destination</span><span class="p">)</span><span class="o">+</span><span class="p">)</span>
+</pre></div>
+
+
+<h4 id="specificationwzxhzdk23wzxhzdk24">Specification<a id="Specification"></a></h4>
 <p>The <code>fox:external-document</code> extension formatting object is used to specify how to create a (sub-)sequence of pages within a document. The content of these pages comes from the individual subimages/pages of an image or paged document (for example: multi-page TIFF in the form of faxes or scanned documents, or PDF files). The formatting object creates the necessary areas to display one image per page.</p>
 <p>In terms of page numbers, the behaviour is the same as for <code>fo:page-sequence</code> . The placement of the image inside the page is similar to that of <code>fo:external-graphic</code> or <code>fo:instream-foreign-object</code> , i.e. the viewport (and therefore the page size) is defined by either the intrinsic size of the image or by the size properties that apply to this formatting object.</p>
 <p>Content: EMPTY</p>
@@ -434,16 +441,16 @@ This is a proprietary extension element 
 </ul>
 <p>Datatype "page-set": Value: auto | <integer-range>, Default: "auto" which means all pages/subimages of the document. <integer-range> allows values such as "7" or "1-3"
  <code>fox:external-document</code> is not suitable for concatenating FO documents. For this, XInclude is recommended.</p>
-<h2 id="free-form-transformation-for-foblock-container-wzxhzdk28wzxhzdk29">Free-form Transformation for fo:block-container <a id="transform"></a></h2>
+<h3 id="free-form-transformation-for-foblock-container-wzxhzdk27wzxhzdk28">Free-form Transformation for fo:block-container <a id="transform"></a></h3>
 <p>For <code>fo:block-container</code> elements whose <code>absolute-position</code> set to "absolute" or "fixed" you can use the extension attribute <code>fox:transform</code> to apply a free-form transformation to the whole block-container. The content of the <code>fox:transform</code> attribute is the same as for <a href="http://www.w3.org/TR/SVG/coords.html#TransformAttribute">SVG's transform attribute</a> . The transformation specified here is performed in addition to other implicit transformations of the block-container (resulting from top, left and other properties) and after them.</p>
 <p>Examples: <code>fox:transform="rotate(45)"</code> would rotate the block-container by 45 degrees clock-wise around its upper-left corner. <code>fox:transform="translate(10000,0)"</code> would move the block-container to the right by 10 points (=10000 millipoints, FOP uses millipoints internally!).
 This extension attribute doesn't work for all output formats! It's currently only supported for PDF, PS and Java2D-based renderers.</p>
-<h2 id="color-functions-wzxhzdk30wzxhzdk31">Color functions <a id="color-functions"></a></h2>
+<h3 id="color-functions-wzxhzdk29wzxhzdk30">Color functions <a id="color-functions"></a></h3>
 <p>XSL-FO supports specifying color using the rgb(), rgb-icc() and system-color() functions. Apache FOP provides additional color functions for special use cases. Please note that using these functions compromises the interoperability of an FO document.</p>
-<h4 id="cmyk-wzxhzdk32wzxhzdk33">cmyk() ## <a id="color-function-cmyk"></a></h4>
+<h4 id="cmykwzxhzdk31wzxhzdk32">cmyk()<a id="color-function-cmyk"></a></h4>
 <p><code>color cmyk(numeric, numeric, numeric, numeric)</code> </p>
 <p>This function will construct a color in device-specific CMYK color space. The numbers must be between 0.0 and 1.0. For output formats that don't support device-specific color space the CMYK value is converted to an sRGB value.</p>
-<h4 id="cmyk-pseudo-profile-wzxhzdk34wzxhzdk35">#CMYK pseudo-profile ## <a id="pseudo-color-profiles"></a></h4>
+<h4 id="cmyk-pseudo-profilewzxhzdk33wzxhzdk34">#CMYK pseudo-profile<a id="pseudo-color-profiles"></a></h4>
 <p><code>color rgb-icc(numeric, numeric, numeric, #CMYK, numeric, numeric, numeric, numeric)</code> </p>
 <p>The <code>rgb-icc</code> function will respond to a pseudo-profile called "#CMYK" which indicates a device-specific CMYK color space. The "#CMYK" profile is implicitely available and doesn't have to be (and cannot be) defined through an <code>fo:color-profile</code> element. It is provided for compatibility with certain commercial XSL-FO implementations. Please note that this is not part of the official specification but rather a convention. The following two color specifications are equivalent:</p>
 <ul>
@@ -454,27 +461,27 @@ This extension attribute doesn't work fo
 <p><code>rgb-icc(153, 153, 102, #CMYK, 0, 0, 0.2, 0.4)</code> </p>
 </li>
 </ul>
-<h3 id="prepress-support-wzxhzdk36wzxhzdk37">Prepress Support <a id="prepress"></a></h3>
+<h3 id="prepress-support-wzxhzdk35wzxhzdk36">Prepress Support <a id="prepress"></a></h3>
 <p>This section defines a number of extensions related to <a href="http://en.wikipedia.org/wiki/Prepress">prepress</a> support. <code>fox:scale</code> defines a general scale factor for the generated pages. <code>fox:bleed</code> defines the <a href="http://en.wikipedia.org/wiki/Bleed_%28printing%29">bleed area</a> for a page. <code>fox:crop-offset</code> defines the outer edges of the area in which crop marks, registration marks, color bars and page information are placed. For details, please read on below.
 Those extensions have been implemented in the PDF and Java2D renderers only.</p>
-<h3 id="foxscale-wzxhzdk38wzxhzdk39">fox:scale ## <a id="scale"></a></h3>
+<h4 id="foxscalewzxhzdk37wzxhzdk38">fox:scale<a id="scale"></a></h4>
 <p>Value: <number>{1,2}</p>
 <p>Initial: 1</p>
 <p>Applies to: fo:simple-page-master</p>
 <p>This property specifies a scale factor along resp. the x and y axes. If only one number is provided it is used for both the x and y scales. A scale factor smaller than 1 shrinks the page. A scale factor greater than 1 enlarges the page.</p>
-<h4 id="foxbleed-wzxhzdk41wzxhzdk42">fox:bleed ## <a id="bleed"></a></h4>
+<h4 id="foxbleedwzxhzdk40wzxhzdk41">fox:bleed<a id="bleed"></a></h4>
 <p>Value: <length>{1,4}</p>
 <p>Initial: 0pt</p>
 <p>Applies to: fo:simple-page-master</p>
 <p>If there is only one value, it applies to all sides. If there are two values, the top and bottom bleed widths are set to the first value and the right and left bleed widths are set to the second. If there are three values, the top is set to the first value, the left and right are set to the second, and the bottom is set to the third. If there are four values, they apply to the top, right, bottom, and left, respectively. (Corresponds to <a href="http://www.w3.org/TR/xsl11/#padding">the definition of padding</a> ).</p>
 <p>This extension indirectly defines the BleedBox and is calculated by expanding the TrimBox by the bleed widths. The lengths must be non-negative.</p>
-<h4 id="foxcrop-offset-wzxhzdk44wzxhzdk45">fox:crop-offset ## <a id="cropOffset"></a></h4>
+<h4 id="foxcrop-offsetwzxhzdk43wzxhzdk44">fox:crop-offset<a id="cropOffset"></a></h4>
 <p>Value: <length>{1,4}</p>
 <p>Initial: bleed (see below)</p>
 <p>Applies to: fo:simple-page-master</p>
 <p>Same behaviour as with fox:bleed. The initial value is set to the same values as the fox:bleed property.</p>
 <p>This extension indirectly defines the MediaBox and is calculated by expanding the TrimBox by the crop offsets. The lengths must be non-negative.</p>
-<h4 id="foxcrop-box-wzxhzdk47wzxhzdk48">fox:crop-box ## <a id="cropBox"></a></h4>
+<h4 id="foxcrop-boxwzxhzdk46wzxhzdk47">fox:crop-box<a id="cropBox"></a></h4>
 <p>Value: [trim-box | bleed-box | media-box]</p>
 <p>Initial: media-box</p>
 <p>Applies to: fo:simple-page-master</p>

Modified: websites/staging/xmlgraphics/trunk/content/fop/1.0/fonts.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/1.0/fonts.html (original)
+++ websites/staging/xmlgraphics/trunk/content/fop/1.0/fonts.html Mon Dec  3 15:47:41 2012
@@ -494,7 +494,7 @@ $(document).ready(function () {
 
 
 <p>Review the documentation for <a href="configuration.html">FOP Configuration</a> for instructions on making the FOP configuration available to FOP when it runs. Otherwise, FOP has no way of finding your custom font information. It is currently not possible to easily configure fonts from Java code.</p>
-<h1 id="advanced-font-configuration-wzxhzdk31wzxhzdk32">Advanced font configuration <a id="advanced"></a></h1>
+<h2 id="advanced-font-configuration-wzxhzdk31wzxhzdk32">Advanced font configuration <a id="advanced"></a></h2>
 <p>The instructions found above should be sufficient for most users. Below are some additional instructions in case the basic font configuration doesn't lead to the desired results.</p>
 <h3 id="type-1-font-metrics-wzxhzdk33wzxhzdk34">Type 1 Font Metrics <a id="type1-metrics"></a></h3>
 <p>FOP includes PFMReader, which reads the PFM file that normally comes with a Type 1 font, and generates an appropriate font metrics file for it. To use it, run the class org.apache.fop.fonts.apps.PFMReader:</p>
@@ -698,10 +698,10 @@ Manifest-Version: 1.0</p>
 </li>
 </ul>
 <h3 id="substitution-wzxhzdk43wzxhzdk44">Substitution <a id="substitution"></a></h3>
-<p>When a <substitutions/> section is defined in the configuration, FOP will re-map any font-family references found in your FO input to a given substitution font.</p>
+<p>When a <code>&lt;substitutions/&gt;</code> section is defined in the configuration, FOP will re-map any font-family references found in your FO input to a given substitution font.</p>
 <ul>
 <li>
-<p>If a <substitution/> is declared, it is mandatory that both a <from/> and <to/> child element is declared with a font-family attribute.</p>
+<p>If a <code>&lt;substitution/&gt;</code> is declared, it is mandatory that both a <from/> and <to/> child element is declared with a font-family attribute.</p>
 </li>
 <li>
 <p>Both font-weight and font-style are optional attributes, if they are provided then a value of 'normal' is assumed.</p>
@@ -725,7 +725,7 @@ Manifest-Version: 1.0</p>
 </pre></div>
 
 
-<h1 id="font-selection-strategies-wzxhzdk46wzxhzdk47">Font Selection Strategies <a id="selection"></a></h1>
+<h2 id="font-selection-strategies-wzxhzdk45wzxhzdk46">Font Selection Strategies <a id="selection"></a></h2>
 <p>There are two font selection strategies: character-by-character or auto. The default is auto.</p>
 <p>Auto selected the first font from the list which is able to display the most characters in a given word. This means (assume font A has characters for abclmn, font B for lnmxyz, fontlist is A,B):</p>
 <ul>
@@ -743,7 +743,7 @@ Manifest-Version: 1.0</p>
 </li>
 </ul>
 <p>Character-by-Character is NOT yet supported!</p>
-<h2 id="font-list-command-line-tool-wzxhzdk48wzxhzdk49">Font List Command-Line Tool <a id="font-list"></a></h2>
+<h2 id="font-list-command-line-tool-wzxhzdk47wzxhzdk48">Font List Command-Line Tool <a id="font-list"></a></h2>
 <p>FOP contains a small command-line tool that lets you generate a list of all configured fonts. Its class name is: <code>org.apache.fop.tools.fontlist.FontListMain</code> . Run it with the "-?" parameter to get help for the various options.</p></div>
       </div>
       

Modified: websites/staging/xmlgraphics/trunk/content/fop/1.0/graphics.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/1.0/graphics.html (original)
+++ websites/staging/xmlgraphics/trunk/content/fop/1.0/graphics.html Mon Dec  3 15:47:41 2012
@@ -363,64 +363,74 @@ $(document).ready(function () {
 <tr>
 <th>Format</th>
 <th>Type</th>
-<th>Support Through</th>
+<th align="center">Support Through <a href="#native">Apache FOP (native)</a></th>
+<th align="center">Support Through <a href="#batik">Apache Batik</a></th>
+<th align="center">Support Through <a href="#imageio">Image I/O</a></th>
 </tr>
 </thead>
 <tbody>
 <tr>
-<td><a href="#native">Apache FOP (native)</a></td>
-<td><a href="#batik">Apache Batik</a></td>
-<td><a href="#imageio">Image I/O</a></td>
-</tr>
-<tr>
-<td>---------------------</td>
-<td>--------------</td>
-<td>-----------</td>
-</tr>
-<tr>
 <td><a href="#bmp">BMP</a> (Microsoft Windows Bitmap)</td>
 <td>bitmap</td>
-<td></td>
+<td align="center"></td>
+<td align="center"></td>
+<td align="center">X [1]</td>
 </tr>
 <tr>
 <td><a href="#emf">EMF</a> (Windows Enhanced Metafile)</td>
 <td>vector (with embedded bitmaps)</td>
-<td>(X)</td>
+<td align="center">(X)</td>
+<td align="center"></td>
+<td align="center"></td>
 </tr>
 <tr>
 <td><a href="#eps">EPS</a> (Encapsulated PostScript)</td>
 <td>metafile (both bitmap and vector), most frequently used for vector drawings</td>
-<td>(X)</td>
+<td align="center">(X)</td>
+<td align="center"></td>
+<td align="center"></td>
 </tr>
 <tr>
 <td>GIF (Graphics Interchange Format)</td>
 <td>bitmap</td>
-<td></td>
+<td align="center"></td>
+<td align="center"></td>
+<td align="center">X</td>
 </tr>
 <tr>
 <td><a href="#jpeg">JPEG</a> (Joint Photographic Experts Group)</td>
 <td>bitmap</td>
-<td>(X)</td>
+<td align="center">(X)</td>
+<td align="center"></td>
+<td align="center">X</td>
 </tr>
 <tr>
 <td><a href="#png">PNG</a> (Portable Network Graphic)</td>
 <td>bitmap</td>
-<td></td>
+<td align="center"></td>
+<td align="center"></td>
+<td align="center">X</td>
 </tr>
 <tr>
 <td><a href="#svg">SVG</a> (Scalable Vector Graphics)</td>
 <td>vector (with embedded bitmaps)</td>
-<td></td>
+<td align="center"></td>
+<td align="center">X</td>
+<td align="center"></td>
 </tr>
 <tr>
 <td><a href="#tiff">TIFF</a> (Tag Image Format File)</td>
 <td>bitmap</td>
-<td>(X)</td>
+<td align="center">(X)</td>
+<td align="center"></td>
+<td align="center">X [1]</td>
 </tr>
 <tr>
 <td><a href="#wmf">WMF</a> (Windows Metafile)</td>
 <td>vector (with embedded bitmaps)</td>
-<td></td>
+<td align="center"></td>
+<td align="center">(X)</td>
+<td align="center"></td>
 </tr>
 </tbody>
 </table>
@@ -434,101 +444,101 @@ $(document).ready(function () {
  <a href="http://jai-imageio.dev.java.net/">JAI Image I/O Tools</a> is not the same as the <a href="http://java.sun.com/javase/technologies/desktop/media/jai/">JAI library</a> ! The former simply exposes JAI's codecs using the Image&nbsp;I/O API but does not include all the image manipulation functionality.</p>
 </li>
 </ul>
-<h2 id="map-of-supported-image-formats-by-output-format-wzxhzdk5wzxhzdk6">Map of supported image formats by output format <a id="format-map"></a></h2>
+<h3 id="map-of-supported-image-formats-by-output-format-wzxhzdk5wzxhzdk6">Map of supported image formats by output format <a id="format-map"></a></h3>
 <p>Not all image formats are supported for all output formats! For example, while you can use EPS (Encapsulated PostScript) files when you generate PostScript output, this format will not be supported by any other output format. Here's an overview of which image formats are supported by which output format:</p>
 <table>
 <thead>
 <tr>
 <th>Image Format</th>
-<th>PDF</th>
-<th>PostScript</th>
-<th>Java2D, PNG, TIFF, AWT</th>
-<th>PCL</th>
-<th>AFP</th>
-<th>RTF</th>
+<th align="center">PDF</th>
+<th align="center">PostScript</th>
+<th align="center">Java2D, PNG, TIFF, AWT</th>
+<th align="center">PCL</th>
+<th align="center">AFP</th>
+<th align="center">RTF</th>
 </tr>
 </thead>
 <tbody>
 <tr>
 <td><a href="#bmp">BMP</a> (Microsoft Windows Bitmap)</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
 </tr>
 <tr>
 <td><a href="#emf">EMF</a> (Windows Enhanced Metafile)</td>
-<td></td>
-<td></td>
-<td></td>
-<td></td>
-<td></td>
-<td>X [1]</td>
+<td align="center"></td>
+<td align="center"></td>
+<td align="center"></td>
+<td align="center"></td>
+<td align="center"></td>
+<td align="center">X [1]</td>
 </tr>
 <tr>
 <td><a href="#eps">EPS</a> (Encapsulated PostScript)</td>
-<td></td>
-<td>X [1]</td>
-<td></td>
-<td></td>
-<td></td>
-<td></td>
+<td align="center"></td>
+<td align="center">X [1]</td>
+<td align="center"></td>
+<td align="center"></td>
+<td align="center"></td>
+<td align="center"></td>
 </tr>
 <tr>
 <td>GIF (Graphics Interchange Format)</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
 </tr>
 <tr>
 <td><a href="#jpeg">JPEG</a> (Joint Photographic Experts Group)</td>
-<td>X [1]</td>
-<td>X [1]</td>
-<td>X</td>
-<td>X</td>
-<td>X [1]</td>
-<td>X</td>
+<td align="center">X [1]</td>
+<td align="center">X [1]</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X [1]</td>
+<td align="center">X</td>
 </tr>
 <tr>
 <td><a href="#png">PNG</a> (Portable Network Graphic)</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
 </tr>
 <tr>
 <td><a href="#svg">SVG</a> (Scalable Vector Graphics)</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
 </tr>
 <tr>
 <td><a href="#tiff">TIFF</a> (Tag Image Format File)</td>
-<td>X [2]</td>
-<td>X [2]</td>
-<td>X</td>
-<td>X</td>
-<td>X [2]</td>
-<td>X</td>
+<td align="center">X [2]</td>
+<td align="center">X [2]</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X [2]</td>
+<td align="center">X</td>
 </tr>
 <tr>
 <td><a href="#wmf">WMF</a> (Windows Metafile)</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
-<td>X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
+<td align="center">X</td>
 </tr>
 </tbody>
 </table>
@@ -580,24 +590,24 @@ Batik must be run in a graphical environ
 <h3 id="png-wzxhzdk33wzxhzdk34">PNG <a id="png"></a></h3>
 <p>PNG images are supported through an Image&nbsp;I/O codec. Transparency is supported but not guaranteed to work with every output format.</p>
 <h3 id="svg-wzxhzdk36wzxhzdk37">SVG <a id="svg"></a></h3>
-<h4 id="introduction-wzxhzdk38wzxhzdk39">Introduction ## <a id="svg-intro"></a></h4>
+<h4 id="introductionwzxhzdk38wzxhzdk39">Introduction<a id="svg-intro"></a></h4>
 <p>FOP uses <a href="#batik">Apache Batik</a> for SVG support. This format can be handled as an <code>fo:instream-foreign-object</code> or in a separate file referenced with <code>fo:external-graphic</code> .
 Batik's SVG Rasterizer utility may also be used to convert standalone SVG documents into PDF. For more information please see the <a href="http://xmlgraphics.apache.org/batik/svgrasterizer.html">SVG Rasterizer documentation</a> on the Batik site.</p>
-<h3 id="placing-svg-graphics-into-pdf-wzxhzdk40wzxhzdk41">Placing SVG Graphics into PDF ## <a id="svg-pdf-graphics"></a></h3>
+<h4 id="placing-svg-graphics-into-pdfwzxhzdk40wzxhzdk41">Placing SVG Graphics into PDF<a id="svg-pdf-graphics"></a></h4>
 <p>The SVG is rendered into PDF by using PDF commands to draw and fill lines and curves. This means that the graphical objects created with this remain as vector graphics. The same applies to PostScript output. For other output formats the SVG graphic may be converted to a bitmap image.</p>
 <p>There are a number of SVG things that cannot be converted directly into PDF. Parts of the graphic such as effects, patterns and images are inserted into the PDF as a raster graphic. The resolution of these raster images can be controlled through the "target resolution" setting in the <a href="configuration.html">configuration</a> .</p>
 <p>Currently transparency is limited in PDF so some SVG images that contain effects or graphics with transparent areas may not be displayed correctly.</p>
-<h4 id="placing-svg-text-into-pdf-and-postscript-wzxhzdk42wzxhzdk43">Placing SVG Text into PDF and PostScript ## <a id="svg-pdf-text"></a></h4>
+<h4 id="placing-svg-text-into-pdf-and-postscriptwzxhzdk42wzxhzdk43">Placing SVG Text into PDF and PostScript<a id="svg-pdf-text"></a></h4>
 <p>If possible, Batik will use normal PDF or PostScript text when inserting text. It does this by checking if the text can be drawn normally and the font is supported. This example svg <a href="../dev/svg/text.svg">text.svg</a> / <a href="../dev/svg/text.pdf">text.pdf</a> / <a href="../dev/svg/text.png">text.png</a> shows how various types and effects with text are handled. Note that SVG font support is not yet implemented. Furthermore, text handling in PostScript output is inferior to PDF output - more text will be painted as shapes in PS than in PDF.</p>
 <p>When there's no support to paint text using native text operations, text is converted and drawn as a set of shapes by Batik, using the stroking text painter. This means that a typical character will have about 10 curves (each curve consists of at least 20 characters). This can make the output files large and when it is viewed the viewer may not normally draw those fine curves very well (In Adobe Acrobat, turning on "Smooth Line Art" in the preferences will fix this). Copy/paste functionality will not be supported in this case. If the text is inserted into the output file using the inbuilt text commands it will use a single character.</p>
 <p>Note that because SVG text can be rendered as either text or a vector graphic, you may need to consider settings in your viewer for both. The Acrobat viewer has both "smooth line art" and "smooth text" settings that may need to be set for SVG images to be displayed nicely on your screen (see Edit / Preferences / Display). This setting will not affect the printing of your document, which should be OK in any case, but will only affect the quality of the screen display.</p>
-<h4 id="font-selection-notes-wzxhzdk44wzxhzdk45">Font selection notes ## <a id="svg-font-selection"></a></h4>
+<h4 id="font-selection-noteswzxhzdk44wzxhzdk45">Font selection notes<a id="svg-font-selection"></a></h4>
 <p>Apache Batik uses the AWT/Java2D subsystem as font source while FOP has its own font subsystem. Great care has been taken that font selection does the best possible choices. But it must be noted when creating PDF or PostScript that a font used in SVG graphics needs to be registered with the operating system as well as in FOP's configuration. By using FOP's font auto-detection, you simply have to install the font in the operating system and not care about anything else. This is less of an issue if you create formats like TIFFs, PNGs or PCL because in these cases SVG graphics are usually rendered to bitmaps which means that on both sides (Batik and FOP), AWT/Java2D is used as the single font source.</p>
 <p>Whenever an SVG is converted into a PDF or PostScript file, the font that has been used inside Batik has to be mapped to a font used by the actual output format. Features like font substitution in FOP may need to be taken into account but can also be an advantage when working around font mapping issues. Like for XSL-FO content, you'll get a warning if a particular font could not be found and had to be substituted, or if a particular glyph is missing in a font.</p>
-<h4 id="scaling-wzxhzdk46wzxhzdk47">Scaling ## <a id="svg-scaling"></a></h4>
+<h4 id="scalingwzxhzdk46wzxhzdk47">Scaling<a id="svg-scaling"></a></h4>
 <p>Currently, SVG images are rendered with the dimensions specified <em>in the SVG file</em> , within the viewport specified in the fo:external-graphic element. For everything to work properly, the two should be equal. The SVG standard leaves this issue as an implementation detail. Additional scaling options are available through XSL-FO means.</p>
 <p>If you use pixels to specify the size of an SVG graphic the "source resolution" setting in the <a href="configuration.html">configuration</a> will be used to determine the size of a pixel. The use of pixels to specify sizes is discouraged as they may be interpreted differently in different environments.</p>
-<h4 id="known-problems-wzxhzdk48wzxhzdk49">Known Problems ## <a id="svg-problems"></a></h4>
+<h4 id="known-problemswzxhzdk48wzxhzdk49">Known Problems<a id="svg-problems"></a></h4>
 <ul>
 <li>
 <p>Soft mask transparency is combined with white so that it looks better on PDF 1.3 viewers but this causes the soft mask to be slightly lighter or darker on PDF 1.4 viewers.</p>

Modified: websites/staging/xmlgraphics/trunk/content/fop/1.0/hyphenation.html
==============================================================================
--- websites/staging/xmlgraphics/trunk/content/fop/1.0/hyphenation.html (original)
+++ websites/staging/xmlgraphics/trunk/content/fop/1.0/hyphenation.html Mon Dec  3 15:47:41 2012
@@ -347,11 +347,11 @@ $(document).ready(function () {
 <p>Apache&trade; FOP uses Liang's hyphenation algorithm, well known from TeX. It needs language specific pattern and other data for operation.</p>
 <p>Because of <a href="#license-issues">licensing issues</a> (and for convenience), all hyphenation patterns for FOP are made available through the <a href="http://offo.sourceforge.net/hyphenation/index.html">Objects For Formatting Objects</a> project.
 If you have made improvements to an existing FOP hyphenation pattern, or if you have created one from scratch, please consider contributing these to OFFO so that they can benefit other FOP users as well. Please inquire on the <a href="../maillist.html#fop-user">FOP User mailing list</a> .</p>
-<h2 id="license-issues-wzxhzdk6wzxhzdk7">License Issues <a id="license-issues"></a></h2>
+<h3 id="license-issues-wzxhzdk6wzxhzdk7">License Issues <a id="license-issues"></a></h3>
 <p>Many of the hyphenation files distributed with TeX and its offspring are licenced under the <a href="http://www.latex-project.org/lppl.html">LaTeX Project Public License (LPPL)</a> , which prevents them from being distributed with Apache software. The LPPL puts restrictions on file names in redistributed derived works which we feel can't guarantee. Some hyphenation pattern files have other or additional restrictions, for example against use for commercial purposes.</p>
 <p>Although Apache FOP cannot redistribute hyphenation pattern files that do not conform with its license scheme, that does not necessarily prevent users from using such hyphenation patterns with FOP. However, it does place on the user the responsibility for determining whether the user can rightly use such hyphenation patterns under the hyphenation pattern license.
 <warning>The user is responsible to settle license issues for hyphenation pattern files that are obtained from non-Apache sources.</warning></p>
-<h2 id="sources-of-custom-hyphenation-pattern-files-wzxhzdk10wzxhzdk11">Sources of Custom Hyphenation Pattern Files <a id="sources"></a></h2>
+<h3 id="sources-of-custom-hyphenation-pattern-files-wzxhzdk10wzxhzdk11">Sources of Custom Hyphenation Pattern Files <a id="sources"></a></h3>
 <p>The most important source of hyphenation pattern files is the <a href="http://www.ctan.org/tex-archive/language/hyphenation/">CTAN TeX Archive</a> .</p>
 <h3 id="installing-custom-hyphenation-patterns-wzxhzdk12wzxhzdk13">Installing Custom Hyphenation Patterns <a id="install"></a></h3>
 <p>To install a custom hyphenation pattern for use with FOP:</p>
@@ -392,7 +392,7 @@ and run Ant with build target <code>jar-
 </li>
 </ol>
 <p><warning>Either of these three options will ensure hyphenation is working when using FOP from the command-line. If FOP is being embedded, remember to add the location(s) of the hyphenation JAR(s) to the CLASSPATH (option 1 and 2) or to set the <a href="configuration.html#hyphenation-dir"><hyphenation-dir></a> configuration option programmatically (option 3).</warning></p>
-<h1 id="hyphenation-patterns-wzxhzdk17wzxhzdk18">Hyphenation Patterns <a id="patterns"></a></h1>
+<h2 id="hyphenation-patterns-wzxhzdk17wzxhzdk18">Hyphenation Patterns <a id="patterns"></a></h2>
 <p>If you would like to build your own hyphenation pattern files, or modify existing ones, this section will help you understand how to do so. Even when creating a pattern file from scratch, it may be beneficial to start with an existing file and modify it. See <a href="http://offo.sourceforge.net/hyphenation/index.html">OFFO's Hyphenation page</a> for examples. Here is a brief explanation of the contents of FOP's hyphenation patterns:
 <warning>The remaining content of this section should be considered "draft" quality. It was drafted from theoretical literature, and has not been tested against actual FOP behavior. It may contain errors or omissions. Do not rely on these instructions without testing everything stated here. If you use these instructions, please provide feedback on the <a href="../maillist.html#fop-user">FOP User mailing list</a> , either confirming their accuracy, or raising specific problems that we can address.</warning></p>
 <ul>



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


Mime
View raw message