Return-Path: X-Original-To: apmail-xmlgraphics-commits-archive@www.apache.org Delivered-To: apmail-xmlgraphics-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A2ED1D24C for ; Wed, 24 Oct 2012 04:05:18 +0000 (UTC) Received: (qmail 67140 invoked by uid 500); 24 Oct 2012 04:05:18 -0000 Mailing-List: contact commits-help@xmlgraphics.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@xmlgraphics.apache.org Delivered-To: mailing list commits@xmlgraphics.apache.org Received: (qmail 67120 invoked by uid 99); 24 Oct 2012 04:05:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Oct 2012 04:05:17 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Oct 2012 04:05:03 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 3A3072388AC8 for ; Wed, 24 Oct 2012 04:04:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r835960 [6/18] - in /websites/staging/xmlgraphics/trunk/content: ./ batik/ batik/dev/ batik/tools/ batik/using/ batik/using/scripting/ commons/ fop/ fop/0.95/ fop/1.0/ fop/1.1/ fop/dev/ fop/dev/design/ fop/trunk/ Date: Wed, 24 Oct 2012 04:04:05 -0000 To: commits@xmlgraphics.apache.org From: buildbot@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121024040417.3A3072388AC8@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: websites/staging/xmlgraphics/trunk/content/fop/1.0/configuration.html ============================================================================== --- websites/staging/xmlgraphics/trunk/content/fop/1.0/configuration.html (original) +++ websites/staging/xmlgraphics/trunk/content/fop/1.0/configuration.html Wed Oct 24 04:04:00 2012 @@ -330,11 +330,12 @@ $(document).ready(function () {
-

$Revision: 1298724 $

-

Configuration File Basics

+

Apache(tm) FOP: Configuration

+

$Revision: 1298724 $

+

Configuration File Basics

The FOP configuration file is an XML file containing a variety of settings that are useful for controlling FOP's behavior, and for helping it find resources that you wish it to use.

The easiest way to get started using a FOP configuration file is to copy the sample found at {fop-dir}/conf/fop.xconf to a location of your choice, and then to edit it according to your needs. It contains templates for the various configuration options, most of which are commented out. Remove the comments and change the settings for entries that you wish to use. Be sure to follow any instructions, including comments which specify the value range. Also, since the configuration file is XML, be sure to keep it well-formed.

-

Making Configuration Available to FOP #

+

Making Configuration Available to FOP #

After creating your configuration file, you must tell FOP how to find it:

  • @@ -345,7 +346,7 @@ $(document).ready(function () {

See Setting the Configuration Programmatically for instructions on how to do so in an embedded environment.

-

Summary of the General Configuration Options

+

Summary of the General Configuration Options

@@ -460,7 +461,7 @@ $(document).ready(function () {

The second penalty element sets an "infinite" penalty for the TIFF loader using the internal TIFF codec. This practically disables that plug-in as it will never be chosen as a possible solution.

Negative penalties are possible to promote a plug-in but a negative penalty sum will be treated as zero penalty in most cases. For more details on the image loading framework, please consult the documentation there.

-

Renderer configuration

+

Renderer configuration

Each Renderer has its own configuration section which is identified by the MIME type the Renderer is written for, ex. "application/pdf" for the PDF Renderer.

The configuration for the PDF Renderer could look like this:

@@ -486,7 +487,7 @@ $(document).ready(function () {

The details on the font configuration can be found on the separate Fonts page. Note especially the section entitled Register Fonts with FOP .

-

Special Settings for the PDF Renderer #

+

Special Settings for the PDF Renderer #

The configuration element for the PDF renderer contains two elements. One is for the font configuration (please follow the link above) and one is for the "filter list". The filter list controls how the individual objects in a PDF file are encoded. By default, all objects get "flate" encoded (i.e. simply compressed with the same algorithm that is also used in ZIP files). Most users don't need to change that setting. For debugging purposes, it may be desired not to compress the internal objects at all so the generated PDF commands can be read. In that case, you can simply use the following filter list. The second filter list (type="image") ensures that all images still get compressed but also ASCII-85 encoded so the produced PDF file is still easily readable in a text editor.

<renderer mime="application/pdf">
   <filterList>
@@ -566,7 +567,7 @@ $(document).ready(function () {
 
 The default value for the "rendering" setting is "speed" which causes borders to be painted as plain rectangles. In this mode, no special borders (dotted, dashed etc.) are available. If you want support for all border modes, set the value to "quality" as indicated above. This will cause the borders to be painted as bitmaps.

The default value for the "text-rendering" setting is "auto" which paints the base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D. If the mix of painting methods results in unwelcome output, you can set this to "bitmap" which causes all text to be rendered as bitmaps.

-

Special Settings for the AFP Renderer #

+

Special Settings for the AFP Renderer #

Additionally, there are certain settings that control how the renderer handles various elements. @@ -577,7 +578,7 @@ The default value for the "rendering" se The default value for the images "mode" setting is "b+w" (black and white). When the images "mode" setting is "b+w" a "bits-per-pixel" setting can be provided to aid the grayscale conversion process. With this setting all images referenced in your source document are converted to an IOCA FS45 grayscale bitmap image form. When the setting is "color" all images are converted to an IOCA FS45 color bitmap image form. When "native" setting is "true", all images encountered (TIFF, GIF, JPEG and Encapsulated Postscript etc.) will be embedded directly in the datastream in their native form using a MO:DCA Object Container.

The default value for the "renderer-resolution" is 240 dpi.

By default if there is no configuration definition for "resource-group-file", external resources will be placed in a file called resources.afp.

-

When it does not work

+

When it does not work

FOP searches the configuration file for the information it expects, at the position it expects. When that information is not present, FOP will not complain, it will just continue. When there is other information in the file, FOP will not complain, it will just ignore it. That means that when your configuration information is in the file but in a different XML element, or in a different XML path, than FOP expects, it will be silently ignored.

Check the following possibilities:

    Modified: websites/staging/xmlgraphics/trunk/content/fop/1.0/embedding.html ============================================================================== --- websites/staging/xmlgraphics/trunk/content/fop/1.0/embedding.html (original) +++ websites/staging/xmlgraphics/trunk/content/fop/1.0/embedding.html Wed Oct 24 04:04:00 2012 @@ -330,8 +330,9 @@ $(document).ready(function () {
    -

    How to Embed Apache� FOP in a Java application$Revision: 1298724 $

    -

    Overview

    +

    Apache(tm) FOP: Embedding

    +

    How to Embed Apache� FOP in a Java application$Revision: 1298724 $

    +

    Overview

    Review Running FOP for important information that applies to embedded applications as well as command-line use, such as options and performance.

    To embed Apache™ FOP in your application, first create a new org.apache.fop.apps.FopFactory instance. This object can be used to launch multiple rendering runs. For each run, create a new org.apache.fop.apps.Fop instance through one of the factory methods of FopFactory. In the method call you specify which output format (i.e. Renderer) to use and, if the selected renderer requires an OutputStream, which OutputStream to use for the results of the rendering. You can customize FOP's behaviour in a rendering run by supplying your own FOUserAgent instance. The FOUserAgent can, for example, be used to set your own Renderer instance (details below). Finally, you retrieve a SAX DefaultHandler instance from the Fop object and use that as the SAXResult of your transformation. We recently changed FOP's outer API to what we consider the final API. This might require some changes in your application. The main reasons for these changes were performance improvements due to better reuse of reusable objects and reduced use of static variables for added flexibility in complex environments.

    @@ -388,7 +389,7 @@ Let's discuss these 5 steps in detail:

    If you're not totally familiar with JAXP Transformers, please have a look at the Embedding examples below. The section contains examples for all sorts of use cases. If you look at all of them in turn you should be able to see the patterns in use and the flexibility this approach offers without adding too much complexity.

    This may look complicated at first, but it's really just the combination of an XSL transformation and a FOP run. It's also easy to comment out the FOP part for debugging purposes, for example when you're tracking down a bug in your stylesheet. You can easily write the XSL-FO output from the XSL transformation to a file to check if that part generates the expected output. An example for that can be found in the Embedding examples (See "ExampleXML2FO").

    -

    Logging #

    +

    Logging #

    Logging is now a little different than it was in FOP 0.20.5. We've switched from Avalon Logging to Jakarta Commons Logging . While with Avalon Logging the loggers were directly given to FOP, FOP now retrieves its logger(s) through a statically available LogFactory. This is similar to the general pattern that you use when you work with Apache Log4J directly, for example. We call this "static logging" (Commons Logging, Log4J) as opposed to "instance logging" (Avalon Logging). This has a consequence: You can't give FOP a logger for each processing run anymore. The log output of multiple, simultaneously running FOP instances is sent to the same logger.

    By default, Jakarta Commons Logging uses JDK logging (available in JDKs 1.4 or higher) as its backend. You can configure Commons Logging to use an alternative backend, for example Log4J. Please consult the documentation for Jakarta Commons Logging on how to configure alternative backends.

    As a result of the above we differentiate between two kinds of "logging":

    @@ -401,9 +402,9 @@ Let's discuss these 5 steps in detail:

The use of "feedback" instead of "logging" is intentional. Most people were using log output as a means to get feedback from events within FOP. Therefore, FOP now includes an event package which can be used to receive feedback from the layout engine and other components within FOP per rendering run . This feedback is not just some text but event objects with parameters so these events can be interpreted by code. Of course, there is a facility to turn these events into normal human-readable messages. For details, please read on on the Events page . This leaves normal logging to be mostly a thing used by the FOP developers although anyone can surely activate certain logging categories but the feedback from the loggers won't be separated by processing runs. If this is required, the Events subsystem is the right approach.

-

Processing XSL-FO #

+

Processing XSL-FO #

Once the Fop instance is set up, call getDefaultHandler() to obtain a SAX DefaultHandler instance to which you can send the SAX events making up the XSL-FO document you'd like to render. FOP processing starts as soon as the DefaultHandler's startDocument() method is called. Processing stops again when the DefaultHandler's endDocument() method is called. Please refer to the basic usage pattern shown above to render a simple XSL-FO document.

-

Processing XSL-FO generated from XML+XSLT #

+

Processing XSL-FO generated from XML+XSLT #

If you want to process XSL-FO generated from XML using XSLT we recommend again using standard JAXP to do the XSLT part and piping the generated SAX events directly through to FOP. The only thing you'd change to do that on the basic usage pattern above is to set up the Transformer differently:

//without XSLT: //Transformer transformer = factory.newTransformer(); // identity transformer

@@ -437,9 +438,9 @@ Let's discuss these 5 steps in detail:

There are a variety of upstream data manipulations possible. For example, you may have a DOM and an XSL stylesheet; or you may want to set variables in the stylesheet. Interface documentation and some cookbook solutions to these situations are provided in Xalan Basic Usage Patterns .

-

Configuring Apache FOP Programmatically

+

Configuring Apache FOP Programmatically

Apache FOP provides two levels on which you can customize FOP's behaviour: the FopFactory and the user agent.

-

Customizing the FopFactory #

+

Customizing the FopFactory #

The FopFactory holds configuration data and references to objects which are reusable over multiple rendering runs. It's important to instantiate it only once (except in special environments) and reuse it every time to create new FOUserAgent and Fop instances.

You can set all sorts of things on the FopFactory:

    @@ -472,7 +473,7 @@ fopFactory.addElementMapping(myElementMa fopFactory.setURIResolver(myResolver); // myResolver is a javax.xml.transform.URIResolverBoth the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FopFactory is primarily used to resolve URIs on factory-level (hyphenation patterns, for example) and it is always used if no other URIResolver (for example on the FOUserAgent) resolved the URI first.

-

Customizing the User Agent #

+

Customizing the User Agent #

The user agent is the entity that allows you to interact with a single rendering run, i.e. the processing of a single document. If you wish to customize the user agent's behaviour, the first step is to create your own instance of FOUserAgent using the appropriate factory method on FopFactory and pass that to the factory method that will create a new Fop instance:

FopFactory fopFactory = FopFactory.newInstance(); // Reuse the FopFactory if possible! // do the following for each new rendering run @@ -538,16 +539,16 @@ fopFactory.setUserConfig(cfg);

/ ..or.. /

fopFactory.setUserConfig(new File("C:/Temp/mycfg.xml")); The layout of the configuration file is described on the Configuration page .

-

Hints

-

Object reuse #

+

Hints

+

Object reuse #

Fop instances shouldn't (and can't) be reused. Please recreate Fop and FOUserAgent instances for each rendering run using the FopFactory. This is a cheap operation as all reusable information is held in the FopFactory. That's why it's so important to reuse the FopFactory instance.

-

AWT issues #

+

AWT issues #

If your XSL-FO files contain SVG then Apache Batik will be used. When Batik is initialised it uses certain classes in java.awt that intialise the Java AWT classes. This means that a daemon thread is created by the JVM and on Unix it will need to connect to a DISPLAY.

The thread means that the Java application may not automatically quit when finished, you will need to call System.exit() . These issues should be fixed in the JDK 1.4.

If you run into trouble running FOP on a head-less server, please see the notes on Batik .

-

Getting information on the rendering process #

+

Getting information on the rendering process #

To get the number of pages that were rendered by FOP you can call Fop.getResults() . This returns a FormattingResults object where you can look up the number of pages produced. It also gives you the page-sequences that were produced along with their id attribute and their numbers of pages. This is particularly useful if you render multiple documents (each enclosed by a page-sequence) and have to know the number of pages of each document.

-

Improving performance

+

Improving performance

There are several options to consider:

  • @@ -569,12 +570,12 @@ The layout of the configuration file is

    You may also wish to consider trying to reduce memory usage .

-

Multithreading FOP

+

Multithreading FOP

Apache FOP may currently not be completely thread safe. The code has not been fully tested for multi-threading issues, yet. If you encounter any suspicious behaviour, please notify us.

There is also a known issue with fonts being jumbled between threads when using the Java2D/AWT renderer (which is used by the -awt and -print output options). In general, you cannot safely run multiple threads through the AWT renderer.

-

Examples

+

Examples

The directory "{fop-dir}/examples/embedding" contains several working examples.

-

ExampleFO2PDF.java #

+

ExampleFO2PDF.java #

This example demonstrates the basic usage pattern to transform an XSL-FO file to PDF using FOP.

ExampleXML2FO.java #

@@ -584,20 +585,20 @@ The layout of the configuration file is

This example demonstrates how you can convert an arbitrary XML file to PDF using XSLT and XSL-FO/FOP. It is a combination of the first two examples above. The example uses JAXP to transform the XML file to XSL-FO and FOP to transform the XSL-FO to PDF.

The output (XSL-FO) from the XSL transformation is piped through to FOP using SAX events. This is the most efficient way to do this because the intermediate result doesn't have to be saved somewhere. Often, novice users save the intermediate result in a file, a byte array or a DOM tree. We strongly discourage you to do this if it isn't absolutely necessary. The performance is significantly higher with SAX.

-

ExampleObj2XML.java #

+

ExampleObj2XML.java #

This example is a preparatory example for the next one. It's an example that shows how an arbitrary Java object can be converted to XML. It's an often needed task to do this. Often people create a DOM tree from a Java object and use that. This is pretty straightforward. The example here, however, shows how to do this using SAX, which will probably be faster and not even more complicated once you know how this works.

For this example we've created two classes: ProjectTeam and ProjectMember (found in xml-fop/examples/embedding/java/embedding/model). They represent the same data structure found in xml-fop/examples/embedding/xml/xml/projectteam.xml. We want to serialize to XML a project team with several members which exist as Java objects. Therefore we created the two classes: ProjectTeamInputSource and ProjectTeamXMLReader (in the same place as ProjectTeam above).

The XMLReader implementation (regard it as a special kind of XML parser) is responsible for creating SAX events from the Java object. The InputSource class is only used to hold the ProjectTeam object to be used.

Have a look at the source of ExampleObj2XML.java to find out how this is used. For more detailed information see other resources on JAXP (ex. An older JAXP tutorial ).

-

ExampleObj2PDF.java #

+

ExampleObj2PDF.java #

This example combines the previous and the third to demonstrate how you can transform a Java object to a PDF directly in one smooth run by generating SAX events from the Java object that get fed to an XSL transformation. The result of the transformation is then converted to PDF using FOP as before.

ExampleDOM2PDF.java #

This example has FOP use a DOMSource instead of a StreamSource in order to use a DOM tree as input for an XSL transformation.

-

ExampleSVG2PDF.java (PDF Transcoder example) #

+

ExampleSVG2PDF.java (PDF Transcoder example) #

This example shows the usage of the PDF Transcoder, a sub-application within FOP. It is used to generate a PDF document from an SVG file.

-

Final notes #

+

Final notes #

These examples should give you an idea of what's possible. It should be easy to adjust these examples to your needs. Also, if you have other examples that you think should be added here, please let us know via either the fop-users or fop-dev mailing lists. Finally, for more help please send your questions to the fop-users mailing list.

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 Wed Oct 24 04:04:00 2012 @@ -330,12 +330,13 @@ $(document).ready(function () {
-

$Revision: 1298724 $

-

Introduction

+

Apache(tm) FOP: Events/Processing Feedback

+

$Revision: 1298724 $

+

Introduction

In versions until 0.20.5, Apache™ FOP used Avalon-style Logging where it was possible to supply a logger per processing run. During the redesign the logging infrastructure was switched over to Commons Logging 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.

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.

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).

-

The consumer side

+

The consumer side

The event subsystem is located in the org.apache.fop.events package and its base is the Event class. An instance is created for each event and is sent to a set of EventListener instances by the EventBroadcaster . An Event contains:

  • @@ -353,7 +354,7 @@ $(document).ready(function () {

The EventFormatter class can be used to translate the events into human-readable, localized messages.

A full example of what is shown here can be found in the examples/embedding/java/embedding/events directory in the FOP distribution. The example can also be accessed via the web .

-

Writing an EventListener #

+

Writing an EventListener #

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; @@ -384,12 +385,12 @@ public class SysOutEventListener impleme You can see that for every event the method processEvent of the EventListener will be called. Inside this method you can do whatever processing you would like including throwing a RuntimeException , if you want to abort the current processing run.

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 EventFormatter class does this for you. It provides additional methods if you'd like to explicitly specify the locale.

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!

-

Adding an EventListener #

+

Adding an EventListener #

To register the event listener with FOP, get the EventBroadcaster which is associated with the user agent ( FOUserAgent ) 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.

-

An additional listener example #

+

An additional listener example #

Here's an additional example of an event listener:

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 {

@@ -425,7 +426,7 @@ public class MyEventListener implements

} This throws a RuntimeException with the FileNotFoundException as the cause. Further processing effectively stops in FOP. You can catch the exception in your code and react as you see necessary.

-

The producer side (for FOP developers)

+

The producer side (for FOP developers)

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 us .

Producing and sending an event #

@@ -438,7 +439,7 @@ Event ev = new Event(this, "complain", E EventBroadcaster broadcaster = [get it from somewhere]; broadcaster.broadcastEvent(ev);

The Event.paramsBuilder() is a fluent interface to help with the build-up of the parameters. You could just as well instantiate a Map ( Map<String, Object> ) and fill it with values.

-

The EventProducer interface #

+

The EventProducer interface #

To simplify event production, the event subsystem provides the EventProducer interface. You can create interfaces which extend EventProducer . 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.

The event producer interface does not need to have any implementation. The implementation is produced at runtime by a dynamic proxy created by DefaultEventBroadcaster . The dynamic proxy creates Event instances for each method call against the event producer interface. Each parameter (except "source") is added to the event's parameter map.

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.

@@ -473,7 +474,7 @@ producer.complain(this, "I'm tired", 23)

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.

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 org.apache.fop.events.EventExceptionManager$ExceptionFactory has to be registered for the EventExceptionManager to be able to construct the exception from an event.

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 EventModelFactory . This interface is implemented for each event model and registered through the service provider mechanism (see the plug-ins section for details).

-

Event severity #

+

Event severity #

Four different levels of severity for events has been defined:

  1. @@ -490,7 +491,7 @@ producer.complain(this, "I'm tired", 23)

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.

-

Plug-ins to the event subsystem #

+

Plug-ins to the event subsystem #

The event subsystem is extensible. There are a number of extension points:

  • @@ -501,7 +502,7 @@ producer.complain(this, "I'm tired", 23)

The names in bold above are used as filenames for the service provider files that are placed in the META-INF/services directory. That way, they are automatically detected. This is a mechanism defined by the JAR file specification .

-

Localization (L10n) #

+

Localization (L10n) #

One goal of the event subsystem was to have localized (translated) event messages. The EventFormatter class can be used to convert an event to a human-readable message. Each EventProducer 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 EventFormatter class).

The XML format used by the EventFormatter is the same as Apache Cocoon's catalog format. Here's an example: <?xml version="1.0" encoding="UTF-8"?> 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 Wed Oct 24 04:04:00 2012 @@ -330,34 +330,35 @@ $(document).ready(function () {

-

$Revision: 1298724 $

+

Standard Apache™ FOP Extensions

+

$Revision: 1298724 $

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™ FOP is able to add features that are not covered in the specification.

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 Developers' Extension Page . All extensions require the correct use of an appropriate namespace in your input document.

-

SVG

+

SVG

Please see the SVG documentation for more details.

-

FO Extensions

-

Namespace #

+

FO Extensions

+

Namespace #

By convention, FO extensions in FOP use the "fox" namespace prefix. To use any of the FO extensions, add a namespace entry for http://xmlgraphics.apache.org/fop/extensions to the root element:

-

PDF Bookmarks #

+

PDF Bookmarks #

In previous versions of Apache FOP there was a fox:outline element which was used to create outlines in PDF files. The redesigned code makes use of the new bookmark feature defined in the latest XSL 1.1 working draft .

-

Anchors or Named Destinations #

+

Anchors or Named Destinations #

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. ... Table of ContentsIt is possible that in some future release of FOP, all elements with "id" attributes will generate named-destinations, which will eliminate the need for fox:destination.

-

Table Continuation Label #

+

Table Continuation Label #

This extension element hasn't been reimplemented for the redesigned code, yet.

-

fox:orphan-content-limit and fox:widow-content-limit #

+

fox:orphan-content-limit and fox:widow-content-limit #

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.

-

fox:external-document #

+

fox:external-document #

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 fox:external-document element. Each page of the external document will create one full page in the target format.

The fox:external-document element is structurally a peer to fo:page-sequence , so wherever you can put an fo:page-sequence you could also place a fox:external-document . Therefore, the specified contents for fo:root change to:

(layout-master-set, declarations?, bookmark-tree?, (page-sequence|page-sequence-wrapper|fox:external-document|fox:destination)+)

-

Specification ##

+

Specification ##

The fox:external-document 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.

In terms of page numbers, the behaviour is the same as for fo:page-sequence . The placement of the image inside the page is similar to that of fo:external-graphic or fo:instream-foreign-object , 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.

Content: EMPTY

@@ -420,16 +421,16 @@ This is a proprietary extension element

Datatype "page-set": Value: auto | , Default: "auto" which means all pages/subimages of the document. allows values such as "7" or "1-3" fox:external-document is not suitable for concatenating FO documents. For this, XInclude is recommended.

-

Free-form Transformation for fo:block-container #

+

Free-form Transformation for fo:block-container #

For fo:block-container elements whose absolute-position set to "absolute" or "fixed" you can use the extension attribute fox:transform to apply a free-form transformation to the whole block-container. The content of the fox:transform attribute is the same as for SVG's transform attribute . 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.

Examples: fox:transform="rotate(45)" would rotate the block-container by 45 degrees clock-wise around its upper-left corner. fox:transform="translate(10000,0)" 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.

-

Color functions #

+

Color functions #

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.

-

cmyk() ##

+

cmyk() ##

color cmyk(numeric, numeric, numeric, numeric)

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.

-

#CMYK pseudo-profile ##

+

#CMYK pseudo-profile ##

color rgb-icc(numeric, numeric, numeric, #CMYK, numeric, numeric, numeric, numeric)

The rgb-icc 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 fo:color-profile 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:

    @@ -440,27 +441,27 @@ This extension attribute doesn't work fo

    rgb-icc(153, 153, 102, #CMYK, 0, 0, 0.2, 0.4)

-

Prepress Support #

+

Prepress Support #

This section defines a number of extensions related to prepress support. fox:scale defines a general scale factor for the generated pages. fox:bleed defines the bleed area for a page. fox:crop-offset 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.

-

fox:scale ##

+

fox:scale ##

Value: {1,2}

Initial: 1

Applies to: fo:simple-page-master

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.

-

fox:bleed ##

+

fox:bleed ##

Value: {1,4}

Initial: 0pt

Applies to: fo:simple-page-master

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 the definition of padding ).

This extension indirectly defines the BleedBox and is calculated by expanding the TrimBox by the bleed widths. The lengths must be non-negative.

-

fox:crop-offset ##

+

fox:crop-offset ##

Value: {1,4}

Initial: bleed (see below)

Applies to: fo:simple-page-master

Same behaviour as with fox:bleed. The initial value is set to the same values as the fox:bleed property.

This extension indirectly defines the MediaBox and is calculated by expanding the TrimBox by the crop offsets. The lengths must be non-negative.

-

fox:crop-box ##

+

fox:crop-box ##

Value: [trim-box | bleed-box | media-box]

Initial: media-box

Applies to: fo:simple-page-master

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 Wed Oct 24 04:04:00 2012 @@ -330,8 +330,9 @@ $(document).ready(function () {
-

$Revision: 1298724 $

-

Summary

+

Apache(tm) FOP: Fonts

+

$Revision: 1298724 $

+

Summary

The following table summarizes the font capabilities of the various Apache� FOP renderers:

@@ -409,7 +410,7 @@ $(document).ready(function () {
-

Base-14 Fonts

+

Base-14 Fonts

The Adobe PostScript and PDF Specification specify a set of 14 fonts that must be available to every PostScript interpreter and PDF reader: Helvetica (normal, bold, italic, bold italic), Times (normal, bold, italic, bold italic), Courier (normal, bold, italic, bold italic), Symbol and ZapfDingbats.

The following font family names are hard-coded into FOP for the Base-14 font set:

@@ -443,14 +444,14 @@ $(document).ready(function () {

Please note that recent versions of Adobe Acrobat Reader replace "Helvetica" with "Arial" and "Times" with "Times New Roman" internally. GhostScript replaces "Helvetica" with "Nimbus Sans L" and "Times" with "Nimbus Roman No9 L". Other document viewers may do similar font substitutions. If you need to make sure that there are no such substitutions, you need to specify an explicit font and embed it in the target document.

-

Missing Fonts

+

Missing Fonts

When FOP does not have a specific font at its disposal (because it's not installed in the operating system or set up in FOP's configuration), the font is replaced with "any". "any" is internally mapped to the Base-14 font "Times" (see above).

-

Missing Glyphs

+

Missing Glyphs

Every font contains a particular set of glyphs . If no glyph can be found for a given character, FOP will issue a warning and use the glpyh for "#" (if available) instead. Before it does that, it consults a (currently hard-coded) registry of glyph substitution groups (see Glyphs.java in Apache XML Graphics Commons). This registry can supply alternative glyphs in some cases (like using space when a no-break space is requested). But there's no guarantee that the result will be as expected (for example, in the case of hyphens and similar glyphs). A better way is to use a font that has all the necessary glyphs. This glyph substitution is only a last resort.

-

Java2D/AWT/Operating System Fonts

+

Java2D/AWT/Operating System Fonts

The Java2D family of renderers (Java2D, AWT, Print, TIFF, PNG), use the Java AWT subsystem for font metric information. Through operating system registration, the AWT subsystem knows what fonts are available on the system, and the font metrics for each one.

When working with one of these output formats and you're missing a font, just install it in your operating system and they should be available for these renderers. Please note that this is not true for other output formats such as PDF or PostScript.

-

Custom Fonts

+

Custom Fonts

Support for custom fonts is highly output format dependent (see above table). This section shows how to add Type 1 and TrueType fonts to the PDF, PostScript and Java2D-based renderers. Other renderers (like AFP) support other font formats. Details in this case can be found on the page about output formats .

In earlier FOP versions, it was always necessary to create an XML font metrics file if you wanted to add a custom font. This unconvenient step has been removed and in addition to that, FOP supports auto-registration of fonts, i.e. FOP can find fonts installed in your operating system or can scan user-specified directories for fonts. Font registration via XML font metrics file is still supported and may still be necessary for some very special cases as fallback variant while we stabilize font auto-detection.

Basic information about fonts can be found at:

@@ -462,7 +463,7 @@ $(document).ready(function () {

Adobe Font Technote

-

Basic font configuration

+

Basic font configuration

If you want FOP to use custom fonts, you need to tell it where to find them. This is done in the configuration file and once per renderer (because each output format is a little different). In the basic form, you can either tell FOP to find your operating system fonts or you can specify directories that it will search for support fonts. These fonts will then automatically be registered.

@@ -482,7 +483,7 @@ $(document).ready(function () { Review the documentation for FOP Configuration 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.

Advanced font configuration

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.

-

Type 1 Font Metrics #

+

Type 1 Font Metrics #

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:

Windows: java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar @@ -630,7 +631,7 @@ Alternatively, the individual sub-fonts

If relative URLs are specified, they are evaluated relative to the value of the "font-base" setting. If there is no "font-base" setting, the fonts are evaluated relative to the base directory.

-

Auto-Detect and auto-embed feature #

+

Auto-Detect and auto-embed feature #

When the "auto-detect" flag is set in the configuration, FOP will automatically search for fonts in the default paths for your operating system.

FOP will also auto-detect fonts which are available in the classpath, if they are described as "application/x-font" in the MANIFEST.MF file. For example, if your .jar file contains font/myfont.ttf: Manifest-Version: 1.0

@@ -640,7 +641,7 @@ Manifest-Version: 1.0

This feature allows you to create JAR files containing fonts. The JAR files can be added to fop by providem them in the classpath, e.g. copying them into the lib/ directory.

-

Embedding #

+

Embedding #

By default, all fonts are embedded if an output format supports font embedding. In some cases, however, it is preferred that some fonts are only referenced. When working with referenced fonts it is important to be in control of the target environment where the produced document is consumed, i.e. the necessary fonts have to be installed there.

There are two different ways how you can specify that a font should be referenced:

    @@ -679,7 +680,7 @@ At the moment, you can only match fonts

    When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a subset of the original font, containing only the glyphs used, is embedded in the output document. That's the default, but if you specify encoding-mode="single-byte" (see above), the complete font is embedded.

    -

    Substitution #

    +

    Substitution #

    When a section is defined in the configuration, FOP will re-map any font-family references found in your FO input to a given substitution font.

    • @@ -722,7 +723,7 @@ At the moment, you can only match fonts

    Character-by-Character is NOT yet supported!

    -

    Font List Command-Line Tool

    +

    Font List Command-Line Tool

    FOP contains a small command-line tool that lets you generate a list of all configured fonts. Its class name is: org.apache.fop.tools.fontlist.FontListMain . Run it with the "-?" parameter to get help for the various options.

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 Wed Oct 24 04:04:00 2012 @@ -330,8 +330,9 @@ $(document).ready(function () {
-

$Revision: 1298724 $

-

Introduction

+

Apache(tm) FOP: Graphics Formats

+

$Revision: 1298724 $

+

Introduction

Some noteworthy features of the image handling subsystem are:

  • @@ -345,7 +346,7 @@ $(document).ready(function () {

The actual image loading framework does not reside in Apache FOP, but in XML Graphics Commons .

-

Overview of Graphics Support

+

Overview of Graphics Support

The table below summarizes the theoretical support for graphical formats within FOP. In other words, within the constraints of the limitations listed here, these formats should work. However, many of them have not been tested, and there may be limitations that have not yet been discovered or documented. The packages needed to support some formats are not included in the FOP distribution and must be installed separately. Follow the links in the "Support Through" columns for more details.

@@ -530,12 +531,12 @@ $(document).ready(function () {

[2]: Supported without the need to decode the image, but only for certain subtypes.

-

Graphics Packages

-

XML Graphics Commons Native #

+

Graphics Packages

+

XML Graphics Commons Native #

XML Graphics Commons supports a number of graphic file formats natively as basic functionality: all bitmap formats for which there are Image I/O codecs available (JPEG, PNG, GIF, TIFF, etc.), EPS and EMF.

-

FOP Native #

+

FOP Native #

FOP has no native image plug-ins for the image loading framework of its own but currently hosts the Batik-dependent SVG and WMF plug-ins until they can be moved to Apache Batik .

-

Apache Batik #

+

Apache Batik #

Apache Batik will later receive the SVG and WMF plug-ins for the image loading framework that are currently hosted inside FOP.

Current FOP distributions include a distribution of the Apache Batik . Because Batik's API changes frequently, it is highly recommended that you use the version that ships with FOP, at least when running FOP. Batik must be run in a graphical environment. @@ -552,41 +553,41 @@ Batik must be run in a graphical environ

Install a toolkit which emulates AWT without the need for an underlying X server. One example is the PJA toolkit , which is free and comes with detailed installation instructions.

-

Image I/O #

+

Image I/O #

The image loading framework in XML Graphics Commons provides a wrapper to load images through the JDK's Image I/O API (JSR 015). Image I/O allows to dynamically add additional image codecs. An example of such an add-on library are the JAI Image I/O Tools available from Sun.

-

Details on image formats

-

BMP #

+

Details on image formats

+

BMP #

BMP images are supported through an Image I/O codec. There may be limitations of the codec which are outside the control of Apache FOP.

-

EMF #

+

EMF #

Windows Enhanced Metafiles (EMF) are only supported in RTF output where they are embedded without decoding.

-

EPS #

+

EPS #

Apache FOP allows to use EPS files when generating PostScript output only.

Other output targets can't be supported at the moment because FOP lacks a PostScript interpreter. Furthermore, FOP is currently not able to parse the preview bitmaps sometimes contained in EPS files.

-

GIF #

+

GIF #

GIF images are supported through an Image I/O codec. Transparency is supported but not guaranteed to work with every output format.

-

JPEG #

+

JPEG #

FOP native support (i.e. the handling of undecoded images) of JPEG does not include all variants, especially those containing unusual color lookup tables and color profiles. If you have trouble with a JPEG image in FOP, try opening it with an image processing program (such as Photoshop or Gimp) and then saving it. Specifying 24-bit color output may also help. For the PDF and PostScript renderers most JPEG images can be passed through without decompression. User reports indicate that grayscale, RGB, and CMYK color spaces are all rendered properly. However, for other output formats, the JPEG images have to be decompressed. Tests have shown that there are some limitation in some Image I/O codecs concerning images in the CMYK color space. Work-arounds are in place but may not always work as expected.

-

PNG #

+

PNG #

PNG images are supported through an Image I/O codec. Transparency is supported but not guaranteed to work with every output format.

-

SVG #

-

Introduction ##

+

SVG #

+

Introduction ##

FOP uses Apache Batik for SVG support. This format can be handled as an fo:instream-foreign-object or in a separate file referenced with fo:external-graphic . Batik's SVG Rasterizer utility may also be used to convert standalone SVG documents into PDF. For more information please see the SVG Rasterizer documentation on the Batik site.

Placing SVG Graphics into PDF ##

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.

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 configuration .

Currently transparency is limited in PDF so some SVG images that contain effects or graphics with transparent areas may not be displayed correctly.

-

Placing SVG Text into PDF and PostScript ##

+

Placing SVG Text into PDF and PostScript ##

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 text.svg / text.pdf / text.png 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.

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.

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.

-

Font selection notes ##

+

Font selection notes ##

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.

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.

-

Scaling ##

+

Scaling ##

Currently, SVG images are rendered with the dimensions specified in the SVG file , 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.

If you use pixels to specify the size of an SVG graphic the "source resolution" setting in the configuration 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.

-

Known Problems ##

+

Known Problems ##

  • 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.

    @@ -601,18 +602,18 @@ Batik's SVG Rasterizer utility may also

    Uniform transparency for images and other SVG elements that are converted into a raster graphic are not drawn properly in PDF. The image is opaque.

-

TIFF #

+

TIFF #

FOP can embed TIFF images without decompression into PDF, PostScript and AFP if they have either CCITT T.4, CCITT T.6, or JPEG compression. Otherwise, a TIFF-capable Image I/O codec is necessary for decoding the image.

There may be some limitation concerning images in the CMYK color space.

-

WMF #

+

WMF #

Windows Metafiles (WMF) are supported through classes in Apache Batik . At the moment, support for this format is experimental and may not always work as expected.

-

Graphics Resolution

+

Graphics Resolution

Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution values. FOP tries to use this resolution information whenever possible to determine the image's intrinsic size. This size is used during the layout process when it is not superseded by an explicit size on fo:external-graphic (content-width and content-height properties).

Please note that not all images contain resolution information. If it's not available the source resolution set on the FopFactory (or through the user configuration XML) is used. The default here is 72 dpi.

Bitmap images are generally embedded into the output format at their original resolution (as is). No resampling of the image is performed. Explicit resampling is on our wishlist, but hasn't been implemented, yet. Bitmaps included in SVG graphics may be resampled to the resolution specified in the "target resolution" setting in the configuration if SVG filters are applied. This can be used as a work-around to resample images in FO documents.

-

Page selection for multi-page formats

+

Page selection for multi-page formats

Some image formats such as TIFF support multiple pages/sub-images per file. You can select a particular page using a special URI fragment in the form: #page= (for example: http://localhost/images/myimage.tiff#page=3 )

-

Image caching

+

Image caching

FOP caches images between runs. There is one cache per FopFactory instance. The URI is used as a key to identify images which means that when a particular URI appears again, the image is taken from the cache. If you have a servlet that generates a different image each time it is called with the same URI you need to use a constantly changing dummy parameter on the URI to avoid caching.

The image cache has been improved considerably in the redesigned code. Therefore, resetting the image cache should be a thing of the past. If you still experience OutOfMemoryErrors, please notify us.

If all else fails, the image cache can be cleared like this: fopFactory.getImageManager().getCache().clearCache();

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 Wed Oct 24 04:04:00 2012 @@ -330,9 +330,10 @@ $(document).ready(function () {
-

$Revision: 1298724 $

-

Hyphenation Support

-

Introduction #

+

Apache(tm) FOP: Hyphenation

+

$Revision: 1298724 $

+

Hyphenation Support

+

Introduction #

Apache™ FOP uses Liang's hyphenation algorithm, well known from TeX. It needs language specific pattern and other data for operation.

Because of licensing issues (and for convenience), all hyphenation patterns for FOP are made available through the Objects For Formatting Objects 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 FOP User mailing list .

@@ -342,7 +343,7 @@ If you have made improvements to an exis The user is responsible to settle license issues for hyphenation pattern files that are obtained from non-Apache sources.

Sources of Custom Hyphenation Pattern Files #

The most important source of hyphenation pattern files is the CTAN TeX Archive .

-

Installing Custom Hyphenation Patterns #

+

Installing Custom Hyphenation Patterns #

To install a custom hyphenation pattern for use with FOP:

  1. Modified: websites/staging/xmlgraphics/trunk/content/fop/1.0/index.html ============================================================================== --- websites/staging/xmlgraphics/trunk/content/fop/1.0/index.html (original) +++ websites/staging/xmlgraphics/trunk/content/fop/1.0/index.html Wed Oct 24 04:04:00 2012 @@ -330,15 +330,16 @@ $(document).ready(function () {
    -

    $Revision: 1298724 $

    -

    Introduction

    +

    Apache(tm) FOP Version 1.0

    +

    $Revision: 1298724 $

    +

    Introduction

    The Apache™ FOP team is proud to present to you this production quality codebase. FOP 1.0 provides a good subset of the W3C XSL-FO 1.0 and 1.1 Standards. Its stable, 1.0 designation provides added recognition as the productive tool it has been for years.

    We remain committed to improving the tool, and we continue to add new features. We welcome any feedback you might have and even more, any other form of help to get the project forward.

    This release contains many bug fixes and new features compared to the previous version. To see what has changed since the last release, please visit the Changes Page and the Release Notes .

    This release implements a good subset of the W3C XSL-FO 1.0 and 1.1 Standards. For a detailed overview of FOP's compliance, visit the compliance page .

    -

    Upgrading from an earlier version

    +

    Upgrading from an earlier version

    If you're upgrading to this version from an earlier version of FOP, please read the information contained on the Upgrading page !

    -

    Download

    +

    Download

    To download this version, please visit the download page .

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