From e7c525e71f648127fd392b56490219b36670f70e Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 20 Apr 2006 07:20:08 +0000 Subject: Merged changes from 0.92 branch back into Trunk. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@395518 13f79535-47bb-0310-9956-ffa450edef68 --- README | 4 +- fop.bat | 2 +- lib/xmlgraphics-commons-1.0.jar | Bin 0 -> 256022 bytes lib/xmlgraphics-commons-snapshot.jar | Bin 256033 -> 0 bytes src/documentation/content/.htaccess | 9 +- src/documentation/content/xdocs/0.91/anttask.xml | 183 ------ src/documentation/content/xdocs/0.91/compiling.xml | 139 ----- .../content/xdocs/0.91/configuration.xml | 184 ------ src/documentation/content/xdocs/0.91/embedding.xml | 619 ------------------- .../content/xdocs/0.91/extensions.xml | 106 ---- src/documentation/content/xdocs/0.91/fonts.xml | 273 --------- src/documentation/content/xdocs/0.91/graphics.xml | 343 ----------- .../content/xdocs/0.91/hyphenation.xml | 236 ------- src/documentation/content/xdocs/0.91/index.xml | 55 -- src/documentation/content/xdocs/0.91/output.xml | 378 ------------ .../content/xdocs/0.91/pdfencryption.xml | 221 ------- src/documentation/content/xdocs/0.91/running.xml | 277 --------- src/documentation/content/xdocs/0.91/servlets.xml | 255 -------- src/documentation/content/xdocs/0.91/upgrading.xml | 119 ---- src/documentation/content/xdocs/0.92/anttask.xml | 183 ++++++ src/documentation/content/xdocs/0.92/compiling.xml | 139 +++++ .../content/xdocs/0.92/configuration.xml | 251 ++++++++ src/documentation/content/xdocs/0.92/embedding.xml | 681 +++++++++++++++++++++ .../content/xdocs/0.92/extensions.xml | 106 ++++ src/documentation/content/xdocs/0.92/fonts.xml | 303 +++++++++ src/documentation/content/xdocs/0.92/graphics.xml | 343 +++++++++++ .../content/xdocs/0.92/hyphenation.xml | 236 +++++++ src/documentation/content/xdocs/0.92/index.xml | 55 ++ .../content/xdocs/0.92/intermediate.xml | 145 +++++ src/documentation/content/xdocs/0.92/output.xml | 400 ++++++++++++ src/documentation/content/xdocs/0.92/pdfa.xml | 132 ++++ .../content/xdocs/0.92/pdfencryption.xml | 233 +++++++ src/documentation/content/xdocs/0.92/running.xml | 279 +++++++++ src/documentation/content/xdocs/0.92/servlets.xml | 259 ++++++++ src/documentation/content/xdocs/0.92/upgrading.xml | 119 ++++ src/documentation/content/xdocs/compliance.ihtml | 81 ++- src/documentation/content/xdocs/dev/release.xml | 16 +- src/documentation/content/xdocs/faq.xml | 17 +- src/documentation/content/xdocs/index.xml | 4 +- src/documentation/content/xdocs/news.xml | 12 +- src/documentation/content/xdocs/relnotes.xml | 135 +++- src/documentation/content/xdocs/site.xml | 10 +- src/documentation/content/xdocs/tabs.xml | 4 +- status.xml | 2 + 44 files changed, 4085 insertions(+), 3463 deletions(-) create mode 100644 lib/xmlgraphics-commons-1.0.jar delete mode 100644 lib/xmlgraphics-commons-snapshot.jar delete mode 100644 src/documentation/content/xdocs/0.91/anttask.xml delete mode 100644 src/documentation/content/xdocs/0.91/compiling.xml delete mode 100644 src/documentation/content/xdocs/0.91/configuration.xml delete mode 100644 src/documentation/content/xdocs/0.91/embedding.xml delete mode 100644 src/documentation/content/xdocs/0.91/extensions.xml delete mode 100644 src/documentation/content/xdocs/0.91/fonts.xml delete mode 100644 src/documentation/content/xdocs/0.91/graphics.xml delete mode 100644 src/documentation/content/xdocs/0.91/hyphenation.xml delete mode 100644 src/documentation/content/xdocs/0.91/index.xml delete mode 100644 src/documentation/content/xdocs/0.91/output.xml delete mode 100755 src/documentation/content/xdocs/0.91/pdfencryption.xml delete mode 100644 src/documentation/content/xdocs/0.91/running.xml delete mode 100644 src/documentation/content/xdocs/0.91/servlets.xml delete mode 100644 src/documentation/content/xdocs/0.91/upgrading.xml create mode 100644 src/documentation/content/xdocs/0.92/anttask.xml create mode 100644 src/documentation/content/xdocs/0.92/compiling.xml create mode 100644 src/documentation/content/xdocs/0.92/configuration.xml create mode 100644 src/documentation/content/xdocs/0.92/embedding.xml create mode 100644 src/documentation/content/xdocs/0.92/extensions.xml create mode 100644 src/documentation/content/xdocs/0.92/fonts.xml create mode 100644 src/documentation/content/xdocs/0.92/graphics.xml create mode 100644 src/documentation/content/xdocs/0.92/hyphenation.xml create mode 100644 src/documentation/content/xdocs/0.92/index.xml create mode 100644 src/documentation/content/xdocs/0.92/intermediate.xml create mode 100644 src/documentation/content/xdocs/0.92/output.xml create mode 100644 src/documentation/content/xdocs/0.92/pdfa.xml create mode 100755 src/documentation/content/xdocs/0.92/pdfencryption.xml create mode 100644 src/documentation/content/xdocs/0.92/running.xml create mode 100644 src/documentation/content/xdocs/0.92/servlets.xml create mode 100644 src/documentation/content/xdocs/0.92/upgrading.xml diff --git a/README b/README index d81fa95d2..a31247373 100644 --- a/README +++ b/README @@ -157,7 +157,9 @@ Known issues: - Omitting fo:table-column or having fo:table-column without a column-width and attempting to create columns implicitly from the first table row is not implemented, yet (Bugzilla #35656). - - Leaders with the "rule" pattern don't work for PostScript output. - Internal basic-links don't point to the exact location on a page, yet, as they did in 0.20.5. Currently you land in the upper left corner of the page. + +Release notes for older FOP versions can be found on: +http://xmlgraphics.apache.org/fop/relnotes.html \ No newline at end of file diff --git a/fop.bat b/fop.bat index 6c469560d..c6b66fb60 100644 --- a/fop.bat +++ b/fop.bat @@ -46,7 +46,7 @@ set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl-2.7.1.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.7.0.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\serializer-2.7.0.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\batik-all-1.6.jar -set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xmlgraphics-commons-snapshot.jar +set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xmlgraphics-commons-1.0.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\avalon-framework-4.2.0.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-io-1.1.jar set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-logging-1.0.4.jar diff --git a/lib/xmlgraphics-commons-1.0.jar b/lib/xmlgraphics-commons-1.0.jar new file mode 100644 index 000000000..0e4e55614 Binary files /dev/null and b/lib/xmlgraphics-commons-1.0.jar differ diff --git a/lib/xmlgraphics-commons-snapshot.jar b/lib/xmlgraphics-commons-snapshot.jar deleted file mode 100644 index dac07e48a..000000000 Binary files a/lib/xmlgraphics-commons-snapshot.jar and /dev/null differ diff --git a/src/documentation/content/.htaccess b/src/documentation/content/.htaccess index 4b0540fa1..17a5c21f9 100644 --- a/src/documentation/content/.htaccess +++ b/src/documentation/content/.htaccess @@ -15,7 +15,8 @@ RedirectMatch Permanent ^/fop/servlets(.*) http://xmlgraphics.apache.org/fop/0.2 # redirect to versioned documentation Redirect Temp /fop/stable http://xmlgraphics.apache.org/fop/0.20.5 Redirect Temp /fop/current http://xmlgraphics.apache.org/fop/0.20.5 -Redirect Temp /fop/0.90alpha1 http://xmlgraphics.apache.org/fop/0.91 -Redirect Temp /fop/0.91beta http://xmlgraphics.apache.org/fop/0.91 -Redirect Temp /fop/unstable http://xmlgraphics.apache.org/fop/0.91 -Redirect Temp /fop/latest http://xmlgraphics.apache.org/fop/0.91 +Redirect Temp /fop/0.90alpha1 http://xmlgraphics.apache.org/fop/0.92 +Redirect Temp /fop/0.91beta http://xmlgraphics.apache.org/fop/0.92 +Redirect Temp /fop/0.92beta http://xmlgraphics.apache.org/fop/0.92 +Redirect Temp /fop/unstable http://xmlgraphics.apache.org/fop/0.92 +Redirect Temp /fop/latest http://xmlgraphics.apache.org/fop/0.92 diff --git a/src/documentation/content/xdocs/0.91/anttask.xml b/src/documentation/content/xdocs/0.91/anttask.xml deleted file mode 100644 index fd8a7e0dc..000000000 --- a/src/documentation/content/xdocs/0.91/anttask.xml +++ /dev/null @@ -1,183 +0,0 @@ - - - - - -
- Ant task - $Revision$ -
- -

- Apache FOP provides an Ant task for automating the document build process. -

-
- Description -

- The FOP Ant task will convert XSL-FO documents to PDF, PS, PCL etc. output - (see Output formats for available formats). -

-

- To call FOP tasks within Ant, first add a FOP task definition to your Ant build file. - One method of defining the task is as follows: -

- - - - - - - - - - - - ]]> -

- Then create FOP tasks within your Ant build file, using the FOP task parameters listed below.

-
- -
Parameters for FOP Ant task - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Parameters specified as attributes
AttributeDescriptionRequired
fofileXSL-FO file to be renderedYes, if no fileset nested element is used
outfileOutput filenameYes, when fofile is used. (This attribute is not valid for filesets.)
formatPossible output formats:
- application/pdf
- application/postscript
- application/vnd.mif
- application/rtf
- application/vnd.hp-PCL
- text/plain
- text/xml
-
No, defaults to application/pdf
outdirOutput directoryRequired if a fileset is used to specify the files to render; optional for fofile. (Can alternatively specify the full path in the fofile value.)
forceRecreate target files, even if they are newer than their corresponding - source files. Note: This attribute is available in post-0.20.5 - versions (0.20.x nightly build and 1.0dev) only; target files are - always generated (i.e., force=true) in 0.20.5 release. - No, default is false
basedirBase directory to resolve relative references (e.g., graphics files) within the - FO document. - No, for single FO File entry, default is to use the location - of that FO file. -
relativebaseFor fileset usage only. A value of true specifies using the location - of each .fo file as the base directory for resolving relative file references located - within that .fo file. A value of false specifies using the value of - basedir for all files within the fileset, or just the current working directory - if basedir is not specified. - No, default is false. -
userconfigUser configuration file (same as the FOP "-c" command line option). Currently doesn't work in FOP Trunk!!!No
messagelevelLogging level
- Possible values: error, warn, info, verbose, debug. Currently doesn't work in FOP Trunk!!!
No, defaults to verbose
logFilesControls whether the names of the files that are processed are logged - (true) or not (false). Currently doesn't work in FOP Trunk!!!No, default is true
-

- - - - - - - - - - - -
Parameters specified as nested elements
AttributeDescriptionRequired
filesetFileSets - are used to specify multiple XSL-FO files to be rendered.Yes, if no fofile attribute is supplied
-

-
- Examples -

- The following example converts a single XSL-FO file to a PDF document: -

- - - - - ]]> -

- This example converts all XSL-FO files within an entire directory to PostScript: -

- - - - - - - - ]]> -
- -
- diff --git a/src/documentation/content/xdocs/0.91/compiling.xml b/src/documentation/content/xdocs/0.91/compiling.xml deleted file mode 100644 index ad02f3046..000000000 --- a/src/documentation/content/xdocs/0.91/compiling.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - -
- Apache FOP: Building from Source Code - $Revision$ -
- -
- Do You Need To Build? -

- FOP distributions are either pre-compiled binary or source. - If you are using a binary distribution, it is already built and there is no need to build it again. - See the Download Instructions for information about whether a - binary or source distribution is best for your needs. -

-

- If you got the source code from a repository snapshot or via Subversion you will need to build FOP - in any case. -

-
-
- Set Up Your Environment -
- JDK -

- Building FOP requires a minimum Java Development Kit (JDK/SDK) of 1.3 - (A Java Runtime Environment is not sufficient). -

-
-
- CLASSPATH -

- There is generally no need to setup a classpath. All libraries needed to compile FOP are included - in the source distribution and are referenced by the build script. - You will only need to adjust the classpath if you build FOP in some other way. See the build - script build.xml for details. -

-
-
- JAVA_HOME -

- The build script uses Apache Ant, a popular - Java-based build tool, which usually requires that the environment variable JAVA_HOME point to - your local JDK root directory. This is true even if you use JDK 1.2 or above, which normally - does not need this setting. -

-
-
- Apache Ant -

- Apache Ant must be installed in order to - build FOP. Following best practices we don't include Ant with FOP anymore. You can find the - instructions to install Ant in the Ant manual on the web. -

-
-
-
- Run the Build Script -

- Change to the FOP root directory and build FOP by executing the build script (build.xml) - using the "ant" command. -

- - The "ant" command is only available on your system if you've properly - installed Apache Ant and added Ant's location to the PATH - environment variable. - -

- The file build.xml in the FOP root directory is the blueprint that Ant uses for the build. It - contains information for numerous build targets, many of which are building blocks to more - useful target, and others which are primarily used by the FOP developers. - You may benefit from looking through this file to learn more about the various build targets. - To obtain a complete list of useful build targets: -

- ant -projecthelp -

The most useful targets are:

-
    -
  • - package: Generates the JAR files (default). This is the normal build that - produces a jar file usable for running FOP. -
  • -
  • - clean : Cleans the build directory. This is useful for making sure that - any build errors are cleaned up before starting a new build. It should not ordinarily be - needed, but may be helpful if you are having problems with the build process itself. -
  • -
  • - javadocs: Generates javadocs. This creates the FOP API documentation. -
  • -
-

To run the build:

- ant [target ...] -

For example to do a normal build for the "all" target (which is the default):

- ant -

OR

- ant all -

To clean the build directory first:

- ant clean all - - If you want to shorten the build time you can just call the "package" target which - doesn't perform any automated tests during the build. - -
-
- Troubleshooting -

If you have problems building FOP, please try the following:

-
    -
  • Run the build with the target of "clean", then rerun the build.
  • -
  • Delete the build directory completely, then rerun the build.
  • -
  • - Make sure you do not have a non-FOP version of xerces.jar, xalan.jar, batik.jar, - or another dependency product somewhere in your CLASSPATH. -
  • -
  • - If the build still fails, see the Getting Help - page for further help. -
  • -
-
- -
- diff --git a/src/documentation/content/xdocs/0.91/configuration.xml b/src/documentation/content/xdocs/0.91/configuration.xml deleted file mode 100644 index 0b845bcf9..000000000 --- a/src/documentation/content/xdocs/0.91/configuration.xml +++ /dev/null @@ -1,184 +0,0 @@ - - - - - -
- Apache FOP: Configuration - $Revision$ -
- - -
- 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 -

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

- -

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

-
-
-
- Summary of the General Configuration Options - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ElementData Type (for the value)Default Value
baseURLSpecifies the base URL based on which relative URL will be resolved.
source-resolutionInteger, dpi - Resolution in dpi (dots per inch) which is used internally to determine the pixel - size for SVG images and bitmap images without resolution information. -
target-resolutionInteger, dpi - Resolution in dpi (dots per inch) used to specify the output resolution for bitmap - images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps - generated by Apache Batik for filter effects and such. -
strict-validationBoolean (true, false) - Setting this option to 'false' causes FOP to be more forgiving about XSL-FO validity, - for example, you're allowed to specify a border on a region-body which is supported - by some FO implementations but is non-standard. Note that such a border would - currently have no effect in Apache FOP.
break-indent-inheritanceBoolean (true, false) - Setting this option to 'true' causes FOP to use an alternative rule set to determine - text indents specified through margins, start-indent and end-indent. Many commercial - FO implementations have chosen to break the XSL specification in this aspect. This - option tries to mimic their behaviour. Please note that Apache FOP may still not - behave exactly like those implementations either because FOP has not fully matched - the desired behaviour and because the behaviour among the commercial implementations - varies. The default for this option (i.e. false) is to behave exactly like the - specification describes.
default-page-settingsn/a - Specifies the default width and height of a page if "auto" is specified - for either or both values. Use "height" and "width" attributes on the - default-page-settings element to specify the two values.
renderers(see text below)Contains the configuration for each renderer. See below.
-

- This is an excerpt from the example configuration file coming with FOP: -

- - - - ./ - - - 72 - - 72 - - - - - -]]> -
-
- 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: -

- - - - - flate - - - - - - - - - - - - - - - ]]> -

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

-
- -
- diff --git a/src/documentation/content/xdocs/0.91/embedding.xml b/src/documentation/content/xdocs/0.91/embedding.xml deleted file mode 100644 index 71b2e2a0e..000000000 --- a/src/documentation/content/xdocs/0.91/embedding.xml +++ /dev/null @@ -1,619 +0,0 @@ - - - - - - -
- Apache FOP: Embedding - How to Embed FOP in a Java application - $Revision$ -
- - -
- 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, instantiate org.apache.fop.apps.Fop. - You'll tell FOP in the constructor which output format (i.e. Renderer) to use. - Afterwards, you'll set the OutputStream to use to output the results of the - rendering (where applicable). You can customize FOP's behaviour 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 instance to which you can send your - FO file. -

-
-
- Basic Usage Pattern -

- Apache FOP relies heavily on JAXP. It uses SAX events exclusively to receive the XSL-FO - input document. It is therefore a good idea that you know a few things about JAXP (which - is a good skill anyway). Let's look at the basic usage pattern for FOP... -

-

Here is the basic pattern to render an XSL-FO file to PDF: -

- -

- Let's discuss these 5 steps in detail: -

-
    -
  • - Step 1: You create a new Fop instance and set it up for PDF - output. -
  • -
  • - Step 2: You tell FOP where to save the generated PDF file - later. It's a good idea to buffer the OutputStream as demonstrated to improve - performance. -
  • -
  • - Step 3: We recommend that you use JAXP Transformers even - if you don't do XSLT transformations to generate the XSL-FO file. This way - you can always use the same basic pattern. The example here sets up an - "identity transformer" which just passes the input (Source) unchanged to the - output (Result). You don't have to work with a SAXParser if you don't do any - XSLT transformations. -
  • -
  • - Step 4: Here you set up the input and output for the XSLT - transformation. The Source object is set up to load the "myfile.fo" file. - The Result is set up so the output of the XSLT transformation is sent to FOP. - The FO file is sent to FOP in the form of SAX events which is the most efficient - way. Please always avoid saving intermediate results to a file or a memory buffer - because that affects performance negatively. -
  • -
  • - Step 5: Finally, we start the XSLT transformation by starting - the JAXP Transformer. As soon as the JAXP Transformer starts to send its output - to FOP, FOP itself starts its processing in the background. When the - transform() method returns FOP will also have finished converting - the FO file to a PDF file and you can close the OutputStream. - - It's a good idea to enclose the whole conversion in a try..finally statement. If - you close the OutputStream in the finally section, this will make sure that the - OutputStream is properly closed even if an exception occurs during the conversion. - -
  • -
-

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

- - Please be aware that you should not reuse a Fop instance for additional rendering runs. - Recreate a new instance for each rendering run. This is a relatively inexpensive - operation and will be further optimized shortly. - -
- 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. -

- - We know this may be an issue in multi-threaded server environments if you'd like to - know what's going on in every single FOP processing run. We're planning to add an - additional feedback facility to FOP which can be used to obtain all sorts of specific - feedback (validation messages, layout problems etc.). "Static logging" is mainly - interesting for a developer working on FOP and for advanced users who are debugging - FOP. We don't consider the logging output to be useful to normal FOP users. Please - have some patience until we can add this feature or jump in and help us build it. We've - set up a Wiki page - which documents what we're going to build. - -

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

-
- -
- 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() methods 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 simply XSL-FO document. -

-
- -
- 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: -

- -
-
-
- Input Sources -

- The input XSL-FO document is always handled internally as SAX (see the - Parsing Design Document for the rationale). -

-

- However, you may not always have your input document available as a SAX stream. - But with JAXP it's easy to convert different input sources to a SAX stream so you - can pipe it into FOP. That sounds more difficult than it is. You simply have - to set up the right Source instance as input for the JAXP transformation. - A few examples: -

-
    -
  • - URL: Source src = new StreamSource("http://localhost:8080/testfile.xml"); -
  • -
  • - File: Source src = new StreamSource(new File("C:/Temp/myinputfile.xml")); -
  • -
  • - String: Source src = new StreamSource(new StringReader(myString)); //myString is a String -
  • -
  • - InputStream: Source src = new StreamSource(new MyInputStream(something)); -
  • -
  • - Byte Array: Source src = new StreamSource(new ByteArrayInputStream(myBuffer)); //myBuffer is a byte[] here -
  • -
  • - DOM: Source src = new DOMSource(myDocument); //myDocument is a Document or a Node -
  • -
  • - Java Objects: Please have a look at the Embedding examples which contains an example for this. -
  • -
-

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

- Apache FOP provides a class called FOUserAgent which is used to customize FOP's - behaviour. If you wish to do that, the first step is to create your own instance - of FOUserAgent and pass that to the Fop constructor: -

- -

- You can do all sorts of things on the user agent: -

-
    -
  • -

    - The base URL to use when resolving relative URLs. Example: -

    - userAgent.setBaseURL("file:///C:/Temp/"); -
  • -
  • -

    - Disable strict validation. When disabled FOP is less strict about the rules established by the XSL-FO specification. Example: -

    - userAgent.setStrictValidation(false); -
  • -
  • -

    - Set the producer of the document. This is metadata information that can be used for certain output formats such as PDF. The default producer is "Apache FOP". Example: -

    - userAgent.setProducer("MyKillerApplication"); -
  • -
  • -

    - Set the creating user of the document. This is metadata information that can be used for certain output formats such as PDF. Example: -

    - userAgent.setCreator("John Doe"); -
  • -
  • -

    - Set the author of the document. This is metadata information that can be used for certain output formats such as PDF. Example: -

    - userAgent.setAuthor("John Doe"); -
  • -
  • -

    - Override the creation date and time of the document. This is metadata information that can be used for certain output formats such as PDF. Example: -

    - userAgent.setCreationDate(new Date()); -
  • -
  • -

    - Set the title of the document. This is metadata information that can be used for certain output formats such as PDF. Example: -

    - userAgent.setTitle("Invoice No 138716847"); -
  • -
  • -

    - Set the keywords of the document. This is metadata information that can be used for certain output formats such as PDF. Example: -

    - userAgent.setKeywords("XML XSL-FO"); -
  • -
  • -

    - Set the source resolution for the document. This is used internally to determine the pixel - size for SVG images and bitmap images without resolution information. Default: 72 dpi. Example: -

    - userAgent.setSourceResolution(96); //=96dpi (dots/pixels per Inch) -
  • -
  • -

    - Set the target resolution for the document. This is used to - specify the output resolution for bitmap images generated by bitmap renderers - (such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter - effects and such. Default: 72 dpi. Example: -

    - userAgent.setTargetResolution(300); //=300dpi (dots/pixels per Inch) -
  • -
  • -

    - Set your own Renderer instance. If you want to supply your own renderer or - configure a Renderer in a special way you can give the instance to the FOUserAgent. Normally, - the Renderer instance is created by FOP. Example: -

    - userAgent.setRendererOverride(myRenderer); //myRenderer is an org.apache.fop.render.Renderer -
  • -
  • -

    - Set your own FOEventHandler instance. If you want to supply your own FOEventHandler or - configure an FOEventHandler subclass in a special way you can give the instance to the FOUserAgent. Normally, - the FOEventHandler instance is created by FOP. Example: -

    - userAgent.setFOEventHandlerOverride(myFOEventHandler); //myFOEventHandler is an org.apache.fop.fo.FOEventHandler -
  • -
  • -

    - Manually add a ElementMapping instance. If you want to supply a special FOP extension - you can give the instance to the FOUserAgent. Normally, the FOP extensions can be automatically detected - (see the documentation on extension for more info). -

    - userAgent.addElementMapping(myElementMapping); //myElementMapping is a org.apache.fop.fo.ElementMapping -
  • -
  • -

    - Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add - custom URI resolution functionality to FOP. For example, you can use - Apache XML Commons Resolver to make use of XCatalogs. -

    - userAgent.setURIResolver(myResolver); //myResolver is a javax.xml.transform.URIResolver -
  • -
  • -

    - Set the parameters for PDF encryption for the document. If you create PDF files you can - instantiate and set an org.apache.fop.pdf.PDFEncryptionParams object. Example: -

    - userAgent.setPDFEncryptionParams(new PDFEncryptionParams(null, "owner", false, false, true, true)); -
  • -
  • -

    - Enable an alternative set of rules for text indents that tries to mimic the behaviour of many commercial - FO implementations that chose to break the specification in this aspect. The default of this option is - 'false' which causes Apache FOP to behave exactly as describes in the specification. To enable the - alternative behaviour, call: -

    - userAgent.setBreakIndentInheritanceOnReferenceAreaBoundary(true); -
  • -
- - You should not reuse an FOUserAgent instance between FOP rendering runs although you can. Especially - in multi-threaded environment, this is a bad idea. - -
-
- Using a Configuration File -

- Instead of setting the parameters manually in code as shown above you can also set - many values from an XML configuration file: -

- -

- The layout of the configuration file is described on the Configuration page. -

-
-
- Hints -
- Object reuse -

- At the moment, the Fop instances shouldn't be reused. Please recreate - Fop and FOUserAgent instances for each rendering run until further notice. - We will likely add an additional object which will carry information - and configuration which can be reused between rendering runs to further - optimize this. -

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

- To get the number of pages that were rendered by FOP you can call - Fop.getResults(). This returns a FormattingResults object - where you can lookup the number of pages produced. It also gives you the - page-sequences that were produced along with their id attribute and their - number 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 -

- There are several options to consider: -

-
    -
  • - Whenever possible, try to use SAX to couple the individual components involved - (parser, XSL transformer, SQL datasource etc.). -
  • -
  • - Depending on the target OutputStream (in case of an FileOutputStream, but not - for a ByteArrayOutputStream, for example) it may improve performance considerably - if you buffer the OutputStream using a BufferedOutputStream: - fop.setOutputStream(new java.io.BufferedOutputStream(out)); -
    - Make sure you properly close the OutputStream when FOP is finished. -
  • -
  • - Cache the stylesheet. If you use the same stylesheet multiple times - you can setup a JAXP Templates object and reuse it each time you do - the XSL transformation. (More information can be found - here.) -
  • -
  • - Use an XSLT compiler like XSLTC - that comes with Xalan-J. -
  • -
-
-
- Multithreading FOP -

- Apache FOP may currently not be completely thread safe. - FOP uses some static variables (for example for the image cache). This code - has not been fully tested for multi-threading issues, yet. -

-

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

- The directory "{fop-dir}/examples/embedding" contains several working examples. - In contrast to the examples above the examples here primarily use JAXP for - XML access. This may be easier to understand for people familiar with JAXP. -

-
- ExampleFO2PDF.java -

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

-
-
-
- ExampleXML2FO.java -

This - - example -has nothing to do with FOP. It is there to show you how an XML -file can be converted to XSL-FO using XSLT. The JAXP API is used to do the -transformation. Make sure you've got a JAXP-compliant XSLT processor in your -classpath (ex. Xalan). -

-
-
-
- ExampleXML2PDF.java -

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 -

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 a -project team with several members which exist as Java objects to XML. -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 -

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

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

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

-
-
- -
- diff --git a/src/documentation/content/xdocs/0.91/extensions.xml b/src/documentation/content/xdocs/0.91/extensions.xml deleted file mode 100644 index 71fff1e09..000000000 --- a/src/documentation/content/xdocs/0.91/extensions.xml +++ /dev/null @@ -1,106 +0,0 @@ - - - - - -
- Standard FOP Extensions - $Revision$ -
- -

- 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, 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 required the correct use of an appropriate namespace in your input document. -
- SVG -

- Please see the SVG documentation for more details. -

-
-
- 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://xml.apache.org/fop/extensions to the root element: -

- ]]> - Currently, no extensions are implemented in FOP Trunk which use the FOP extension namespace. -
-
- 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 -

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

- -
-
- Table Continuation Label -

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

- -
-
- -
- diff --git a/src/documentation/content/xdocs/0.91/fonts.xml b/src/documentation/content/xdocs/0.91/fonts.xml deleted file mode 100644 index 993fa047e..000000000 --- a/src/documentation/content/xdocs/0.91/fonts.xml +++ /dev/null @@ -1,273 +0,0 @@ - - - - - -
- Apache FOP: Fonts - $Revision$ - - - - -
- -
- Summary - The FOP Font subsystem is currently undergoing a significant change. - The details provided here especially related to the generation of FOP Font - Metrics files and the FOP Font configuration are likely to change substantially - in the future. - -

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RendererBase-14AWT/OSCustomCustom Embedding
PDFyesnoyesyes
PostScriptyesnoyesyes
TXTyes (used for layout but not for output)noyes (used for layout but not for output)no
AWTif available from OSyesyesn/a (display only)
Printif available from OSyesyescontrolled by OS printer driver
RTFn/a (font metrics not needed)n/an/an/a
MIFn/a (font metrics not needed)n/an/an/a
SVGif available from OSyesnono
XMLyesnoyesn/a
-
-
- Base-14 Fonts -

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

-
-
- AWT/Operating System Fonts -

The AWT family of renderers (AWT, Print, SVG), use the Java AWT libraries for font metric information. Through operating system registration, the AWT libraries know what fonts are available on the system, and the font metrics for each one.

-
-
- Custom Fonts -

Support for custom fonts is added by creating font metric files (written in XML) from the actual font files, and registering them with FOP. Currently only Type 1 and TrueType fonts can be added. -More information about fonts can be found at:

- -
- 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 (on JDK 1.4 and later):

- java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar - org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file -

Windows (on JDK 1.3.x):

- java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar;lib\xml-apis.jar; - lib\xercesImpl.jar;lib\xalan.jar;lib\serializer.jar - org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file -

Unix (on JDK 1.4 and later):

- java -cp build/fop.jar:lib/avalon-framework.jar:lib/commons-logging.jar:lib/commons-io.jar - org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file -

Unix (on JDK 1.3.1):

- java -cp build/fop.jar:lib/avalon-framework.jar:lib/commons-logging.jar:lib/commons-io.jar:lib/xml-apis.jar: - lib/xercesImpl.jar:lib/xalan.jar:lib/serializer.jar - org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file -

PFMReader [options]:

-
    -
  • -fn <fontname> By default, FOP uses the fontname from the -.pfm file when embedding the font. Use the "-fn" option to override this name with one you have -chosen. This may be useful in some cases to ensure that applications using the output document -(Acrobat Reader for example) use the embedded font instead of a local font with the same -name.
  • -
- The classpath in the above example has been simplified for readability. -You will have to adjust the classpath to the names of the actual JAR files in the lib directory. -xml-apis.jar, xercesImpl.jar, xalan.jar and serializer.jar are not necessary for JDK version 1.4 or later. - The tool will construct some values (FontBBox, StemV and ItalicAngle) based on assumptions and calculations which are only an approximation to the real values. -FontBBox and Italic Angle can be found in the human-readable part of the PFB file or in the AFM file. -The PFMReader tool does not yet interpret PFB or AFM files, so if you want to be correct, you may have to adjust the values in the XML file manually. -The constructed values however appear to have no visible influence. -
-
- TrueType Font Metrics -

FOP includes TTFReader, which reads the TTF file and generates an appropriate font metrics file for it. -Use it in a similar manner to PFMReader. -For example, to create such a metrics file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:

- java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar - org.apache.fop.fonts.apps.TTFReader [options] - C:\myfonts\cmr10.ttf ttfcm.xml -

TTFReader [options]:

-
    -
  • -d <DEBUG | INFO > Sets the debug level (default is -INFO).
  • -
  • -fn <fontname> Same as for PFMReader.
  • -
  • -ttcname <fontname> If you're reading data from a -TrueType Collection (.ttc file) you must specify which font from the collection you will read -metrics from. -If you read from a .ttc file without this option, the fontnames will be listed for you.
  • -
  • -enc ansi Creates a WinAnsi-encoded font metrics file. -Without this option, a CID-keyed font metrics file is created. -The table below summarizes the differences between these two encoding options as currently -used within FOP. -Please note that this information only applies to TrueType fonts and TrueType collections:
  • -
- - - - - - - - - - - - - - - - - - - - - -
IssueWinAnsiCID-keyed
Usable Character SetLimited to WinAnsi character set, which is roughly equivalent to iso-8889-1.Limited only by the characters in the font itself.
Character Encoding in the Output Document.Correct.Never correct. Search, index, and cut-and-paste operations in the output document -will produce incorrect results.
Character DisplayCorrect.Correct if and only if the font is embedded in the output. (This is possible -because, although the underlying characters are encoded incorrectly, the embedded font is -also encoded incorrectly).
- As shown in the above table, regardless of -whether the font is embedded or not, text generated from a CID-keyed font metrics file -will never be encoded properly. -Further, if the related font is not embedded, it cannot even be displayed properly. -Obviously, this behavior is not desirable, and we hope to correct it in upcoming releases. -
-
- TrueType Collections Font Metrics -

TrueType collections (.ttc files) contain more than one font. -To create metrics files for these fonts, you must specify which font in the collection should be generated, by using the "-ttcname" option with the TTFReader.

-

To get a list of the fonts in a collection, just start the TTFReader as if it were a normal TrueType file (without the -ttcname option). -It will display all of the font names and exit with an Exception.

-

Here is an example of generating a metrics file for a .ttc file:

- java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar - org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho" - msmincho.ttc msminch.xml -
-
- Register Fonts with FOP -

You must tell FOP how to find and use the font metrics files by registering them in the FOP Configuration. Add entries for your custom fonts, regardless of font type, to the configuration file in a manner similar to the following:

- - -]]> - 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. -
    -
  • - URLs are used to access the font metric and font files. - - See FOP: Configuration for more information. - Relative font URLs are currently not possible. You need to specify absolute URLs. Patches are welcome! :-) -
  • -
  • The "kerning" and "embed-url" attributes are optional. Kerning is currently not used at all. If embedding is off, the output will position the text correctly (from the metrics file), but it will not be displayed or printed correctly unless the viewer has the applicable font available to their local system.
  • -
  • When setting the embed-url attribute for Type 1 fonts, be sure to specify the PFB (actual font data), not PFM (font metrics) file that you used to generate the XML font metrics file.
  • -
- -
-
- Embedding - The PostScript renderer does not yet support TrueType fonts, but can embed Type 1 fonts. - The font is simply embedded into the PDF file, it is not converted. -

Font embedding is enabled in the userconfig.xml file and controlled by the embed-url attribute. -If you don't specify the embed-url attribute the font will not be embedded, but will only be referenced.

-

When FOP embeds a font, it adds a prefix to the fontname to ensure that the name will not match the fontname of an installed font. -This is helpful with older versions of Acrobat Reader that preferred installed fonts over embedded fonts.

-

When embedding PostScript fonts, the entire font is always embedded.

-

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. -Currently, this embedded font contains only the minimum data needed to be embedded in a pdf document, and does not contain any codepage information. -The PDF document contains indexes to the glyphs in the font instead of to encoded characters. -While the document will be displayed correctly, the net effect of this is that searching, indexing, and cut-and-paste will not work properly.

-

One workaround for this behavior is to use the "-enc ansi" option when generating metrics with TTFReader. -This will cause the whole font to be embedded in the pdf document. -Characters will be WinAnsi encoded (as specified in the PDF spec), so you lose the ability to use characters from other character sets. -See Table of TTF Encoding Options for more details.

-
-
- -
diff --git a/src/documentation/content/xdocs/0.91/graphics.xml b/src/documentation/content/xdocs/0.91/graphics.xml deleted file mode 100644 index e52f25736..000000000 --- a/src/documentation/content/xdocs/0.91/graphics.xml +++ /dev/null @@ -1,343 +0,0 @@ - - - - - -
- Apache FOP: Graphics Formats - $Revision$ -
- -
- 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 Thru" column for more details. -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FormatTypeFOP native supportBatik SVGBatik codecsImage I/OJAIJIMI
BMP (Microsoft Windows Bitmap)bitmapX
EPS (Encapsulated PostScript)metafile (both bitmap and vector), probably most frequently used for vector drawings(X)
GIF (Graphics Interchange Format)bitmapXXXX
JPEG (Joint Photographic Experts Group)bitmap(X)
PNG (Portable Network Graphic)bitmapX
SVG (Scalable Vector Graphics)vector (with embedded bitmaps)X
TIFF (Tag Image Format File)bitmap(X)XX
- "(X)" means restricted support. Please see the details below. -
-
- Graphics Packages -
- FOP Native -

- FOP has native ability to handle some graphic file formats. -

-
-
- Batik codecs -

- Apache Batik contains codecs for PNG and TIFF access. FOP can use these. -

-
-
- Image I/O (JDK 1.4 or higher) -

- For JDKs 1.4 or higher, FOP 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. -

-
-
- JIMI -

- Because of licensing issues, the JIMI image library is not included in the FOP distribution. First, download and install it. -Then, copy the file "JimiProClasses.zip" from the archive to {fop-install-dir}/lib/jimi-1.0.jar. Please note that FOP binary distributions are compiled with JIMI support, so there is no need for you to build FOP to add the support. If jimi-1.0.jar is installed in the right place, it will automatically be used by FOP, otherwise it will not. -

-
-
- JAI (Java Advanced Imaging API) - JAI support is available for Release 0.20.5 and later. The comments in this section do not apply to releases earlier than 0.20.5. -

- FOP has been compiled with JAI support, but JAI is not included in the FOP distribution. -To use it, install JAI, then copy the jai_core.jar and the jai_codec.jar files to {fop-install-dir}/lib. -JAI is much faster than JIMI, but is not available for all platforms. See What platforms are supported? on the JAI FAQ page for more details. -

-
-
- Batik -

Current FOP distributions include a distribution of the Apache Batik version 1.6. -It is automatically installed with FOP. -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. -

Batik must be run in a graphical environment. -It uses AWT classes for rendering SVG, which in turn require an X server on Unixish systems. -If you run a server without X, or if you can't connect to the X server due to security restrictions or policies (a so-called "headless" environment), SVG rendering will fail.

-

Here are some workarounds:

-
    -
  • If you are using JDK 1.4, start it with the -Djava.awt.headless=true command line option.
  • -
  • Install an X server which provides an in-memory framebuffer without actually using a screen device or any display hardware. One example is Xvfb.
  • -
  • 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.
  • -
-
-
-
- BMP -

FOP native support for BMP images is limited to the RGB color-space.

-
-
- EPS -

FOP provides support for two output targets:

-
    -
  • PostScript (full support).
  • -
  • - PDF (partial support). Due to the lack of a built-in PostScript interpreter, FOP - can only embed the EPS file into the PDF. Acrobat Reader will not currently display - the EPS (it doesn't have a PostScript interpreter, either) but it will be shown - correctly when you print the PDF on a PostScript-capable printer. PostScript devices - (including GhostScript) will render the EPS correctly. -
  • -
-

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

-
-
- JPEG -

FOP native support 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. -

-
-
- PNG -

If using JAI for PNG support, only RGB and RGBA color-spaces are supported for FOP rendering.

-
-
- SVG -
- Introduction -

FOP uses 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. -

-

-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 this graphic may not -be ideal depending on the FOP dpi (72dpi) and the scaling for that graphic. -We hope to improve this in the future.

-

-Currently transparency is not supported in PDF so many svg images that -contain effects or graphics with transparent areas will not be displayed -correctly. -

-
-
- Placing SVG Text into PDF -

If possible, Batik will use normal PDF 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 -shows how various types and effects with text are handled. -Note that tspan and outlined text are not yet implemented.

-

-Otherwise, 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 pdf files large and when the pdf is viewed the -viewer does not normally draw those fine curves very well (turning on -Smooth Line Art in the Acrobat preferences will fix this). -If the text is inserted into the PDF using the inbuilt text commands -for PDF it will use a single character. -

-

-For PDF output, there is a configuration option to force SVG text to be rendered as text. -The drawback to this approach is that it is effective only for available fonts (including embedded fonts). -Font sizes are rounded to the next integer point size. -This will be improved in the future. -

-

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.

-
-
- 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. -FOP will probably implement a scaling mechanism in the future.

-
-
- 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 -
  • -
  • -there is some problem with a gradient inside a pattern causing a pdf -error when viewed in acrobat 5 -
  • -
  • -text is not always handled correctly, it may select the wrong font -especially if characters have multiple fonts in the font list -
  • -
  • -more pdf text handling could be implemented -It could draw the string using the attributed character iterator -to handle tspans and other simple changes of text. -
  • -
  • -JPEG images are not inserted directly into the pdf document -This area has not been implemented yet since the appropriate -method in batik is static -
  • -
  • -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 -

FOP-native TIFF support is limited to PDF and PostScript output only. Also, according to user reports, FOP's native support for TIFF is limited to images with the following characteristics (all must be true for successful rendering):

-
    -
  • single channel images (i.e., bi-level and grayscale only)
  • -
  • uncompressed images, or images using CCITT T.4, CCITT T.6, or JPEG compression
  • -
  • images using white-is-zero encoding in the TIFF PhotometricInterpretation tag
  • -
-

JAI: Supports RGB and RGBA only for FOP rendering.

-
-
- Graphics Resolution -

Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution value. Since PDF and most output formats do not have a concept of resolution, but only of absolute image units (i.e. pixels) FOP ignores the resolution values as well. Instead, FOP uses the dimensions of the image as specified in the fo:external-graphic element to render the image:

-
    -
  • If no dimensions are given, FOP uses a default value of 72 dpi to compute the graphic's dimensions. For example, suppose a graphic 300 pixels wide and 400 pixels high. FOP will render the graphic at 4.167 inches wide, 5.555 inches high, with an apparent resolution of 72 dpi.
  • -
  • If only one dimension is given, FOP by default uses the same aspect ratio to compute the other dimension (to avoid the appearance of stretching). For example, suppose a graphic 300 pixels wide and 400 pixels high, for which content-width = ".5in". FOP will compute the content-height = .667 inches, and will render the graphic at that size, with an apparent resolution of 600 dpi.
  • -
  • If both dimensions are given, FOP simply renders the image in that space. For example, suppose a graphic 300 pixels wide and 400 pixels high, for which content-width = "3in" and content-height = "4in". FOP will render the graphic at that size, with an apparent resolution of 100 dpi.
  • -
-

If you need a higher apparent output resolution for bitmapped images, first make sure that at least one dimension of the image is defined in your XSL-FO input. Apart from that, resolution problems are in the image file itself, and must be corrected there: use or create a higher-resolution image file.

- The explanation above describes only the basic default behavior. There are other attributes of the fo:external-graphic element that can affect the behavior described above. -
-
- Image caching -

- FOP caches images between runs. The URL is used as a key to identify images which means that when - a particular URL 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 URL you need to use a constantly - changing dummy parameter on the URL to avoid caching. -

-

- The image cache has been improved considerably in the redesigned code. Therefore, a resetCache() method - has become unnecessary. If you still experience OutOfMemoryErrors, please notify us. -

-
- -
diff --git a/src/documentation/content/xdocs/0.91/hyphenation.xml b/src/documentation/content/xdocs/0.91/hyphenation.xml deleted file mode 100644 index 3340f9c4f..000000000 --- a/src/documentation/content/xdocs/0.91/hyphenation.xml +++ /dev/null @@ -1,236 +0,0 @@ - - - - - -
- Apache FOP: Hyphenation - $Revision$ -
- -
- Hyphenation Support -
- Introduction -

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. -
-
- License Issues -

Many of the hyphenation files distributed with TeX and its offspring are - licenced under the LaTeX - Project Public License (LPPL), 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.

-

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.

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

To install a custom hyphenation pattern for use with FOP:

-
    -
  1. Convert the TeX hyphenation pattern file to the FOP format. The FOP - format is an xml file conforming to the DTD found at - {fop-dir}/hyph/hyphenation.dtd.
  2. -
  3. Name this new file following this schema: - languageCode_countryCode.xml. The country code is - optional, and should be used only if needed. For example: -
      -
    • en_US.xml would be the file name for American - English hyphenation patterns.
    • -
    • it.xml would be the file name for Italian - hyphenation patterns.
    • -
    - The language and country codes must match the XSL-FO input, which - follows ISO - 639 (languages) and ISO - 3166 (countries). NOTE: The ISO 639/ISO 3166 convention is that - language names are written in lower case, while country codes are written - in upper case. FOP does not check whether the language and country specified - in the FO source are actually from the current standard, but it relies - on it being two letter strings in a few places. So you can make up your - own codes for custom hyphenation patterns, but they should be two - letter strings too (patches for proper handling extensions are welcome)
  4. -
  5. There are basically three ways to make the FOP-compatible hyphenation pattern - file(s) accessible to FOP: -
      -
    • Download the precompiled JAR from OFFO - and place it either in the {fop-dir}/lib directory, or - in a directory of your choice (and append the full path to the JAR to - the environment variable FOP_HYPHENATION_PATH).
    • -
    • Download the desired FOP-compatible hyphenation pattern file(s) from - OFFO, - and/or take your self created hyphenation pattern file(s), -
        -
      • place them in the directory {fop-dir}/hyph,
      • -
      • or place them in a directory of your choice and set the Ant variable - user.hyph.dir to point to that directory (in - build-local.properties),
      • -
      - and run Ant with build target - jar-hyphenation. This will create a JAR containing the - compiled patterns in {fop-dir}/build that will be added to the - classpath on the next run. - (When FOP is built from scratch, and there are pattern source file(s) - present in the directory pointed to by the - user.hyph.dir variable, this JAR will automatically - be created from the supplied pattern(s)).
    • -
    • Put the pattern source file(s) into a directory of your choice and - configure FOP to look for custom patterns in this directory, by setting the - <hyphenation-dir> - configuration option.
    • -
    -
  6. -
- - 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 - <hyphenation-dir> - configuration option programmatically (option 3). - -
-
-
- Hyphenation Patterns -

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 - OFFO's Hyphenation page for examples. - Here is a brief explanation of the contents of FOP's hyphenation patterns:

- 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 - FOP User mailing list, either - confirming their accuracy, or raising specific problems that we can - address. -
    -
  • The root of the pattern file is the <hyphenation-info> element.
  • -
  • <hyphen-char>: its attribute "value" contains the character signalling - a hyphen in the <exceptions> section. It has nothing to do with the - hyphenation character used in FOP, use the XSLFO hyphenation-character - property for defining the hyphenation character there. At some points - a dash U+002D is hardwired in the code, so you'd better use this too - (patches to rectify the situation are welcome). There is no default, - if you declare exceptions with hyphenations, you must declare the - hyphen-char too.
  • -
  • <hyphen-min> contains two attributes: -
      -
    • before: the minimum number of characters in a word allowed to exist - on a line immediately preceding a hyphenated word-break.
    • -
    • after: the minimum number of characters in a word allowed to exist - on a line immediately after a hyphenated word-break.
    • -
    - This element is unused and not even read. It should be considered a - documentation for parameters used during pattern generation. -
  • -
  • <classes> contains whitespace-separated character sets. The members - of each set should be treated as equivalent for purposes of hyphenation, - usually upper and lower case of the same character. The first character - of the set is the canonical character, the patterns and exceptions - should only contain these canonical representation characters (except - digits for weight, the period (.) as word delimiter in the patterns and - the hyphen char in exceptions, of course).
  • -
  • <exceptions> contains whitespace-separated words, each of which - has either explicit hyphen characters to denote acceptable breakage - points, or no hyphen characters, to indicate that this word should - never be hyphenated, or contain explicit <hyp> elements for specifying - changes of spelling due to hyphenation (like backen -> bak-ken or - Stoffarbe -> Stoff-farbe in the old german spelling). Exceptions override - the patterns described below. Explicit <hyp> declarations don't work - yet (patches welcome). Exceptions are generally a bit brittle, test - carefully.
  • -
  • <patterns> includes whitespace-separated patterns, which are what - drive most hyphenation decisions. The characters in these patterns are - explained as follows: -
      -
    • non-numeric characters represent characters in a sub-word to be - evaluated
    • -
    • the period character (.) represents a word boundary, i.e. either - the beginning or ending of a word
    • -
    • numeric characters represent a scoring system for indicating the - acceptability of a hyphen in this location. Odd numbers represent an - acceptable location for a hyphen, with higher values overriding lower - inhibiting values. Even numbers indicate an unacceptable location, with - higher values overriding lower values indicating an acceptable position. - A value of zero (inhibiting) is implied when there is no number present. - Generally patterns are constructed so that valuse greater than 4 are rare. - Due to a bug currently patterns with values of 8 and greater don't - have an effect, so don't wonder.
    • -
    - Here are some examples from the English patterns file: -
      -
    • Knuth (The TeXBook, Appendix H) uses the example hach4, which indicates that it is extremely undesirable to place a hyphen after the substring "hach", for example in the word "toothach-es".
    • -
    • .leg5e indicates that "leg-e", when it occurs at the beginning of a word, is a very good place to place a hyphen, if one is needed. Words like "leg-end" and "leg-er-de-main" fit this pattern.
    • -
    - Note that the algorithm that uses this data searches for each of the word's substrings in the patterns, and chooses the highest value found for letter combination. -
  • -
-

If you want to convert a TeX hyphenation pattern file, you have to undo - the TeX encoding for non-ASCII text. FOP uses Unicode, and the patterns - must be proper Unicode too. You should be aware of the XML encoding issues, - preferably use a good Unicode editor.

-

Note that FOP does not do Unicode character normalization. If you use - combining chars for accents and other character decorations, you must - declare character classes for them, and use the same sequence of base character - and combining marks in the XSLFO source, otherwise the pattern wouldn't match. - Fortunately, Unicode provides precomposed characters for all important cases - in common languages, until now nobody run seriously into this issue. Some dead - languages and dialects, especially ancient ones, may pose a real problem - though.

-

If you want to generate your own patterns, an open-source utility called - patgen is available on many Unix/Linux distributions and every TeX - distribution which can be used to assist in - creating pattern files from dictionaries. Pattern creation for languages like - english or german is an art. If you can, read Frank Liang's original paper - "Word Hy-phen-a-tion by Com-pu-ter" (yes, with hyphens). It is not available - online. The original patgen.web source, included in the TeX source distributions, - contains valuable comments, unfortunately technical details obscure often the - high level issues. Another important source is - The - TeX Book, appendix H (either read the TeX source, or run it through - TeX to typeset it). Secondary articles, for example the works by Petr Sojka, - may also give some much needed insight into problems arising in automated - hyphenation.

-
- -
diff --git a/src/documentation/content/xdocs/0.91/index.xml b/src/documentation/content/xdocs/0.91/index.xml deleted file mode 100644 index 4d5e12b06..000000000 --- a/src/documentation/content/xdocs/0.91/index.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - -
- Apache FOP 0.91 beta - $Revision: 201586 $ -
- -
- Introduction -

- The Apache FOP team is proud to present to you the largely rewritten codebase which is - finally in a state where you can start to use it. It has taken over three years to get this - far and over two years without a new release from the FOP project. We would like to encourage - you to download the code and to play with it. We're still in the process of adding new major - features and stabilizing the code. We welcome any feedback you might have and even more, any - other form of help to get the project forward. -

-

- This second release is mostly a bug fix release but also contains a few new features compared - to 0.90alpha1. To see what has changed since the last release, please visit the - Changes Page and the Release Notes. -

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

- To download this version, please visit the download page. -

-
- -
diff --git a/src/documentation/content/xdocs/0.91/output.xml b/src/documentation/content/xdocs/0.91/output.xml deleted file mode 100644 index 8402a9075..000000000 --- a/src/documentation/content/xdocs/0.91/output.xml +++ /dev/null @@ -1,378 +0,0 @@ - - - - - - -
- Apache FOP Output Formats - $Revision$ - - - - -
- - -

- FOP supports multiple output formats by using a different renderer for each format. - The renderers do not all have the same set of capabilities, sometimes because of - the output format itself, sometimes because some renderers get more development - attention than others. -

-
- General Information -
- Fonts -

- Most FOP renderers use a FOP-specific system for font registration. - However, the Java2D/AWT and print renderers use the Java AWT package, which gets its - font information from the operating system registration. - This can result in several differences, including actually using different fonts, - and having different font metrics for the same font. - The net effect is that the layout of a given FO document can be quite different between - renderers that do not use the same font information. -

-
-
- Output to a Printer or Other Device -

- The most obvious way to print your document is to use the FOP - print renderer, which uses the Java2D API (AWT). - However, you can also send output from the Postscript renderer directly to a Postscript - device, or output from the PCL renderer directly to a PCL device. -

-

- Here are Windows command-line examples for Postscript and PCL: -

- - -

- Here is some Java code to accomplish the task in UNIX: -

- -

- Set the OutputStream (out) to the PCLRenderer and it happily sends the - PCL to the UNIX printer queue. -

-
-
-
- PDF -

- PDF is the best supported output format. It is also the most accurate - with text and layout. This creates a PDF document that is streamed out - as each page is rendered. This means that the internal page index - information is stored near the end of the document. - The PDF version supported is 1.4. PDF versions are forwards/backwards - compatible. -

-

- Note that FOP does not currently support "tagged PDF", PDF/X or PDF/A. -

-
- Fonts -

- PDF has a set of fonts that are always available to all PDF viewers, - to quote from the PDF Specification: - - "PDF prescribes a set of 14 standard fonts that can be used without prior - definition. - These include four faces each of three Latin text typefaces (Courier, - Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf - Dingbats). These fonts, or suitable substitute fonts with the same metrics, are - guaranteed to be available in all PDF viewer applications." -

-
-
- Post-processing -

- FOP does not currently support several desirable PDF features: XMP metadata and watermarks. - One workaround is to use Adobe Acrobat (the full version, not the Reader) to process - the file manually or with scripting that it supports. -

-

- Another popular post-processing tool is iText, - which has tools for adding security features, document properties, watermarks, and many - other features to PDF files. -

- - Caveat: iText may swallow PDF bookmarks. But - Jens Stavnstrup tells us - that this doesn't happen if you use iText's PDFStamper. - -

- Here is some sample code that uses iText to encrypt a FOP-generated PDF. (Note that FOP now - supports PDF encryption. However the principles for using - iText for other PDF features are similar.) -

- -

- Check the iText tutorial and documentation for setting access flags, password, - encryption strength and other parameters. -

-
-
- Watermarks -

- In addition to the PDF Post-processing options, consider the following workarounds: -

-
    -
  • - Use a background image for the body region. -
  • -
  • - (submitted by Trevor Campbell) Place an image in a - region that overlaps the flowing text. For example, make - region-before large enough to contain your image. Then include a - block (if necessary, use an absolutely positioned block-container) - containing the watermark image in the static-content for the - region-before. Note that the image will be drawn on top of the - normal content. -
  • -
-
-
-
- PostScript -

- The PostScript renderer has been brought up to a similar quality as the - PDF renderer, but may still be missing certain features. It provides good - support for most text and layout. - Images and SVG are not fully supported, yet. Currently, the PostScript - renderer generates PostScript Level 3 with most DSC comments. Actually, - the only Level 3 feature used is FlateDecode, everything else is Level 2. -

-
- Limitations -
    -
  • Images and SVG may not be display correctly. SVG support is far from being complete. No image transparency is available.
  • -
  • Only Type 1 fonts are supported.
  • -
  • Multibyte characters are not supported.
  • -
  • PPD support is still missing.
  • -
  • The renderer is not yet configurable.
  • -
-
-
-
- RTF -

- JFOR, an open source XSL-FO to RTF converter has been integrated into Apache FOP. - This will create an RTF (rich text format) document that will - attempt to contain as much information from the fo document as - possible. The RTF output follows Microsoft's RTF specifications - and produces best results on Microsoft Word. -

-
-
- XML (Area Tree XML) -

- This is for testing and verification. The XML created is simply - a representation of the internal area tree put into XML. It does - not perform any other purpose. -

-
-
- Java2D/AWT - The Java2D/AWT, Print and Bitmap renderers may not yet fully work as expected. There are some known bugs and missing features. -

- The AWT viewer shows a window with the pages displayed inside a - Java graphic. It displays one page at a time. - The fonts used for the formatting and viewing depend on the fonts - available to your JRE. -

-
-
- Print -

- It is possible to directly print the document from the command line. - This is done with the same code that renders to the Java2D/AWT renderer. -

-
-
- Bitmap (TIFF/PNG) -

- It is possible to directly create bitmap images from the individual - pages generated by the layout engine. - This is done with the same code that renders to the Java2D/AWT renderer. -

-

- Currently, two output formats are supported: PNG and TIFF. TIFF produces - one file with multiple pages, while PNG output produces one file per - page. The quality of the bitmap depends on the resolution setting on the - FOUserAgent. -

-
-
- TXT -

- The text renderer produces plain ASCII text output - that attempts to match the output of the PDFRenderer as closely as - possible. This was originally developed to accommodate an archive system - that could only accept plain text files, and is primarily useful for getting - a quick-and-dirty view of the document text. The renderer is very limited, - so do not be surprised if it gives unsatisfactory results. -

-

- The Text renderer works with a fixed size page buffer. The size of this - buffer is controlled with the textCPI and textLPI public variables. - The textCPI is the effective horizontal characters per inch to use. - The textLPI is the vertical lines per inch to use. From these values - and the page width and height the size of the buffer is calculated. - The formatting objects to be rendered are then mapped to this grid. - Graphic elements (lines, borders, etc) are assigned a lower priority - than text, so text will overwrite any graphic element representations. -

-

- Because FOP lays the text onto a grid during layout, there are frequently - extra or missing spaces between characters and lines, which is generally - unsatisfactory. - Users have reported that the optimal settings to avoid such spacing problems are: -

-
    -
  • font-family="Courier"
  • -
  • font-size="7.3pt"
  • -
  • line-height="10.5pt"
  • -
-
-
- Output Formats in the Sandbox -

- Due to the state of certain renderers we moved some of them to a "sandbox" area until - they are ready for more serious use. The renderers and FOEventHandlers in the sandbox - can be found under src/sandbox and are compiled into build/fop-sandbox.jar during the - main build. The output formats in the sandbox are marked as such below. -

-
- PCL - The PCL Renderer is in the sandbox and not yet functional in FOP Trunk!!! Please help us ressurrect this feature. -

- This format is for the Hewlett-Packard PCL printers. - It should produce output as close to identical as possible to the - printed output of the PDFRenderer within the limitations of the - renderer, and output device. -

- - - -
-
- MIF - The MIF handler is in the sandbox and not yet functional in FOP Trunk!!! Please help us ressurrect this feature. -

- This format is the Maker Interchange Format which is used by - Adobe Framemaker. -

-
-
- SVG - The SVG renderer is in the sandbox and may not work as expected in FOP Trunk!!! Please help us improve this feature. -

- This format creates an SVG document that has links between the pages. - This is primarily for slides and creating svg images of pages. - Large documents will create SVG files that are far too large for - and SVG viewer to handle. Since FO documents usually have text the - SVG document will have a large number of text elements. - The font information for the text is obtained from the JVM in the - same way as the AWT viewer, if the SVG is view where the fonts are - different, such as another platform, then the page may appear wrong. -

-
-
- - -
- diff --git a/src/documentation/content/xdocs/0.91/pdfencryption.xml b/src/documentation/content/xdocs/0.91/pdfencryption.xml deleted file mode 100755 index 2c7742d8d..000000000 --- a/src/documentation/content/xdocs/0.91/pdfencryption.xml +++ /dev/null @@ -1,221 +0,0 @@ - - - - - -
- PDF encryption. - $Revision$ - - - - -
- -
- Overview - - PDF Encryption is available in Release 0.20.5 and later. The comments on this page do - not apply to releases earlier than 0.20.5. - -

- FOP supports encryption of PDF output, thanks to Patrick - C. Lankswert. This feature is commonly used to prevent - unauthorized viewing, printing, editing, copying text from the - document and doing annotations. It is also possible to ask the - user for a password in order to view the contents. Note that - there already exist third party applications which can decrypt - an encrypted PDF without effort and allow the aforementioned - operations, therefore the degree of protection is limited. -

-

- For further information about features and restrictions regarding PDF - encryption, look at the documentation coming with Adobe Acrobat or the - technical documentation on the Adobe web site. -

-
-
- Usage (command line) -

- Encryption is enabled by supplying any of the encryption related - options. -

-

- An owner password is set with the -o option. This - password is actually used as encryption key. Many tools for - PDF processing ask for this password to disregard any - restriction imposed on the PDF document. -

-

- If no owner password has been supplied but FOP was asked to apply some - restrictions, a random password is used. In this case it is obviously - impossiible to disregard restrictions in PDF processing tools. -

-

- A user password, supplied with the -u option, will - cause the PDF display software to ask the reader for this password in - order to view the contents of the document. If no user password was - supplied, viewing the content is not restricted. -

-

- Further restrictions can be imposed by using the -noprint, - -nocopy, -noedit and - -noannotations options, which disable printing, copying - text, editing in Adobe Acrobat and making annotations, respectively. -

-
-
- Usage (embedded) -

- When FOP is embedded in another Java application you need to set an - options map on the renderer. These are the supported options: -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescriptionValuesDefault
ownerPasswordThe owner passwordString -
userPasswordThe user passwordString -
allowPrintAllows/disallows printing of the PDF"TRUE" or "FALSE""TRUE"
allowCopyContentAllows/disallows copy/paste of content"TRUE" or "FALSE""TRUE"
allowEditContentAllows/disallows editing of content"TRUE" or "FALSE""TRUE"
allowEditAnnotationsAllows/disallows editing of annotations"TRUE" or "FALSE""TRUE"
- - Encryption is enabled as soon as one of these options is set. - -

- An example to enable PDF encryption in Java code: -

- -

- The parameters for the constructor of PDFEncryptionParams are: -

-
    -
  1. userPassword: String, may be null
  2. -
  3. ownerPassword: String, may be null
  4. -
  5. allowPrint: true if printing is allowed
  6. -
  7. allowCopyContent: true if copying content is allowed
  8. -
  9. allowEditContent: true if editing content is allowed
  10. -
  11. allowEditAnnotations: true if editing annotations is allowed
  12. -
-
-
- Environment -

- In order to use PDF encryption, FOP has to be compiled with - cryptography support. Currently, only JCE - is supported. JCE is part of JDK 1.4. For earlier JDKs, it can - be installed separately. The build process automatically - detects JCE presence and installs PDF encryption support if - possible, otherwise a stub is compiled in. -

-

- Cryptography support must also be present at run time. In particular, a - provider for the RC4 cipher is needed. Unfortunately, the sample JCE - provider in Sun's JDK 1.4 does not provide RC4. If you - get a message saying -

- "Cannot find any provider supporting RC4" -

- then you don't have the needed infrastructure. -

-

- There are several commercial and a few Open Source packages which - provide RC4. A pure Java implementation is produced by The Legion of the Bouncy - Castle. Mozilla - JSS is an interface to a native implementation. -

-
-
- Installing a crypto provider -

- The pure Java implementation from Bouncy Castle is easy to - install. -

-
    -
  1. - Download the binary distribution for your JDK version. If you have JDK - 1.3 or earlier you must also download a JCE from the same page. -
  2. -
  3. - Unpack the distribution. Add the jar file to your classpath. A - convenient way to use the jar on Linux is to simply drop it into the - FOP lib directory, it will be automatically picked up by - fop.sh. If you have JDK 1.3 or earlier don't forget to - install the JCE as well. -
  4. -
  5. - Open the java.security file and add
    - security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider,
    - preferably at the end of the block defining the other crypto - providers. For JDK 1.4 this is detailed on Sun's web site. -
  6. -
-

- If you have any experience with Mozilla JSS or any other - cryptography provider, please post it to the fop-user list. -

-
- -
diff --git a/src/documentation/content/xdocs/0.91/running.xml b/src/documentation/content/xdocs/0.91/running.xml deleted file mode 100644 index 182756359..000000000 --- a/src/documentation/content/xdocs/0.91/running.xml +++ /dev/null @@ -1,277 +0,0 @@ - - - - - -
- Running Apache FOP - $Revision$ -
- - -
- System Requirements -

The following software must be installed:

- -

The following software is optional, depending on your needs:

- -

In addition, the following system requirements apply:

-
    -
  • - If you will be using FOP to process SVG, you must do so in a graphical environment. - See FOP: Graphics (Batik) for details. -
  • -
-
-
- Installation -
- Instructions -

- Basic FOP installation consists of first unzipping the .gz file that is the - distribution medium, then unarchiving the resulting .tar file in a - directory/folder that is convenient on your system. Please consult your operating system - documentation or Zip application software documentation for instructions specific to your - site. -

-
-
- Problems -

- Some Mac OSX users have experienced filename truncation problems using Stuffit to unzip - and unarchive their distribution media. This is a legacy of older Mac operating systems, - which had a 31-character pathname limit. Several Mac OSX users have recommended that - Mac OSX users use the shell command tar -xzf instead. -

-
-
-
- Starting FOP as a Standalone Application -

- The usual and recommended practice for starting FOP from the command line is to run the - batch file fop.bat (Windows) or the shell script fop (Unix/Linux). - If you write your own scripts, be sure to review these standard scripts to make sure that - you get your environment properly configured. -

-

- The standard scripts for starting FOP require that the environment variable JAVA_HOME be - set to a path pointing to the appropriate Java installation on your system. Macintosh OSX - includes a Java environment as part of its distribution. We are told by Mac OSX users that - the path to use in this case is /Library/Java/Home. Caveat: - We suspect that, as Apple releases new Java environments and as FOP upgrades the minimum - Java requirements, the two will inevitably not match on some systems. Please see - Java on Mac OSX FAQ for information as - it becomes available. -

-

- As an alternative to the start scripts you can run "java -jar build/fop.jar" in which case - FOP tries to build the classpath for running FOP dynamically. Please note, that this might - not always work as expected. -

- - [OPTIONS] - -d debug mode - -x dump configuration settings - -q quiet mode - -c cfg.xml use additional configuration file cfg.xml - -l lang the language to use for user information - -r relaxed/less strict validation (where available) - -dpi xxx target resolution in dots per inch (dpi) where xxx is a number - -s for area tree XML, down to block areas only - -v to show FOP version being used - - [INPUT] - infile xsl:fo input file (the same as the next) - -fo infile xsl:fo input file - -xml infile xml input file, must be used together with -xsl - -xsl stylesheet xslt stylesheet - - -param name value to use for parameter in xslt stylesheet - (repeat '-param name value' for each parameter) - - [OUTPUT] - outfile input will be rendered as pdf file into outfile - -pdf outfile input will be rendered as pdf file (outfile req'd) - -awt input will be displayed on screen - -mif outfile input will be rendered as mif file (outfile req'd) - -rtf outfile input will be rendered as rtf file (outfile req'd) - -tiff outfile input will be rendered as tiff file (outfile req'd) - -png outfile input will be rendered as png file (outfile req'd) - -pcl outfile input will be rendered as pcl file (outfile req'd) - -ps outfile input will be rendered as PostScript file (outfile req'd) - -txt outfile input will be rendered as text file (outfile req'd) - -svg outfile input will be rendered as an svg slides file (outfile req'd) - -at outfile representation of area tree as XML (outfile req'd) - -print input file will be rendered and sent to the printer - see options with "-print help" - -out mime outfile input will be rendered using the given MIME type - (outfile req'd) Example: "-out application/pdf D:\out.pdf" - (Tip: "-out list" prints the list of supported MIME types) - - -foout outfile input will only be XSL transformed. The intermediate - XSL-FO file is saved and no rendering is performed. - (Only available if you use -xml and -xsl parameters) - - [Examples] - Fop foo.fo foo.pdf - Fop -fo foo.fo -pdf foo.pdf (does the same as the previous line) - Fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf - Fop -xml foo.xml -xsl foo.xsl -foout foo.fo - Fop foo.fo -mif foo.mif - Fop foo.fo -rtf foo.rtf - Fop foo.fo -print or Fop -print foo.fo - Fop foo.fo -awt]]> -

- PDF encryption is only available if FOP was compiled with encryption support - and if compatible encryption support is availabe at run time. - Currently, only the JCE is supported. Check the Details. -

-
-
- Using Xalan to Check XSL-FO Input -

- FOP sessions that use -xml and -xsl input instead of -fo input are actually - controlling two distinct conversions: Tranforming XML to XSL-FO, then formatting - the XSL-FO to PDF (or another FOP output format). - Although FOP controls both of these processes, the first is included merely as - a convenience and for performance reasons. - Only the second is part of FOP's core processing. - If a user has a problem running FOP, it is important to determine which of these - two processes is causing the problem. - If the problem is in the first process, the user's stylesheet is likely the cause. - The FOP development team does not have resources to help with stylesheet issues, - although we have included links to some useful - Specifications and - Books/Articles. - If the problem is in the second process, FOP may have a bug or an unimplemented - feature that does require attention from the FOP development team. -

- The user is always responsible to provide correct XSL-FO code to FOP. -

- In the case of using -xml and -xsl input, although the user is responsible for - the XSL-FO code that is FOP's input, it is not visible to the user. To make the - intermediate FO file visible, the FOP distribution includes the "-foout" option - which causes FOP to run only the first (transformation) step, and write the - results to a file. (See also the Xalan command-line below) -

- - When asking for help on the FOP mailing lists, never attach XML and - XSL to illustrate the issue. Always run the XSLT step (-foout) and send the - resulting XSL-FO file instead. Of course, be sure that the XSL-FO file is - correct before sending it. - -

- The -foout option works the same way as if you would call the - Xalan command-line: -

-

- java org.apache.xalan.xslt.Process -IN xmlfile -XSL file -OUT outfile -

-

- Note that there are some subtle differences between the FOP and Xalan command-lines. -

-
-
- Memory Usage -

- FOP can consume quite a bit of memory, even though this has been continually improved. - This is partly inherent to the formatting process and partly caused by implementation choices. - All FO processors currently on the market have memory problems with certain layouts. -

-

- If you are running out of memory when using FOP, here are some ideas that may help: -

-
    -
  • - Increase memory available to the JVM. See - the -Xmx option - for more information. - - It is usually unwise to increase the memory allocated to the JVM beyond the amount of - physical RAM, as this will generally cause significantly slower performance. - -
  • -
  • - Avoid forward references. - Forward references are references to some later part of a document. - Examples include page number citations which refer to pages which follow the citation, - tables of contents at the beginning of a document, and page numbering schemes that - include the total number of pages in the document - ("page N of TOTAL"). - Forward references cause all subsequent pages to be held in memory until the reference - can be resolved, i.e. until the page with the referenced element is encountered. - Forward references may be required by the task, but if you are getting a memory - overflow, at least consider the possibility of eliminating them. - A table of contents could be replaced by PDF bookmarks instead or moved to the end of - the document (reshuffle the paper could after printing). -
  • -
  • - Avoid large images, especially if they are scaled down. - If they need to be scaled, scale them in another application upstream from FOP. - For many image formats, memory consumption is driven mainly by the size of the image - file itself, not its dimensions (width*height), so increasing the compression rate - may help. -
  • -
  • - Use multiple page sequences. - FOP starts rendering after the end of a page sequence is encountered. - While the actual rendering is done page-by-page, some additional memory is - freed after the page sequence has been rendered. - This can be substantial if the page sequence contains lots of FO elements. -
  • -
-

- One of FOP's stated design goals is to be able to process input of arbitrary size. - Addressing this goal is one of the prime motivations behind the - FOP Redesign. -

-
-
- Problems -

If you have problems running FOP, please see the "How to get Help" page.

-
- -
diff --git a/src/documentation/content/xdocs/0.91/servlets.xml b/src/documentation/content/xdocs/0.91/servlets.xml deleted file mode 100644 index 86681ccc9..000000000 --- a/src/documentation/content/xdocs/0.91/servlets.xml +++ /dev/null @@ -1,255 +0,0 @@ - - - - - -
- Servlets - How to use Apache FOP in a Servlet - $Revision$ -
- -
- Overview -

- This page discusses topic all around using Apache FOP in a servlet environment. -

-
-
- Example Servlets in the FOP distribution -

- In the directory {fop-dir}/src/java/org/apache/fop/servlet, you'll find a working example - of a FOP-enabled servlet. -

-

- The servlet is automatically built when you build Apache FOP using the supplied Ant script. After building - the servlet, drop fop.war into the webapps directory of Apache Tomcat (or any other web container). Then, you can use - URLs like the following to generate PDF files: -

-
    -
  • http://localhost:8080/fop/fop?fo=/home/path/to/fofile.fo
  • -
  • http://localhost:8080/fop/fop?xml=/home/path/to/xmlfile.xml&xsl=/home/path/to/xslfile.xsl
  • -
-

-

The source code for the servlet can be found under {fop-dir}/src/java/org/apache/fop/servlet/FopServlet.java.

-
-
- Create your own Servlet - - This section assumes you are familiar with embedding FOP. - -
- A minimal Servlet -

- Here is a minimal code snippet to demonstrate the basics: -

- public void doGet(HttpServletRequest request, - HttpServletResponse response) throws ServletException { - try { - response.setContentType("application/pdf"); - Fop fop = new Fop(MimeConstants.MIME_PDF); - fop.setOutputStream(response.getOutputStream()); - TransformerFactory factory = TransformerFactory.newInstance(); - Transformer transformer = factory.newTransformer(); - Source src = new StreamSource("foo.fo"); - Result res = new SAXResult(fop.getDefaultHandler()); - transformer.transform(src, res); - } catch (Exception ex) { - throw new ServletException(ex); - } -} - - There are numerous problems with the code snippet above. - Its purpose is only to demonstrate the basic concepts. - See below for details. - -
-
- Adding XSL tranformation (XSLT) -

- A common requirement is the to transform an XML source to - XSL-FO using an XSL transformation. It is recommended to use - JAXP for this task. The following snippet shows the basic - code: -

- -protected TransformerFactory transformerFactory; - -public void init() throws ServletException { - this.transformerFactory = TransformerFactory.newInstance(); -} - -[..] - - //Setup FOP - Fop fop = new Fop(MimeConstants.MIME_PDF); - - //Setup a buffer to obtain the content length - ByteArrayOutputStream out = new ByteArrayOutputStream(); - fop.setOutputStream(out); - - //Setup Transformer - Source xsltSrc = new StreamSource(new File("foo-xml2fo.xsl")); - Transformer transformer = this.transformerFactory.newTransformer(xsltSrc); - - //Make sure the XSL transformation's result is piped through to FOP - Result res = new SAXResult(fop.getDefaultHandler()); - - //Setup input - Source src = new StreamSource(new File("foo.xml")); - - //Start the transformation and rendering process - transformer.transform(src, res); - - //Prepare response - response.setContentType("application/pdf"); - response.setContentLength(out.size()); - - //Send content to Browser - response.getOutputStream().write(out.toByteArray()); - response.getOutputStream().flush(); - - Buffering the generated PDF in a ByteArrayOutputStream is done to avoid potential - problems with the Acrobat Reader Plug-in in Microsoft Internet Explorer. - -

- The Source instance used above is simply an - example. If you have to read the XML from a string, supply - a new StreamSource(new - StringReader(xmlstring)). Constructing and reparsing - an XML string is generally less desirable than using a - SAXSource if you generate your XML. You can alternatively - supply a DOMSource as well. You may also use dynamically - generated XSL if you like. -

-

- Because you have an explicit Transformer object, you can also use it to - explicitly set parameters for the transformation run. -

-
-
- Custom configuration -

- You can easily set up your own FOUserAgent as demonstrated on the Embedding page. -

-
-
- Improving performance -

- There are several options to consider: -

-
    -
  • - Instead of java.io.ByteArrayOutputStream consider using the ByteArrayOutputStream - implementation from the Jakarta Commons IO project which allocates less memory. - The full class name is: org.apache.commons.io.output.ByteArrayOutputStream -
  • -
  • - In certain cases it can help to write the generated PDF to a temporary file so - you can quickly reuse the file. This is especially useful, if Internet Explorer - calls the servlet multiple times with the same request or if you often generate - equal PDFs. -
  • -
-

- Of course, the - performance hints from the Embedding page - apply here, too. -

-
-
-
- Notes on Microsoft Internet Explorer -

- Some versions of Internet Explorer will not automatically show the PDF or call the servlet multiple times. - These are well-known limitations of Internet Explorer and are not a problem of the servlet. - However, Internet Explorer can still be used to download the PDF so that it can be viewed later. - Here are some suggestions in this context: -

-
    -
  • - Use an URL ending in .pdf, like - http://myserver/servlet/stuff.pdf. Yes, the servlet can - be configured to handle this. If the URL has to contain parameters, - try to have both the base URL as well as the last parameter end in - .pdf, if necessary append a dummy parameter, like - http://myserver/servlet/stuff.pdf?par1=a&par2=b&d=.pdf. The - effect may depend on IEx version. -
  • -
  • - Give IEx the opportunity to cache. In particular, ensure the - server does not set any headers causing IEx not to cache the - content. This may be a real problem if the document is sent - over HTTPS, because most IEx installations will by default - not cache any content retrieved over HTTPS. - Setting the Expires header entry may help in - this case:
    response.setDateHeader("Expires", - System.currentTimeMillis() + cacheExpiringDuration * - 1000);
    Consult your server manual and the - relevant RFCs for further details on HTTP headers and - caching. -
  • -
  • - Cache in the server. It may help to include a parameter in - the URL which has a timestamp as the value min order to - decide whether a request is repeated. IEx is reported to - retrieve a document up to three times, but never more often. -
  • -
-
-
- Servlet Engines -

- When using a servlet engine, there are potential CLASSPATH issues, and potential conflicts - with existing XML/XSLT libraries. Servlet containers also often use their own classloaders - for loading webapps, which can cause bugs and security problems. -

-
- Tomcat -

- Check Tomcat's documentation for detailed instructions about installing FOP and Cocoon. - There are known bugs that must be addressed, particularly for Tomcat 4.0.3. -

-
-
- WebSphere 3.5 -

- Put a copy of a working parser in some directory where WebSphere can access it. - For example, if /usr/webapps/yourapp/servlets is the CLASSPATH for your servlets, - copy the Xerces jar into it (any other directory would also be fine). - Do not add the jar to the servlet CLASSPATH, but add it to the CLASSPATH of the - application server which contains your web application. - In the WebSphere administration console, click on the "environment" button in the - "general" tab. In the "variable name" box, enter "CLASSPATH". - In the "value" box, enter the correct path to the parser jar file - (/usr/webapps/yourapp/servlets/Xerces.jar in our example here). - Press "OK", then apply the change and restart the application server. -

-
-
-
- Handling complex use cases -

- Sometimes the requirements for a servlet get quite sophisticated: SQL data sources, - multiple XSL transformations, merging of several datasources etc. In such a case - consider using Apache Cocoon instead - of a custom servlet to accomplish your goal. -

-
- -
- diff --git a/src/documentation/content/xdocs/0.91/upgrading.xml b/src/documentation/content/xdocs/0.91/upgrading.xml deleted file mode 100644 index e1a812f83..000000000 --- a/src/documentation/content/xdocs/0.91/upgrading.xml +++ /dev/null @@ -1,119 +0,0 @@ - - - - - -
- Upgrading from an Earlier Version of Apache FOP - $Revision$ -
- -
- Important! -

- If you're planning to upgrade to the latest FOP version there are a few very important things - to consider: -

-
    -
  • - More than half of the codebase has been rewritten over the last three years. The code is - relatively new and possibly not as stable as version 0.20.5 in every regard. -
  • -
  • - The API of FOP has changed considerably and is not backwards-compatible with version 0.20.5. -
  • -
  • - The new API is not stable, yet. Please be aware that further changes might still occur! -
  • -
  • -

    - The new code is much more strict about the interpretation of the XSL-FO 1.0 specification. - Things that worked fine in version 0.20.5 might start to produce warnings or even errors - now. FOP 0.20.5 contains many bugs which have been corrected in the new code. -

    - - While FOP 0.20.5 allowed you to have empty fo:table-cell elements, the new code - will complain about that (unless relaxed validation is enabled) because the specification - demands at least one block-level element ((%block;)+, see - XSL-FO 1.0, 6.7.10) - inside an fo:table-cell element. - -
  • -
  • - Extensions and Renderers written for version 0.20.5 will not work with the new code! The new FOP - extension for Barcode4J will be available in - January 2006. -
  • -
  • - The PCL Renderer and the MIF Handler have not been resurrected, yet! They are currently non-functional - and hope for someone to step up and reimplement them. -
  • -
  • - By looking at the Compliance page you might get the impression - that the new code is much more advanced than version 0.20.5. That's true but there are still - a few things that may not be handled as gracefully by the new code as by version 0.20.5. -
  • -
-

- So, please evaluate carefully before messing up your production environment! Actually we do - recommend against using the FOP development version in a production system. -

-
-
- What you need to know when you upgrade! -

- When you use your existing FO files or XML/XSL files which work fine with FOP version - 0.20.5 against this FOP version some things may not work as expected. The following - list will hopefully help you to identify and correct those problems. -

-
    -
  • - Check the Compliance page for the feature causing - trouble. It may contain the necessary information to understand and resolve the problem. -
  • -
  • - Not all 0.20.5 output formats are supported. PDF and Postscript should be fully supported. - See Output Targets for a more complete description. -
  • -
  • - As stated above empty table cells <fo:table-cell></fo:table-cell> - are not allowed by the specification. The same applies to empty static-content - and block-container elements, for example. -
  • -
  • - 0.20.5 is not XSL-FO compliant with respect to sizing images (external-graphic) - or instream-foreign-object - objects. If images or SVGs are sized differently in your outputs with the new FOP version - check Bug 37136 - as it contains some hints on what to. The file - - "examples/fo/basic/images.fo" has - a number of good examples that shows the new, more correct behaviour. -
  • -
  • - The fox:outline extension not implemented in this version anymore. - It has been superseded by the new bookmark elements from XSL-FO 1.1. -
  • -
  • - The fox:destination extension is also not implemented in this version - although it may be added in the future. See also - Bug 37157. -
  • -
-
- -
diff --git a/src/documentation/content/xdocs/0.92/anttask.xml b/src/documentation/content/xdocs/0.92/anttask.xml new file mode 100644 index 000000000..ba21c861a --- /dev/null +++ b/src/documentation/content/xdocs/0.92/anttask.xml @@ -0,0 +1,183 @@ + + + + + +
+ Ant task + $Revision$ +
+ +

+ Apache FOP provides an Ant task for automating the document build process. +

+
+ Description +

+ The FOP Ant task will convert XSL-FO documents to PDF, PS, PCL etc. output + (see Output formats for available formats). +

+

+ To call FOP tasks within Ant, first add a FOP task definition to your Ant build file. + One method of defining the task is as follows: +

+ + + + + + + + + + + + ]]> +

+ Then create FOP tasks within your Ant build file, using the FOP task parameters listed below.

+
+ +
Parameters for FOP Ant task + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Parameters specified as attributes
AttributeDescriptionRequired
fofileXSL-FO file to be renderedYes, if no fileset nested element is used
outfileOutput filenameYes, when fofile is used. (This attribute is not valid for filesets.)
formatPossible output formats:
+ application/pdf
+ application/postscript
+ application/vnd.mif
+ application/rtf
+ application/vnd.hp-PCL
+ text/plain
+ text/xml
+
No, defaults to application/pdf
outdirOutput directoryRequired if a fileset is used to specify the files to render; optional for fofile. (Can alternatively specify the full path in the fofile value.)
forceRecreate target files, even if they are newer than their corresponding + source files. Note: This attribute is available in post-0.20.5 + versions (0.20.x nightly build and 1.0dev) only; target files are + always generated (i.e., force=true) in 0.20.5 release. + No, default is false
basedirBase directory to resolve relative references (e.g., graphics files) within the + FO document. + No, for single FO File entry, default is to use the location + of that FO file. +
relativebaseFor fileset usage only. A value of true specifies using the location + of each .fo file as the base directory for resolving relative file references located + within that .fo file. A value of false specifies using the value of + basedir for all files within the fileset, or just the current working directory + if basedir is not specified. + No, default is false. +
userconfigUser configuration file (same as the FOP "-c" command line option).No
messagelevelLogging level
+ Possible values: error, warn, info, verbose, debug. Currently doesn't work in FOP Trunk!!!
No, defaults to verbose
logFilesControls whether the names of the files that are processed are logged + (true) or not (false). Currently doesn't work in FOP Trunk!!!No, default is true
+

+ + + + + + + + + + + +
Parameters specified as nested elements
AttributeDescriptionRequired
filesetFileSets + are used to specify multiple XSL-FO files to be rendered.Yes, if no fofile attribute is supplied
+

+
+ Examples +

+ The following example converts a single XSL-FO file to a PDF document: +

+ + + + + ]]> +

+ This example converts all XSL-FO files within an entire directory to PostScript: +

+ + + + + + + + ]]> +
+ +
+ diff --git a/src/documentation/content/xdocs/0.92/compiling.xml b/src/documentation/content/xdocs/0.92/compiling.xml new file mode 100644 index 000000000..ad02f3046 --- /dev/null +++ b/src/documentation/content/xdocs/0.92/compiling.xml @@ -0,0 +1,139 @@ + + + + + +
+ Apache FOP: Building from Source Code + $Revision$ +
+ +
+ Do You Need To Build? +

+ FOP distributions are either pre-compiled binary or source. + If you are using a binary distribution, it is already built and there is no need to build it again. + See the Download Instructions for information about whether a + binary or source distribution is best for your needs. +

+

+ If you got the source code from a repository snapshot or via Subversion you will need to build FOP + in any case. +

+
+
+ Set Up Your Environment +
+ JDK +

+ Building FOP requires a minimum Java Development Kit (JDK/SDK) of 1.3 + (A Java Runtime Environment is not sufficient). +

+
+
+ CLASSPATH +

+ There is generally no need to setup a classpath. All libraries needed to compile FOP are included + in the source distribution and are referenced by the build script. + You will only need to adjust the classpath if you build FOP in some other way. See the build + script build.xml for details. +

+
+
+ JAVA_HOME +

+ The build script uses Apache Ant, a popular + Java-based build tool, which usually requires that the environment variable JAVA_HOME point to + your local JDK root directory. This is true even if you use JDK 1.2 or above, which normally + does not need this setting. +

+
+
+ Apache Ant +

+ Apache Ant must be installed in order to + build FOP. Following best practices we don't include Ant with FOP anymore. You can find the + instructions to install Ant in the Ant manual on the web. +

+
+
+
+ Run the Build Script +

+ Change to the FOP root directory and build FOP by executing the build script (build.xml) + using the "ant" command. +

+ + The "ant" command is only available on your system if you've properly + installed Apache Ant and added Ant's location to the PATH + environment variable. + +

+ The file build.xml in the FOP root directory is the blueprint that Ant uses for the build. It + contains information for numerous build targets, many of which are building blocks to more + useful target, and others which are primarily used by the FOP developers. + You may benefit from looking through this file to learn more about the various build targets. + To obtain a complete list of useful build targets: +

+ ant -projecthelp +

The most useful targets are:

+
    +
  • + package: Generates the JAR files (default). This is the normal build that + produces a jar file usable for running FOP. +
  • +
  • + clean : Cleans the build directory. This is useful for making sure that + any build errors are cleaned up before starting a new build. It should not ordinarily be + needed, but may be helpful if you are having problems with the build process itself. +
  • +
  • + javadocs: Generates javadocs. This creates the FOP API documentation. +
  • +
+

To run the build:

+ ant [target ...] +

For example to do a normal build for the "all" target (which is the default):

+ ant +

OR

+ ant all +

To clean the build directory first:

+ ant clean all + + If you want to shorten the build time you can just call the "package" target which + doesn't perform any automated tests during the build. + +
+
+ Troubleshooting +

If you have problems building FOP, please try the following:

+
    +
  • Run the build with the target of "clean", then rerun the build.
  • +
  • Delete the build directory completely, then rerun the build.
  • +
  • + Make sure you do not have a non-FOP version of xerces.jar, xalan.jar, batik.jar, + or another dependency product somewhere in your CLASSPATH. +
  • +
  • + If the build still fails, see the Getting Help + page for further help. +
  • +
+
+ +
+ diff --git a/src/documentation/content/xdocs/0.92/configuration.xml b/src/documentation/content/xdocs/0.92/configuration.xml new file mode 100644 index 000000000..188301a0f --- /dev/null +++ b/src/documentation/content/xdocs/0.92/configuration.xml @@ -0,0 +1,251 @@ + + + + + +
+ Apache FOP: Configuration + $Revision$ +
+ + +
+ 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 +

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

+ +

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

+
+
+
+ Summary of the General Configuration Options + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ElementData Type (for the value)Default Value
baseURL or directorySpecifies the base URL based on which relative URL will be resolved.
font-baseURL or directorySpecifies the base URL based on which relative font URLs will be resolved. + If not specified defaults to the base URL above. +
hyphenation-baseURL or directorySpecifies the base URL based on which relative URLs to hyphenation pattern + files will be resolved. If not specified, support for user-supplied hyphenation + patterns remains disabled. +
source-resolutionInteger, dpi + Resolution in dpi (dots per inch) which is used internally to determine the pixel + size for SVG images and bitmap images without resolution information. +
target-resolutionInteger, dpi + Resolution in dpi (dots per inch) used to specify the output resolution for bitmap + images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps + generated by Apache Batik for filter effects and such. +
strict-validationBoolean (true, false) + Setting this option to 'false' causes FOP to be more forgiving about XSL-FO validity, + for example, you're allowed to specify a border on a region-body which is supported + by some FO implementations but is non-standard. Note that such a border would + currently have no effect in Apache FOP.
break-indent-inheritanceBoolean (true, false) + Setting this option to 'true' causes FOP to use an alternative rule set to determine + text indents specified through margins, start-indent and end-indent. Many commercial + FO implementations have chosen to break the XSL specification in this aspect. This + option tries to mimic their behaviour. Please note that Apache FOP may still not + behave exactly like those implementations either because FOP has not fully matched + the desired behaviour and because the behaviour among the commercial implementations + varies. The default for this option (i.e. false) is to behave exactly like the + specification describes.
default-page-settingsn/a + Specifies the default width and height of a page if "auto" is specified + for either or both values. Use "height" and "width" attributes on the + default-page-settings element to specify the two values.
renderers(see text below)Contains the configuration for each renderer. See below.
+

+ This is an excerpt from the example configuration file coming with FOP: +

+ + + + ./ + + + ./ + + + 72 + + 72 + + + + + +]]> +
+
+ 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: +

+ + + + + flate + + + + + + + + + + + + + + + ]]> +

+ 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 +

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

+ + + null + + + flate + ascii-85 + + + ]]> +
+
+ Special Settings for the PostScript Renderer +

+ Besides the normal font configuration (the same "fonts" element as for the PDF renderer) the PostScript + renderer has an additional setting to force landscape pages to be rotated to fit on a page inserted into + the printer in portrait mode. Set the value to "true" to activate this feature. The default is "false". + Example: +

+ + true + + + + + + + + + + + + ]]> +
+
+ +
+ diff --git a/src/documentation/content/xdocs/0.92/embedding.xml b/src/documentation/content/xdocs/0.92/embedding.xml new file mode 100644 index 000000000..06b241eb4 --- /dev/null +++ b/src/documentation/content/xdocs/0.92/embedding.xml @@ -0,0 +1,681 @@ + + + + + + +
+ Apache FOP: Embedding + How to Embed FOP in a Java application + $Revision$ +
+ + +
+ 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. + +
+
+ Basic Usage Pattern +

+ Apache FOP relies heavily on JAXP. It uses SAX events exclusively to receive the XSL-FO + input document. It is therefore a good idea that you know a few things about JAXP (which + is a good skill anyway). Let's look at the basic usage pattern for FOP... +

+

Here is the basic pattern to render an XSL-FO file to PDF: +

+ +

+ Let's discuss these 5 steps in detail: +

+
    +
  • + Step 1: You create a new FopFactory instance. The FopFactory instance holds + references to configuration information and cached data. It's important to reuse this + instance if you plan to render multiple documents during a JVM's lifetime. +
  • +
  • + Step 2: You set up an OutputStream that the generated document + will be written to. It's a good idea to buffer the OutputStream as demonstrated + to improve performance. +
  • +
  • + Step 3: You create a new Fop instance through one of the factory + methods on the FopFactory. You tell the FopFactory what your desired output format + is. This is done by using the MIME type of the desired output format (ex. "application/pdf"). + You can use one of the MimeConstants.* constants. The second parameter is the + OutputStream you've setup up in step 2. +
  • +
  • + Step 4 We recommend that you use JAXP Transformers even + if you don't do XSLT transformations to generate the XSL-FO file. This way + you can always use the same basic pattern. The example here sets up an + "identity transformer" which just passes the input (Source) unchanged to the + output (Result). You don't have to work with a SAXParser if you don't do any + XSLT transformations. +
  • +
  • + Step 5: Here you set up the input and output for the XSLT + transformation. The Source object is set up to load the "myfile.fo" file. + The Result is set up so the output of the XSLT transformation is sent to FOP. + The FO file is sent to FOP in the form of SAX events which is the most efficient + way. Please always avoid saving intermediate results to a file or a memory buffer + because that affects performance negatively. +
  • +
  • + Step 6: Finally, we start the XSLT transformation by starting + the JAXP Transformer. As soon as the JAXP Transformer starts to send its output + to FOP, FOP itself starts its processing in the background. When the + transform() method returns FOP will also have finished converting + the FO file to a PDF file and you can close the OutputStream. + + It's a good idea to enclose the whole conversion in a try..finally statement. If + you close the OutputStream in the finally section, this will make sure that the + OutputStream is properly closed even if an exception occurs during the conversion. + +
  • +
+

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

+ + We know this may be an issue in multi-threaded server environments if you'd like to + know what's going on in every single FOP processing run. We're planning to add an + additional feedback facility to FOP which can be used to obtain all sorts of specific + feedback (validation messages, layout problems etc.). "Static logging" is mainly + interesting for a developer working on FOP and for advanced users who are debugging + FOP. We don't consider the logging output to be useful to normal FOP users. Please + have some patience until we can add this feature or jump in and help us build it. We've + set up a Wiki page + which documents what we're going to build. + +

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

+
+ +
+ 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 +

+ 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: +

+ +
+
+
+ Input Sources +

+ The input XSL-FO document is always received by FOP as a SAX stream (see the + Parsing Design Document for the rationale). +

+

+ However, you may not always have your input document available as a SAX stream. + But with JAXP it's easy to convert different input sources to a SAX stream so you + can pipe it into FOP. That sounds more difficult than it is. You simply have + to set up the right Source instance as input for the JAXP transformation. + A few examples: +

+
    +
  • + URL: Source src = new StreamSource("http://localhost:8080/testfile.xml"); +
  • +
  • + File: Source src = new StreamSource(new File("C:/Temp/myinputfile.xml")); +
  • +
  • + String: Source src = new StreamSource(new StringReader(myString)); // myString is a String +
  • +
  • + InputStream: Source src = new StreamSource(new MyInputStream(something)); +
  • +
  • + Byte Array: Source src = new StreamSource(new ByteArrayInputStream(myBuffer)); // myBuffer is a byte[] here +
  • +
  • + DOM: Source src = new DOMSource(myDocument); // myDocument is a Document or a Node +
  • +
  • + Java Objects: Please have a look at the Embedding examples which contain an example for this. +
  • +
+

+ 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 +

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

+
+ 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: +

+
    +
  • +

    + The font base URL to use when resolving relative URLs for fonts. Example: +

    + fopFactory.setFontBaseURL("file:///C:/Temp/fonts"); +
  • +
  • +

    + Disable strict validation. When disabled FOP is less strict about the rules + established by the XSL-FO specification. Example: +

    + fopFactory.setStrictValidation(false); +
  • +
  • +

    + Enable an alternative set of rules for text indents that tries to mimic the behaviour of many commercial + FO implementations, that chose to break the specification in this respect. The default of this option is + 'false', which causes Apache FOP to behave exactly as described in the specification. To enable the + alternative behaviour, call: +

    + fopFactory.setBreakIndentInheritanceOnReferenceAreaBoundary(true); +
  • +
  • +

    + Set the source resolution for the document. This is used internally to determine the pixel + size for SVG images and bitmap images without resolution information. Default: 72 dpi. Example: +

    + fopFactory.setSourceResolution(96); // =96dpi (dots/pixels per Inch) +
  • +
  • +

    + Manually add an ElementMapping instance. If you want to supply a special FOP extension + you can give the instance to the FOUserAgent. Normally, the FOP extensions can be automatically detected + (see the documentation on extension for more info). Example: +

    + fopFactory.addElementMapping(myElementMapping); // myElementMapping is a org.apache.fop.fo.ElementMapping +
  • +
  • +

    + Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add + custom URI resolution functionality to FOP. For example, you can use + Apache XML Commons Resolver to make use of XCatalogs. Example: +

    + fopFactory.setURIResolver(myResolver); // myResolver is a javax.xml.transform.URIResolver + + Both the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FopFactory + is primarily used to resolve URIs on factory-level (hyphenation patterns, for example) and it is always used + if no other URIResolver (for example on the FOUserAgent) resolved the URI first. + +
  • +
+
+
+ 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: +

+ +

+ You can do all sorts of things on the user agent: +

+
    +
  • +

    + The base URL to use when resolving relative URLs. Example: +

    + userAgent.setBaseURL("file:///C:/Temp/"); +
  • +
  • +

    + Set the producer of the document. This is metadata information that can be used for certain output formats such as PDF. The default producer is "Apache FOP". Example: +

    + userAgent.setProducer("MyKillerApplication"); +
  • +
  • +

    + Set the creating user of the document. This is metadata information that can be used for certain output formats such as PDF. Example: +

    + userAgent.setCreator("John Doe"); +
  • +
  • +

    + Set the author of the document. This is metadata information that can be used for certain output formats such as PDF. Example: +

    + userAgent.setAuthor("John Doe"); +
  • +
  • +

    + Override the creation date and time of the document. This is metadata information that can be used for certain output formats such as PDF. Example: +

    + userAgent.setCreationDate(new Date()); +
  • +
  • +

    + Set the title of the document. This is metadata information that can be used for certain output formats such as PDF. Example: +

    + userAgent.setTitle("Invoice No 138716847"); +
  • +
  • +

    + Set the keywords of the document. This is metadata information that can be used for certain output formats such as PDF. Example: +

    + userAgent.setKeywords("XML XSL-FO"); +
  • +
  • +

    + Set the target resolution for the document. This is used to + specify the output resolution for bitmap images generated by bitmap renderers + (such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter + effects and such. Default: 72 dpi. Example: +

    + userAgent.setTargetResolution(300); // =300dpi (dots/pixels per Inch) +
  • +
  • +

    + Set your own Renderer instance. If you want to supply your own renderer or + configure a Renderer in a special way you can give the instance to the FOUserAgent. Normally, + the Renderer instance is created by FOP. Example: +

    + userAgent.setRendererOverride(myRenderer); // myRenderer is an org.apache.fop.render.Renderer +
  • +
  • +

    + Set your own FOEventHandler instance. If you want to supply your own FOEventHandler or + configure an FOEventHandler subclass in a special way you can give the instance to the FOUserAgent. Normally, + the FOEventHandler instance is created by FOP. Example: +

    + userAgent.setFOEventHandlerOverride(myFOEventHandler); // myFOEventHandler is an org.apache.fop.fo.FOEventHandler +
  • +
  • +

    + Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add + custom URI resolution functionality to FOP. For example, you can use + Apache XML Commons Resolver to make use of XCatalogs. Example: +

    + userAgent.setURIResolver(myResolver); // myResolver is a javax.xml.transform.URIResolver + + Both the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FOUserAgent is + used for resolving URIs which are document-related. If it's not set or cannot resolve a URI, the URIResolver + from the FopFactory is used. + +
  • +
+ + You should not reuse an FOUserAgent instance between FOP rendering runs although you can. Especially + in multi-threaded environment, this is a bad idea. + +
+
+
+ Using a Configuration File +

+ Instead of setting the parameters manually in code as shown above you can also set + many values from an XML configuration file: +

+ +

+ The layout of the configuration file is described on the Configuration page. +

+
+
+ 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 +

+ 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 +

+ 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 +

+ There are several options to consider: +

+
    +
  • + Whenever possible, try to use SAX to couple the individual components involved + (parser, XSL transformer, SQL datasource etc.). +
  • +
  • + Depending on the target OutputStream (in case of a FileOutputStream, but not + for a ByteArrayOutputStream, for example) it may improve performance considerably + if you buffer the OutputStream using a BufferedOutputStream: + out = new java.io.BufferedOutputStream(out); +
    + Make sure you properly close the OutputStream when FOP is finished. +
  • +
  • + Cache the stylesheet. If you use the same stylesheet multiple times + you can set up a JAXP Templates object and reuse it each time you do + the XSL transformation. (More information can be found + here.) +
  • +
  • + Use an XSLT compiler like XSLTC + that comes with Xalan-J. +
  • +
  • + Fine-tune your stylesheet to make the XSLT process more efficient and to create XSL-FO that can + be processed by FOP more efficiently. Less is more: Try to make use of property inheritance where possible. +
  • +
+
+
+ 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 +

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

+
+ ExampleFO2PDF.java +

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

+
+
+
+ ExampleXML2FO.java +

This + + example +has nothing to do with FOP. It is there to show you how an XML +file can be converted to XSL-FO using XSLT. The JAXP API is used to do the +transformation. Make sure you've got a JAXP-compliant XSLT processor in your +classpath (ex. Xalan). +

+
+
+
+ ExampleXML2PDF.java +

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 +

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 +

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

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 +

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

+
+
+ +
+ diff --git a/src/documentation/content/xdocs/0.92/extensions.xml b/src/documentation/content/xdocs/0.92/extensions.xml new file mode 100644 index 000000000..71fff1e09 --- /dev/null +++ b/src/documentation/content/xdocs/0.92/extensions.xml @@ -0,0 +1,106 @@ + + + + + +
+ Standard FOP Extensions + $Revision$ +
+ +

+ 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, 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 required the correct use of an appropriate namespace in your input document. +
+ SVG +

+ Please see the SVG documentation for more details. +

+
+
+ 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://xml.apache.org/fop/extensions to the root element: +

+ ]]> + Currently, no extensions are implemented in FOP Trunk which use the FOP extension namespace. +
+
+ 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 +

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

+ +
+
+ Table Continuation Label +

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

+ +
+
+ +
+ diff --git a/src/documentation/content/xdocs/0.92/fonts.xml b/src/documentation/content/xdocs/0.92/fonts.xml new file mode 100644 index 000000000..5c1fc0c6f --- /dev/null +++ b/src/documentation/content/xdocs/0.92/fonts.xml @@ -0,0 +1,303 @@ + + + + + +
+ Apache FOP: Fonts + $Revision$ + + + + +
+ +
+ Summary + The FOP Font subsystem is currently undergoing a significant change. + The details provided here especially related to the generation of FOP Font + Metrics files and the FOP Font configuration are likely to change substantially + in the future. + +

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

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RendererBase-14AWT/OSCustomCustom Embedding
PDFyesnoyesyes
PostScriptyesnoyesyes
TXTyes (used for layout but not for output)noyes (used for layout but not for output)no
AWTif available from OSyesyesn/a (display only)
Printif available from OSyesyescontrolled by OS printer driver
RTFn/a (font metrics not needed)n/an/an/a
MIFn/a (font metrics not needed)n/an/an/a
SVGif available from OSyesnono
XMLyesnoyesn/a
+
+
+ Base-14 Fonts +

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

+
+
+ AWT/Operating System Fonts +

The AWT family of renderers (AWT, Print, SVG), use the Java AWT libraries for font metric information. Through operating system registration, the AWT libraries know what fonts are available on the system, and the font metrics for each one.

+
+
+ Custom Fonts +

Support for custom fonts is added by creating font metric files (written in XML) from the actual font files, and registering them with FOP. Currently only Type 1 and TrueType fonts can be added. +More information about fonts can be found at:

+ +
+ 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 (on JDK 1.4 and later):

+ java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar + org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file +

Windows (on JDK 1.3.x):

+ java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar;lib\xml-apis.jar; + lib\xercesImpl.jar;lib\xalan.jar;lib\serializer.jar + org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file +

Unix (on JDK 1.4 and later):

+ java -cp build/fop.jar:lib/avalon-framework.jar:lib/commons-logging.jar:lib/commons-io.jar + org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file +

Unix (on JDK 1.3.1):

+ java -cp build/fop.jar:lib/avalon-framework.jar:lib/commons-logging.jar:lib/commons-io.jar:lib/xml-apis.jar: + lib/xercesImpl.jar:lib/xalan.jar:lib/serializer.jar + org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file +

PFMReader [options]:

+
    +
  • -fn <fontname> By default, FOP uses the fontname from the +.pfm file when embedding the font. Use the "-fn" option to override this name with one you have +chosen. This may be useful in some cases to ensure that applications using the output document +(Acrobat Reader for example) use the embedded font instead of a local font with the same +name.
  • +
+ The classpath in the above example has been simplified for readability. +You will have to adjust the classpath to the names of the actual JAR files in the lib directory. +xml-apis.jar, xercesImpl.jar, xalan.jar and serializer.jar are not necessary for JDK version 1.4 or later. + The tool will construct some values (FontBBox, StemV and ItalicAngle) based on assumptions and calculations which are only an approximation to the real values. +FontBBox and Italic Angle can be found in the human-readable part of the PFB file or in the AFM file. +The PFMReader tool does not yet interpret PFB or AFM files, so if you want to be correct, you may have to adjust the values in the XML file manually. +The constructed values however appear to have no visible influence. +
+
+ TrueType Font Metrics +

FOP includes TTFReader, which reads the TTF file and generates an appropriate font metrics file for it. +Use it in a similar manner to PFMReader. +For example, to create such a metrics file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:

+ java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar + org.apache.fop.fonts.apps.TTFReader [options] + C:\myfonts\cmr10.ttf ttfcm.xml +

TTFReader [options]:

+
    +
  • -d <DEBUG | INFO > Sets the debug level (default is +INFO).
  • +
  • -fn <fontname> Same as for PFMReader.
  • +
  • -ttcname <fontname> If you're reading data from a +TrueType Collection (.ttc file) you must specify which font from the collection you will read +metrics from. +If you read from a .ttc file without this option, the fontnames will be listed for you.
  • +
  • -enc ansi Creates a WinAnsi-encoded font metrics file. +Without this option, a CID-keyed font metrics file is created. +The table below summarizes the differences between these two encoding options as currently +used within FOP. +Please note that this information only applies to TrueType fonts and TrueType collections:
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
IssueWinAnsiCID-keyed
Usable Character SetLimited to WinAnsi character set, which is roughly equivalent to iso-8889-1.Limited only by the characters in the font itself.
Character Encoding in the Output Document.Correct.Never correct. Search, index, and cut-and-paste operations in the output document +will produce incorrect results.
Character DisplayCorrect.Correct, but copy/paste won't work in Acrobat Reader. (FOP currently doesn't emit the /ToUnicode table which is necessary for copy/paste to work.)
Embedding the FontOptional.Mandatory. Not embedding the font produces invalid PDF documents.
+ + You may experience failures with certain TrueType fonts, especially if they don't contain + the so-called "cmap" table. TTFReader can currently not deal with font like this. + +
+
+ TrueType Collections Font Metrics +

TrueType collections (.ttc files) contain more than one font. +To create metrics files for these fonts, you must specify which font in the collection should be generated, by using the "-ttcname" option with the TTFReader.

+

To get a list of the fonts in a collection, just start the TTFReader as if it were a normal TrueType file (without the -ttcname option). +It will display all of the font names and exit with an Exception.

+

Here is an example of generating a metrics file for a .ttc file:

+ java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar + org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho" + msmincho.ttc msminch.xml +
+
+ Register Fonts with FOP +

You must tell FOP how to find and use the font metrics files by registering them in the FOP Configuration. Add entries for your custom fonts, regardless of font type, to the configuration file in a manner similar to the following:

+ + +]]> + 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. +
    +
  • + URLs are used to access the font metric and font files. + Relative URLs are resolved relative to the font-base property (or base) if available. + See FOP: Configuration for more information. +
  • +
  • The "kerning" and "embed-url" attributes are optional. Kerning is currently not used at all. If embedding is off, the output will position the text correctly (from the metrics file), but it will not be displayed or printed correctly unless the viewer has the applicable font available to their local system.
  • +
  • When setting the embed-url attribute for Type 1 fonts, be sure to specify the PFB (actual font data), not PFM (font metrics) file that you used to generate the XML font metrics file.
  • +
+ +
+
+ Embedding + The PostScript renderer does not yet support TrueType fonts, but can embed Type 1 fonts. + The font is simply embedded into the PDF file, it is not converted. +

Font embedding is enabled in the userconfig.xml file and controlled by the embed-url attribute. +If you don't specify the embed-url attribute the font will not be embedded, but will only be referenced.

+ + Omitting the embed-url attribute for CID-encoded TrueType fonts will currently produce invalid + PDF files! If you create the XML font metric file using the "-enc ansi" option, you can omit + the embed-url attribute for TrueType fonts but you're restricted to the WinAnsi character set. + +

When FOP embeds a font, it adds a prefix to the fontname to ensure that the name will not match the fontname of an installed font. +This is helpful with older versions of Acrobat Reader that preferred installed fonts over embedded fonts.

+

When embedding PostScript fonts, the entire font is always embedded.

+

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. +Currently, this embedded font contains only the minimum data needed to be embedded in a pdf document, and does not contain any codepage information. +The PDF document contains indexes to the glyphs in the font instead of to encoded characters. +While the document will be displayed correctly, the net effect of this is that searching, indexing, and cut-and-paste will not work properly.

+

One workaround for this behavior is to use the "-enc ansi" option when generating metrics with TTFReader. +This will cause the whole font to be embedded in the pdf document. +Characters will be WinAnsi encoded (as specified in the PDF spec), so you lose the ability to use characters from other character sets. +See Table of TTF Encoding Options for more details.

+
+
+ Explicitely embedding the base 14 fonts +

+ There are cases where you might want to force the embedding of one or more of the base 14 fonts that + can normally be considered available on the target platform (viewer, printer). One of these cases is + PDF/A which mandates the embedding of even the base 14 fonts. Embedding a font such as Helvetica or + Courier is straight-forward. The "Symbol" and "ZapfDingbats" fonts, however, currently present a + problem because FOP cannot correctly determine the encoding of these two single-byte fonts through + the PFM file. FOP now correctly interprets the "encoding" value in the XML font metrics file, but the + PFMReader application writes "UnknownEncoding" to the generated XML file. In order to embed "Symbol" + and "ZapfDingbats" you have to manually change the XML font metrics file and specify "SymbolEncoding" + or "ZapfdingbatsEncoding" encoding respectively as the value for the "encoding" element. +

+

Example:

+ + + Symbol + + SymbolEncoding + 673 + 766 + [..]]]> +
+
+ +
diff --git a/src/documentation/content/xdocs/0.92/graphics.xml b/src/documentation/content/xdocs/0.92/graphics.xml new file mode 100644 index 000000000..e52f25736 --- /dev/null +++ b/src/documentation/content/xdocs/0.92/graphics.xml @@ -0,0 +1,343 @@ + + + + + +
+ Apache FOP: Graphics Formats + $Revision$ +
+ +
+ 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 Thru" column for more details. +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FormatTypeFOP native supportBatik SVGBatik codecsImage I/OJAIJIMI
BMP (Microsoft Windows Bitmap)bitmapX
EPS (Encapsulated PostScript)metafile (both bitmap and vector), probably most frequently used for vector drawings(X)
GIF (Graphics Interchange Format)bitmapXXXX
JPEG (Joint Photographic Experts Group)bitmap(X)
PNG (Portable Network Graphic)bitmapX
SVG (Scalable Vector Graphics)vector (with embedded bitmaps)X
TIFF (Tag Image Format File)bitmap(X)XX
+ "(X)" means restricted support. Please see the details below. +
+
+ Graphics Packages +
+ FOP Native +

+ FOP has native ability to handle some graphic file formats. +

+
+
+ Batik codecs +

+ Apache Batik contains codecs for PNG and TIFF access. FOP can use these. +

+
+
+ Image I/O (JDK 1.4 or higher) +

+ For JDKs 1.4 or higher, FOP 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. +

+
+
+ JIMI +

+ Because of licensing issues, the JIMI image library is not included in the FOP distribution. First, download and install it. +Then, copy the file "JimiProClasses.zip" from the archive to {fop-install-dir}/lib/jimi-1.0.jar. Please note that FOP binary distributions are compiled with JIMI support, so there is no need for you to build FOP to add the support. If jimi-1.0.jar is installed in the right place, it will automatically be used by FOP, otherwise it will not. +

+
+
+ JAI (Java Advanced Imaging API) + JAI support is available for Release 0.20.5 and later. The comments in this section do not apply to releases earlier than 0.20.5. +

+ FOP has been compiled with JAI support, but JAI is not included in the FOP distribution. +To use it, install JAI, then copy the jai_core.jar and the jai_codec.jar files to {fop-install-dir}/lib. +JAI is much faster than JIMI, but is not available for all platforms. See What platforms are supported? on the JAI FAQ page for more details. +

+
+
+ Batik +

Current FOP distributions include a distribution of the Apache Batik version 1.6. +It is automatically installed with FOP. +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. +

Batik must be run in a graphical environment. +It uses AWT classes for rendering SVG, which in turn require an X server on Unixish systems. +If you run a server without X, or if you can't connect to the X server due to security restrictions or policies (a so-called "headless" environment), SVG rendering will fail.

+

Here are some workarounds:

+
    +
  • If you are using JDK 1.4, start it with the -Djava.awt.headless=true command line option.
  • +
  • Install an X server which provides an in-memory framebuffer without actually using a screen device or any display hardware. One example is Xvfb.
  • +
  • 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.
  • +
+
+
+
+ BMP +

FOP native support for BMP images is limited to the RGB color-space.

+
+
+ EPS +

FOP provides support for two output targets:

+
    +
  • PostScript (full support).
  • +
  • + PDF (partial support). Due to the lack of a built-in PostScript interpreter, FOP + can only embed the EPS file into the PDF. Acrobat Reader will not currently display + the EPS (it doesn't have a PostScript interpreter, either) but it will be shown + correctly when you print the PDF on a PostScript-capable printer. PostScript devices + (including GhostScript) will render the EPS correctly. +
  • +
+

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

+
+
+ JPEG +

FOP native support 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. +

+
+
+ PNG +

If using JAI for PNG support, only RGB and RGBA color-spaces are supported for FOP rendering.

+
+
+ SVG +
+ Introduction +

FOP uses 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. +

+

+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 this graphic may not +be ideal depending on the FOP dpi (72dpi) and the scaling for that graphic. +We hope to improve this in the future.

+

+Currently transparency is not supported in PDF so many svg images that +contain effects or graphics with transparent areas will not be displayed +correctly. +

+
+
+ Placing SVG Text into PDF +

If possible, Batik will use normal PDF 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 +shows how various types and effects with text are handled. +Note that tspan and outlined text are not yet implemented.

+

+Otherwise, 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 pdf files large and when the pdf is viewed the +viewer does not normally draw those fine curves very well (turning on +Smooth Line Art in the Acrobat preferences will fix this). +If the text is inserted into the PDF using the inbuilt text commands +for PDF it will use a single character. +

+

+For PDF output, there is a configuration option to force SVG text to be rendered as text. +The drawback to this approach is that it is effective only for available fonts (including embedded fonts). +Font sizes are rounded to the next integer point size. +This will be improved in the future. +

+

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.

+
+
+ 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. +FOP will probably implement a scaling mechanism in the future.

+
+
+ 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 +
  • +
  • +there is some problem with a gradient inside a pattern causing a pdf +error when viewed in acrobat 5 +
  • +
  • +text is not always handled correctly, it may select the wrong font +especially if characters have multiple fonts in the font list +
  • +
  • +more pdf text handling could be implemented +It could draw the string using the attributed character iterator +to handle tspans and other simple changes of text. +
  • +
  • +JPEG images are not inserted directly into the pdf document +This area has not been implemented yet since the appropriate +method in batik is static +
  • +
  • +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 +

FOP-native TIFF support is limited to PDF and PostScript output only. Also, according to user reports, FOP's native support for TIFF is limited to images with the following characteristics (all must be true for successful rendering):

+
    +
  • single channel images (i.e., bi-level and grayscale only)
  • +
  • uncompressed images, or images using CCITT T.4, CCITT T.6, or JPEG compression
  • +
  • images using white-is-zero encoding in the TIFF PhotometricInterpretation tag
  • +
+

JAI: Supports RGB and RGBA only for FOP rendering.

+
+
+ Graphics Resolution +

Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution value. Since PDF and most output formats do not have a concept of resolution, but only of absolute image units (i.e. pixels) FOP ignores the resolution values as well. Instead, FOP uses the dimensions of the image as specified in the fo:external-graphic element to render the image:

+
    +
  • If no dimensions are given, FOP uses a default value of 72 dpi to compute the graphic's dimensions. For example, suppose a graphic 300 pixels wide and 400 pixels high. FOP will render the graphic at 4.167 inches wide, 5.555 inches high, with an apparent resolution of 72 dpi.
  • +
  • If only one dimension is given, FOP by default uses the same aspect ratio to compute the other dimension (to avoid the appearance of stretching). For example, suppose a graphic 300 pixels wide and 400 pixels high, for which content-width = ".5in". FOP will compute the content-height = .667 inches, and will render the graphic at that size, with an apparent resolution of 600 dpi.
  • +
  • If both dimensions are given, FOP simply renders the image in that space. For example, suppose a graphic 300 pixels wide and 400 pixels high, for which content-width = "3in" and content-height = "4in". FOP will render the graphic at that size, with an apparent resolution of 100 dpi.
  • +
+

If you need a higher apparent output resolution for bitmapped images, first make sure that at least one dimension of the image is defined in your XSL-FO input. Apart from that, resolution problems are in the image file itself, and must be corrected there: use or create a higher-resolution image file.

+ The explanation above describes only the basic default behavior. There are other attributes of the fo:external-graphic element that can affect the behavior described above. +
+
+ Image caching +

+ FOP caches images between runs. The URL is used as a key to identify images which means that when + a particular URL 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 URL you need to use a constantly + changing dummy parameter on the URL to avoid caching. +

+

+ The image cache has been improved considerably in the redesigned code. Therefore, a resetCache() method + has become unnecessary. If you still experience OutOfMemoryErrors, please notify us. +

+
+ +
diff --git a/src/documentation/content/xdocs/0.92/hyphenation.xml b/src/documentation/content/xdocs/0.92/hyphenation.xml new file mode 100644 index 000000000..6b21dd951 --- /dev/null +++ b/src/documentation/content/xdocs/0.92/hyphenation.xml @@ -0,0 +1,236 @@ + + + + + +
+ Apache FOP: Hyphenation + $Revision$ +
+ +
+ Hyphenation Support +
+ Introduction +

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. +
+
+ License Issues +

Many of the hyphenation files distributed with TeX and its offspring are + licenced under the LaTeX + Project Public License (LPPL), 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.

+

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.

+ 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 +

To install a custom hyphenation pattern for use with FOP:

+
    +
  1. Convert the TeX hyphenation pattern file to the FOP format. The FOP + format is an xml file conforming to the DTD found at + {fop-dir}/hyph/hyphenation.dtd.
  2. +
  3. Name this new file following this schema: + languageCode_countryCode.xml. The country code is + optional, and should be used only if needed. For example: +
      +
    • en_US.xml would be the file name for American + English hyphenation patterns.
    • +
    • it.xml would be the file name for Italian + hyphenation patterns.
    • +
    + The language and country codes must match the XSL-FO input, which + follows ISO + 639 (languages) and ISO + 3166 (countries). NOTE: The ISO 639/ISO 3166 convention is that + language names are written in lower case, while country codes are written + in upper case. FOP does not check whether the language and country specified + in the FO source are actually from the current standard, but it relies + on it being two letter strings in a few places. So you can make up your + own codes for custom hyphenation patterns, but they should be two + letter strings too (patches for proper handling extensions are welcome)
  4. +
  5. There are basically three ways to make the FOP-compatible hyphenation pattern + file(s) accessible to FOP: +
      +
    • Download the precompiled JAR from OFFO + and place it either in the {fop-dir}/lib directory, or + in a directory of your choice (and append the full path to the JAR to + the environment variable FOP_HYPHENATION_PATH).
    • +
    • Download the desired FOP-compatible hyphenation pattern file(s) from + OFFO, + and/or take your self created hyphenation pattern file(s), +
        +
      • place them in the directory {fop-dir}/hyph,
      • +
      • or place them in a directory of your choice and set the Ant variable + user.hyph.dir to point to that directory (in + build-local.properties),
      • +
      + and run Ant with build target + jar-hyphenation. This will create a JAR containing the + compiled patterns in {fop-dir}/build that will be added to the + classpath on the next run. + (When FOP is built from scratch, and there are pattern source file(s) + present in the directory pointed to by the + user.hyph.dir variable, this JAR will automatically + be created from the supplied pattern(s)).
    • +
    • Put the pattern source file(s) into a directory of your choice and + configure FOP to look for custom patterns in this directory, by setting the + <hyphenation-base> + configuration option.
    • +
    +
  6. +
+ + 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 + <hyphenation-dir> + configuration option programmatically (option 3). + +
+
+
+ Hyphenation Patterns +

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 + OFFO's Hyphenation page for examples. + Here is a brief explanation of the contents of FOP's hyphenation patterns:

+ 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 + FOP User mailing list, either + confirming their accuracy, or raising specific problems that we can + address. +
    +
  • The root of the pattern file is the <hyphenation-info> element.
  • +
  • <hyphen-char>: its attribute "value" contains the character signalling + a hyphen in the <exceptions> section. It has nothing to do with the + hyphenation character used in FOP, use the XSLFO hyphenation-character + property for defining the hyphenation character there. At some points + a dash U+002D is hardwired in the code, so you'd better use this too + (patches to rectify the situation are welcome). There is no default, + if you declare exceptions with hyphenations, you must declare the + hyphen-char too.
  • +
  • <hyphen-min> contains two attributes: +
      +
    • before: the minimum number of characters in a word allowed to exist + on a line immediately preceding a hyphenated word-break.
    • +
    • after: the minimum number of characters in a word allowed to exist + on a line immediately after a hyphenated word-break.
    • +
    + This element is unused and not even read. It should be considered a + documentation for parameters used during pattern generation. +
  • +
  • <classes> contains whitespace-separated character sets. The members + of each set should be treated as equivalent for purposes of hyphenation, + usually upper and lower case of the same character. The first character + of the set is the canonical character, the patterns and exceptions + should only contain these canonical representation characters (except + digits for weight, the period (.) as word delimiter in the patterns and + the hyphen char in exceptions, of course).
  • +
  • <exceptions> contains whitespace-separated words, each of which + has either explicit hyphen characters to denote acceptable breakage + points, or no hyphen characters, to indicate that this word should + never be hyphenated, or contain explicit <hyp> elements for specifying + changes of spelling due to hyphenation (like backen -> bak-ken or + Stoffarbe -> Stoff-farbe in the old german spelling). Exceptions override + the patterns described below. Explicit <hyp> declarations don't work + yet (patches welcome). Exceptions are generally a bit brittle, test + carefully.
  • +
  • <patterns> includes whitespace-separated patterns, which are what + drive most hyphenation decisions. The characters in these patterns are + explained as follows: +
      +
    • non-numeric characters represent characters in a sub-word to be + evaluated
    • +
    • the period character (.) represents a word boundary, i.e. either + the beginning or ending of a word
    • +
    • numeric characters represent a scoring system for indicating the + acceptability of a hyphen in this location. Odd numbers represent an + acceptable location for a hyphen, with higher values overriding lower + inhibiting values. Even numbers indicate an unacceptable location, with + higher values overriding lower values indicating an acceptable position. + A value of zero (inhibiting) is implied when there is no number present. + Generally patterns are constructed so that valuse greater than 4 are rare. + Due to a bug currently patterns with values of 8 and greater don't + have an effect, so don't wonder.
    • +
    + Here are some examples from the English patterns file: +
      +
    • Knuth (The TeXBook, Appendix H) uses the example hach4, which indicates that it is extremely undesirable to place a hyphen after the substring "hach", for example in the word "toothach-es".
    • +
    • .leg5e indicates that "leg-e", when it occurs at the beginning of a word, is a very good place to place a hyphen, if one is needed. Words like "leg-end" and "leg-er-de-main" fit this pattern.
    • +
    + Note that the algorithm that uses this data searches for each of the word's substrings in the patterns, and chooses the highest value found for letter combination. +
  • +
+

If you want to convert a TeX hyphenation pattern file, you have to undo + the TeX encoding for non-ASCII text. FOP uses Unicode, and the patterns + must be proper Unicode too. You should be aware of the XML encoding issues, + preferably use a good Unicode editor.

+

Note that FOP does not do Unicode character normalization. If you use + combining chars for accents and other character decorations, you must + declare character classes for them, and use the same sequence of base character + and combining marks in the XSLFO source, otherwise the pattern wouldn't match. + Fortunately, Unicode provides precomposed characters for all important cases + in common languages, until now nobody run seriously into this issue. Some dead + languages and dialects, especially ancient ones, may pose a real problem + though.

+

If you want to generate your own patterns, an open-source utility called + patgen is available on many Unix/Linux distributions and every TeX + distribution which can be used to assist in + creating pattern files from dictionaries. Pattern creation for languages like + english or german is an art. If you can, read Frank Liang's original paper + "Word Hy-phen-a-tion by Com-pu-ter" (yes, with hyphens). It is not available + online. The original patgen.web source, included in the TeX source distributions, + contains valuable comments, unfortunately technical details obscure often the + high level issues. Another important source is + The + TeX Book, appendix H (either read the TeX source, or run it through + TeX to typeset it). Secondary articles, for example the works by Petr Sojka, + may also give some much needed insight into problems arising in automated + hyphenation.

+
+ +
diff --git a/src/documentation/content/xdocs/0.92/index.xml b/src/documentation/content/xdocs/0.92/index.xml new file mode 100644 index 000000000..401cfdfc9 --- /dev/null +++ b/src/documentation/content/xdocs/0.92/index.xml @@ -0,0 +1,55 @@ + + + + + +
+ Apache FOP 0.92 beta + $Revision: 201586 $ +
+ +
+ Introduction +

+ The Apache FOP team is proud to present to you the largely rewritten codebase which is + finally in a state where you can start to use it. It has taken over three years to get this + far and over two years without a new release from the FOP project. We would like to encourage + you to download the code and to play with it. We're still in the process of adding new major + features and stabilizing the code. We welcome any feedback you might have and even more, any + other form of help to get the project forward. +

+

+ This third release contains many bug fix release and new features compared + to 0.91beta. To see what has changed since the last release, please visit the + Changes Page and the Release Notes. +

+
+
+ 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 +

+ To download this version, please visit the download page. +

+
+ +
diff --git a/src/documentation/content/xdocs/0.92/intermediate.xml b/src/documentation/content/xdocs/0.92/intermediate.xml new file mode 100644 index 000000000..ad42f2645 --- /dev/null +++ b/src/documentation/content/xdocs/0.92/intermediate.xml @@ -0,0 +1,145 @@ + + + + + +
+ Intermediate Format + $Revision$ +
+ + + Please note that the intermediate format is an advanced feature and can be ignored by most + users of Apache FOP. + +
+ Introduction +

+ The intermediate format (IF) is a proprietary XML format that represents the area tree + generated by the layout engine. The area tree is conceptually defined in the + XSL-FO specification in chapter 1.1.2. + The IF can be generated through the area tree XML Renderer (the XMLRenderer). +

+

+ The intermediate format can be used to generate intermediate documents that are modified + before they are finally rendered to their ultimate output format. Modifications include + adjusting and changing trait values, adding or modifying area objects, inserting prefabricated + pages, overlays, imposition (n-up, rotation, scaling etc.). Multiple IF files can be combined + to a single output file. +

+
+
+ Usage of the Intermediate Format +

+ As already mentioned, the IF is generated by using the XMLRenderer (MIME type: + application/X-fop-areatree). So, you basically set the right MIME type for + the output format and process your FO files as if you would create a PDF file. However, there + is an important detail to consider: The various Renderers don't all use the same font sources. + To be able to create the right area tree for the ultimate output file, you need to create + the IF file using the right font setup. This is achieved by telling the XMLRenderer to mimic + another renderer. This is done by calling the XMLRenderer's mimicRenderer() method with an + instance of the ultimate target renderer as the single parameter. This has a consequence: An + IF file rendered with the Java2DRenderer may not look as expected when it was actually generated + for the PDF renderer. For renderers that use the same font setup, this restriction does not + apply (PDF and PS, for example). Generating the intermediate format file is the first step. +

+

+ The second step is to reparse the IF file using the AreaTreeParser which is + found in the org.apache.fop.area package. The pages retrieved from the IF file are added to an + AreaTreeModel instance from where they are normally rendered using one of the available Renderer + implementations. You can find examples for the IF processing in the + examples/embedding + directory in the FOP distribution +

+

+ The basic pattern to parse the IF format looks like this: +

+ +

+ This example simply reads an IF file and renders it to a PDF file. Please note, that in normal + FOP operation you're shielded from having to instantiate the FontInfo object yourself. This + is normally a task of the AreaTreeHandler which is not present in this scenario. The same + applies to the AreaTreeModel instance, in this case an instance of a subclass called + RenderPagesModel. RenderPagesModel is ideal in this case as it has very little overhead + processing the individual pages. An important line in the example is the call to + endDocument() on the AreaTreeModel. This lets the Renderer know that the processing + is now finished. +

+

+ The intermediate format can also be used from the command-line + by using the "-atin" parameter for specifying the area tree XML as input file. You can also + specify a "mimic renderer" by inserting a MIME type between "-at" and the output file. +

+
+ Concatenating Documents +

+ This initial example is obviously not very useful. It would be faster to create the PDF file + directly. As the ExampleConcat.java + example shows you can easily parse multiple IF files in a row and add the parsed pages to the + same AreaTreeModel instance which essentially concatenates all the input document to one single + output document. +

+
+
+ Modifying Documents +

+ One of the most important use cases for the intermediate format is obviously modifying the area + tree XML before finally rendering it to the target format. You can easily use XSLT to process + the IF file according to your needs. Please note, that we will currently not formally describe + the intermediate format. You need to have a good understanding its structure so you don't + create any non-parseable files. We may add an XML Schema and more detailed documentation at a + later time. You're invited to help us with that. +

+
+
+ Advanced Use +

+ The generation of the intermediate format as well as it parsing process has been designed to allow + for maximum flexibility and optimization. Please note that you can call setTransformerHandler() on + XMLRenderer to give the XMLRenderer your own TransformerHandler instance in case you would like to + do custom serialization (to a W3C DOM, for example) and/or to directly modify the area tree using + XSLT. The AreaTreeParser on the other side allows you to retrieve a ContentHandler instance where + you can manually send SAX events to to start the parsing process (see getContentHandler()). +

+
+
+ +
diff --git a/src/documentation/content/xdocs/0.92/output.xml b/src/documentation/content/xdocs/0.92/output.xml new file mode 100644 index 000000000..89b5ee233 --- /dev/null +++ b/src/documentation/content/xdocs/0.92/output.xml @@ -0,0 +1,400 @@ + + + + + + +
+ Apache FOP Output Formats + $Revision$ + + + + +
+ + +

+ FOP supports multiple output formats by using a different renderer for each format. + The renderers do not all have the same set of capabilities, sometimes because of + the output format itself, sometimes because some renderers get more development + attention than others. +

+
+ General Information +
+ Fonts +

+ Most FOP renderers use a FOP-specific system for font registration. + However, the Java2D/AWT and print renderers use the Java AWT package, which gets its + font information from the operating system registration. + This can result in several differences, including actually using different fonts, + and having different font metrics for the same font. + The net effect is that the layout of a given FO document can be quite different between + renderers that do not use the same font information. +

+
+
+ Output to a Printer or Other Device +

+ The most obvious way to print your document is to use the FOP + print renderer, which uses the Java2D API (AWT). + However, you can also send output from the Postscript renderer directly to a Postscript + device, or output from the PCL renderer directly to a PCL device. +

+

+ Here are Windows command-line examples for Postscript and PCL: +

+ + +

+ Here is some Java code to accomplish the task in UNIX: +

+ +

+ Set the output MIME type to "application/x-pcl" (MimeConstants.MIME_PCL) and + it happily sends the PCL to the UNIX printer queue. +

+
+
+
+ PDF +

+ PDF is the best supported output format. It is also the most accurate + with text and layout. This creates a PDF document that is streamed out + as each page is rendered. This means that the internal page index + information is stored near the end of the document. + The PDF version supported is 1.4. PDF versions are forwards/backwards + compatible. +

+

+ Note that FOP does not currently support "tagged PDF", PDF/X or PDF/A-1a. + Support for PDF/A-1b has recently been added, however. +

+
+ Fonts +

+ PDF has a set of fonts that are always available to all PDF viewers; + to quote from the PDF Specification: + + "PDF prescribes a set of 14 standard fonts that can be used without prior + definition. + These include four faces each of three Latin text typefaces (Courier, + Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf + Dingbats). These fonts, or suitable substitute fonts with the same metrics, are + guaranteed to be available in all PDF viewer applications." +

+
+
+ Post-processing +

+ FOP does not currently support several desirable PDF features: XMP metadata and watermarks. + One workaround is to use Adobe Acrobat (the full version, not the Reader) to process + the file manually or with scripting that it supports. +

+

+ Another popular post-processing tool is iText, + which has tools for adding security features, document properties, watermarks, and many + other features to PDF files. +

+ + Caveat: iText may swallow PDF bookmarks. But + Jens Stavnstrup tells us + that this doesn't happen if you use iText's PDFStamper. + +

+ Here is some sample code that uses iText to encrypt a FOP-generated PDF. (Note that FOP now + supports PDF encryption. However the principles for using + iText for other PDF features are similar.) +

+ +

+ Check the iText tutorial and documentation for setting access flags, password, + encryption strength and other parameters. +

+
+
+ Watermarks +

+ In addition to the PDF Post-processing options, consider the following workarounds: +

+
    +
  • + Use a background image for the body region. +
  • +
  • + (submitted by Trevor Campbell) Place an image in a + region that overlaps the flowing text. For example, make + region-before large enough to contain your image. Then include a + block (if necessary, use an absolutely positioned block-container) + containing the watermark image in the static-content for the + region-before. Note that the image will be drawn on top of the + normal content. +
  • +
+
+
+
+ PostScript +

+ The PostScript renderer has been brought up to a similar quality as the + PDF renderer, but may still be missing certain features. It provides good + support for most text and layout. + Images and SVG are not fully supported, yet. Currently, the PostScript + renderer generates PostScript Level 3 with most DSC comments. Actually, + the only Level 3 feature used is FlateDecode, everything else is Level 2. +

+
+ Limitations +
    +
  • Images and SVG may not be displayed correctly. SVG support is far from being complete. No image transparency is available.
  • +
  • Only Type 1 fonts are supported.
  • +
  • Multibyte characters are not supported.
  • +
  • PPD support is still missing.
  • +
+
+
+
+ RTF +

+ JFOR, an open source XSL-FO to RTF converter has been integrated into Apache FOP. + This will create an RTF (rich text format) document that will + attempt to contain as much information from the fo document as + possible. The RTF output follows Microsoft's RTF specifications + and produces best results on Microsoft Word. +

+
+
+ XML (Area Tree XML) +

+ This is primarily for testing and verification. The XML created is simply + a representation of the internal area tree put into XML. We use that to verify + the functionality of FOP's layout engine. +

+

+ The other use case of the Area Tree XML is as FOP's "intermediate format". More information + on that can be found on the page dedicated to the Intermediate Format. +

+
+
+ Java2D/AWT + The Java2D/AWT, Print and Bitmap renderers may not yet fully work as expected. There are some known bugs and missing features. +

+ The AWT viewer shows a window with the pages displayed inside a + Java graphic. It displays one page at a time. + The fonts used for the formatting and viewing depend on the fonts + available to your JRE. +

+
+
+ Print +

+ It is possible to directly print the document from the command line. + This is done with the same code that renders to the Java2D/AWT renderer. +

+
+
+ Bitmap (TIFF/PNG) +

+ It is possible to directly create bitmap images from the individual + pages generated by the layout engine. + This is done with the same code that renders to the Java2D/AWT renderer. +

+

+ Currently, two output formats are supported: PNG and TIFF. TIFF produces + one file with multiple pages, while PNG output produces one file per + page. The quality of the bitmap depends on the resolution setting on the + FOUserAgent. +

+
+
+ TXT +

+ The text renderer produces plain ASCII text output + that attempts to match the output of the PDFRenderer as closely as + possible. This was originally developed to accommodate an archive system + that could only accept plain text files, and is primarily useful for getting + a quick-and-dirty view of the document text. The renderer is very limited, + so do not be surprised if it gives unsatisfactory results. +

+

+ The Text renderer works with a fixed size page buffer. The size of this + buffer is controlled with the textCPI and textLPI public variables. + The textCPI is the effective horizontal characters per inch to use. + The textLPI is the vertical lines per inch to use. From these values + and the page width and height the size of the buffer is calculated. + The formatting objects to be rendered are then mapped to this grid. + Graphic elements (lines, borders, etc) are assigned a lower priority + than text, so text will overwrite any graphic element representations. +

+

+ Because FOP lays the text onto a grid during layout, there are frequently + extra or missing spaces between characters and lines, which is generally + unsatisfactory. + Users have reported that the optimal settings to avoid such spacing problems are: +

+
    +
  • font-family="Courier"
  • +
  • font-size="7.3pt"
  • +
  • line-height="10.5pt"
  • +
+
+
+ Output Formats in the Sandbox +

+ Due to the state of certain renderers we moved some of them to a "sandbox" area until + they are ready for more serious use. The renderers and FOEventHandlers in the sandbox + can be found under src/sandbox and are compiled into build/fop-sandbox.jar during the + main build. The output formats in the sandbox are marked as such below. +

+
+ PCL + The PCL Renderer is in the sandbox and not yet functional in FOP Trunk!!! Please help us ressurrect this feature. +

+ This format is for the Hewlett-Packard PCL printers. + It should produce output as close to identical as possible to the + printed output of the PDFRenderer within the limitations of the + renderer, and output device. +

+ + + +
+
+ MIF + The MIF handler is in the sandbox and not yet functional in FOP Trunk!!! Please help us ressurrect this feature. +

+ This format is the Maker Interchange Format which is used by + Adobe Framemaker. +

+
+
+ SVG + The SVG renderer is in the sandbox and may not work as expected in FOP Trunk!!! Please help us improve this feature. +

+ This format creates an SVG document that has links between the pages. + This is primarily for slides and creating svg images of pages. + Large documents will create SVG files that are far too large for + an SVG viewer to handle. Since FO documents usually have text the + SVG document will have a large number of text elements. + The font information for the text is obtained from the JVM in the + same way as for the AWT viewer. If the SVG is viewed on a + system where the fonts are different, such as another platform, + then the page may look wrong. +

+
+
+
+ Wish list +

+ Apache FOP is easily extensible and allows you to add new output formats to enhance FOP's functionality. There's a number of output formats + which are on our wish list. We're looking for volunteers to help us implement them. +

+ +
+ + +
+ diff --git a/src/documentation/content/xdocs/0.92/pdfa.xml b/src/documentation/content/xdocs/0.92/pdfa.xml new file mode 100644 index 000000000..0df4d6adb --- /dev/null +++ b/src/documentation/content/xdocs/0.92/pdfa.xml @@ -0,0 +1,132 @@ + + + + + +
+ PDF/A (ISO 19005) + $Revision: 389563 $ + + + +
+ +
+ Overview + + Support for PDF/A is available beginning with version 0.92. + +

+ PDF/A is a standard which turns PDF into an "electronic document file + format for long-term preservation". PDF/A-1 is the first part of the + standard and is documented in + ISO 19005-1:2005(E). + Work on PDF/A-2 is in progress at + AIIM. +

+

+ Design documentation on PDF/A can be found on FOP's Wiki on the + PDFA1ConformanceNotes page. +

+
+
+ Implementation Status +

+ PDF/A-1b is implemented to the degree that FOP supports + the creation of the elements described in ISO 19005-1. +

+

+ There is a restriction with + XMP metadata. If an XMP metadata packet is present in the fo:declarations + element of an FO file, the values from the XMP packet are not synchronized + with the Info PDF object as is mandated by chapter 6.7.3 of the ISO document. + However, if no XMP packet is supplied FOP automatically generates an XMP + packet from the values in the Info PDF object. +

+

+ Tests have been performed against jHove and Adobe Acrobat 7.0.7 (Preflight function). +

+

+ PDF/A-1a is not implemented, yet. This is mostly because of the requirement + for tagged PDF which is not available in FOP, yet. +

+
+
+ Usage (command line) +

+ If you specify "-pdfa1b" instead of "-pdf" for the output format on the + command line, support for PDF/A-1b is activated. If there is a violation of + one of the validation rules for PDF/A, an error message is presented and the + processing stops. +

+
+
+ Usage (embedded) +

+ When FOP is embedded in another Java application you can set a special option + on the renderer options in the user agent to activate the PDF/A-1b profile. + Here's an example: +

+ +

+ If one of the validation rules of PDF/A is violated, an PDFConformanceException + (descendant of RuntimeException) is thrown. +

+
+
+ PDF/A in Action +

+ There are a number of things that must be looked after if you activate a PDF/A + profile. If you receive a PDFConformanceException, have a look at the following + list (not necessarily comprehensive): +

+
    +
  • + Make sure all (!) fonts are embedded. If you use base 14 fonts (like Helvetica) + you need to obtain a license for them and embed them like any other font. +
  • +
  • + Don't use PDF encryption. PDF/A doesn't allow it. +
  • +
  • + Don't use CMYK images without an ICC color profile. PDF/A doesn't allow mixing + color spaces and FOP currently only properly supports the sRGB color space. Please + note that FOP embeds a standard sRGB ICC profile (sRGB IEC61966-2.1) as the + primary output intent for the PDF. +
  • +
  • + Don't use non-RGB colors in SVG images. Same issue as with CMYK images. +
  • +
  • + Don't use EPS graphics with fo:external-graphic. Embedding EPS graphics in PDF + is deprecated since PDF 1.4 and prohibited by PDF/A. +
  • +
  • + PDF is forced to version 1.4 if PDF/A-1 is activated. +
  • +
  • + No filter must be specified explicitely for metadata objects. Metadata must be + embedded in clear text so non-PDF-aware applications can extract the XMP metadata. +
  • +
+
+ +
diff --git a/src/documentation/content/xdocs/0.92/pdfencryption.xml b/src/documentation/content/xdocs/0.92/pdfencryption.xml new file mode 100755 index 000000000..aca98135a --- /dev/null +++ b/src/documentation/content/xdocs/0.92/pdfencryption.xml @@ -0,0 +1,233 @@ + + + + + +
+ PDF encryption. + $Revision$ + + + + +
+ +
+ Overview + + PDF Encryption is available in Release 0.20.5 and later. The comments on this page do + not apply to releases earlier than 0.20.5. + +

+ FOP supports encryption of PDF output, thanks to Patrick + C. Lankswert. This feature is commonly used to prevent + unauthorized viewing, printing, editing, copying text from the + document and doing annotations. It is also possible to ask the + user for a password in order to view the contents. Note that + there already exist third party applications which can decrypt + an encrypted PDF without effort and allow the aforementioned + operations, therefore the degree of protection is limited. +

+

+ For further information about features and restrictions regarding PDF + encryption, look at the documentation coming with Adobe Acrobat or the + technical documentation on the Adobe web site. +

+
+
+ Usage (command line) +

+ Encryption is enabled by supplying any of the encryption related + options. +

+

+ An owner password is set with the -o option. This + password is actually used as encryption key. Many tools for + PDF processing ask for this password to disregard any + restriction imposed on the PDF document. +

+

+ If no owner password has been supplied but FOP was asked to apply some + restrictions, a random password is used. In this case it is obviously + impossiible to disregard restrictions in PDF processing tools. +

+

+ A user password, supplied with the -u option, will + cause the PDF display software to ask the reader for this password in + order to view the contents of the document. If no user password was + supplied, viewing the content is not restricted. +

+

+ Further restrictions can be imposed by using the -noprint, + -nocopy, -noedit and + -noannotations options, which disable printing, copying + text, editing in Adobe Acrobat and making annotations, respectively. +

+
+
+ Usage (embedded) +

+ When FOP is embedded in another Java application you need to set an + options map on the renderer. These are the supported options: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionDescriptionValuesDefault
ownerPasswordThe owner passwordString +
userPasswordThe user passwordString +
allowPrintAllows/disallows printing of the PDF"TRUE" or "FALSE""TRUE"
allowCopyContentAllows/disallows copy/paste of content"TRUE" or "FALSE""TRUE"
allowEditContentAllows/disallows editing of content"TRUE" or "FALSE""TRUE"
allowEditAnnotationsAllows/disallows editing of annotations"TRUE" or "FALSE""TRUE"
+ + Encryption is enabled as soon as one of these options is set. + +

+ An example to enable PDF encryption in Java code: +

+ +

+ The parameters for the constructor of PDFEncryptionParams are: +

+
    +
  1. userPassword: String, may be null
  2. +
  3. ownerPassword: String, may be null
  4. +
  5. allowPrint: true if printing is allowed
  6. +
  7. allowCopyContent: true if copying content is allowed
  8. +
  9. allowEditContent: true if editing content is allowed
  10. +
  11. allowEditAnnotations: true if editing annotations is allowed
  12. +
+

+ Alternatively, you can set each value separately in the Map provided by + FOUserAgent.getRendererOptions() by using the following keys: +

+
    +
  1. user-password: String
  2. +
  3. owner-password: String
  4. +
  5. noprint: Boolean or "true"/"false"
  6. +
  7. nocopy: Boolean or "true"/"false"
  8. +
  9. noedit: Boolean or "true"/"false"
  10. +
  11. noannotations: Boolean or "true"/"false"
  12. +
+
+
+ Environment +

+ In order to use PDF encryption, FOP has to be compiled with + cryptography support. Currently, only JCE + is supported. JCE is part of JDK 1.4. For earlier JDKs, it can + be installed separately. The build process automatically + detects JCE presence and installs PDF encryption support if + possible, otherwise a stub is compiled in. +

+

+ Cryptography support must also be present at run time. In particular, a + provider for the RC4 cipher is needed. Unfortunately, the sample JCE + provider in Sun's JDK 1.4 does not provide RC4. If you + get a message saying +

+ "Cannot find any provider supporting RC4" +

+ then you don't have the needed infrastructure. +

+

+ There are several commercial and a few Open Source packages which + provide RC4. A pure Java implementation is produced by The Legion of the Bouncy + Castle. Mozilla + JSS is an interface to a native implementation. +

+
+
+ Installing a crypto provider +

+ The pure Java implementation from Bouncy Castle is easy to + install. +

+
    +
  1. + Download the binary distribution for your JDK version. If you have JDK + 1.3 or earlier you must also download a JCE from the same page. +
  2. +
  3. + Unpack the distribution. Add the jar file to your classpath. A + convenient way to use the jar on Linux is to simply drop it into the + FOP lib directory, it will be automatically picked up by + fop.sh. If you have JDK 1.3 or earlier don't forget to + install the JCE as well. +
  4. +
  5. + Open the java.security file and add
    + security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider,
    + preferably at the end of the block defining the other crypto + providers. For JDK 1.4 this is detailed on Sun's web site. +
  6. +
+

+ If you have any experience with Mozilla JSS or any other + cryptography provider, please post it to the fop-user list. +

+
+ +
diff --git a/src/documentation/content/xdocs/0.92/running.xml b/src/documentation/content/xdocs/0.92/running.xml new file mode 100644 index 000000000..302f2efe4 --- /dev/null +++ b/src/documentation/content/xdocs/0.92/running.xml @@ -0,0 +1,279 @@ + + + + + +
+ Running Apache FOP + $Revision$ +
+ + +
+ System Requirements +

The following software must be installed:

+ +

The following software is optional, depending on your needs:

+ +

In addition, the following system requirements apply:

+
    +
  • + If you will be using FOP to process SVG, you must do so in a graphical environment. + See FOP: Graphics (Batik) for details. +
  • +
+
+
+ Installation +
+ Instructions +

+ Basic FOP installation consists of first unzipping the .gz file that is the + distribution medium, then unarchiving the resulting .tar file in a + directory/folder that is convenient on your system. Please consult your operating system + documentation or Zip application software documentation for instructions specific to your + site. +

+
+
+ Problems +

+ Some Mac OSX users have experienced filename truncation problems using Stuffit to unzip + and unarchive their distribution media. This is a legacy of older Mac operating systems, + which had a 31-character pathname limit. Several Mac OSX users have recommended that + Mac OSX users use the shell command tar -xzf instead. +

+
+
+
+ Starting FOP as a Standalone Application +

+ The usual and recommended practice for starting FOP from the command line is to run the + batch file fop.bat (Windows) or the shell script fop (Unix/Linux). + If you write your own scripts, be sure to review these standard scripts to make sure that + you get your environment properly configured. +

+

+ The standard scripts for starting FOP require that the environment variable JAVA_HOME be + set to a path pointing to the appropriate Java installation on your system. Macintosh OSX + includes a Java environment as part of its distribution. We are told by Mac OSX users that + the path to use in this case is /Library/Java/Home. Caveat: + We suspect that, as Apple releases new Java environments and as FOP upgrades the minimum + Java requirements, the two will inevitably not match on some systems. Please see + Java on Mac OSX FAQ for information as + it becomes available. +

+

+ As an alternative to the start scripts you can run "java -jar build/fop.jar" in which case + FOP tries to build the classpath for running FOP dynamically. Please note, that this might + not always work as expected. +

+ + [OPTIONS] + -d debug mode + -x dump configuration settings + -q quiet mode + -c cfg.xml use additional configuration file cfg.xml + -l lang the language to use for user information + -r relaxed/less strict validation (where available) + -dpi xxx target resolution in dots per inch (dpi) where xxx is a number + -s for area tree XML, down to block areas only + -v to show FOP version being used + + [INPUT] + infile xsl:fo input file (the same as the next) + -fo infile xsl:fo input file + -xml infile xml input file, must be used together with -xsl + -xsl stylesheet xslt stylesheet + -atin infile area tree input file + -param name value to use for parameter in xslt stylesheet + (repeat '-param name value' for each parameter) + + [OUTPUT] + outfile input will be rendered as pdf file into outfile + -pdf outfile input will be rendered as pdf file (outfile req'd) + -awt input will be displayed on screen + -mif outfile input will be rendered as mif file (outfile req'd) + -rtf outfile input will be rendered as rtf file (outfile req'd) + -tiff outfile input will be rendered as tiff file (outfile req'd) + -png outfile input will be rendered as png file (outfile req'd) + -pcl outfile input will be rendered as pcl file (outfile req'd) + -ps outfile input will be rendered as PostScript file (outfile req'd) + -txt outfile input will be rendered as text file (outfile req'd) + -svg outfile input will be rendered as an svg slides file (outfile req'd) + -at [mime] out representation of area tree as XML (outfile req'd) + specify optional mime output to allow AT to be converted + to final format later + -print input file will be rendered and sent to the printer + see options with "-print help" + -out mime outfile input will be rendered using the given MIME type + (outfile req'd) Example: "-out application/pdf D:\out.pdf" + (Tip: "-out list" prints the list of supported MIME types) + + -foout outfile input will only be XSL transformed. The intermediate + XSL-FO file is saved and no rendering is performed. + (Only available if you use -xml and -xsl parameters) + + [Examples] + Fop foo.fo foo.pdf + Fop -fo foo.fo -pdf foo.pdf (does the same as the previous line) + Fop -xml foo.xml -xsl foo.xsl -pdf foo.pdf + Fop -xml foo.xml -xsl foo.xsl -foout foo.fo + Fop foo.fo -mif foo.mif + Fop foo.fo -rtf foo.rtf + Fop foo.fo -print or Fop -print foo.fo + Fop foo.fo -awt]]> +

+ PDF encryption is only available if FOP was compiled with encryption support + and if compatible encryption support is availabe at run time. + Currently, only the JCE is supported. Check the Details. +

+
+
+ Using Xalan to Check XSL-FO Input +

+ FOP sessions that use -xml and -xsl input instead of -fo input are actually + controlling two distinct conversions: Tranforming XML to XSL-FO, then formatting + the XSL-FO to PDF (or another FOP output format). + Although FOP controls both of these processes, the first is included merely as + a convenience and for performance reasons. + Only the second is part of FOP's core processing. + If a user has a problem running FOP, it is important to determine which of these + two processes is causing the problem. + If the problem is in the first process, the user's stylesheet is likely the cause. + The FOP development team does not have resources to help with stylesheet issues, + although we have included links to some useful + Specifications and + Books/Articles. + If the problem is in the second process, FOP may have a bug or an unimplemented + feature that does require attention from the FOP development team. +

+ The user is always responsible to provide correct XSL-FO code to FOP. +

+ In the case of using -xml and -xsl input, although the user is responsible for + the XSL-FO code that is FOP's input, it is not visible to the user. To make the + intermediate FO file visible, the FOP distribution includes the "-foout" option + which causes FOP to run only the first (transformation) step, and write the + results to a file. (See also the Xalan command-line below) +

+ + When asking for help on the FOP mailing lists, never attach XML and + XSL to illustrate the issue. Always run the XSLT step (-foout) and send the + resulting XSL-FO file instead. Of course, be sure that the XSL-FO file is + correct before sending it. + +

+ The -foout option works the same way as if you would call the + Xalan command-line: +

+

+ java org.apache.xalan.xslt.Process -IN xmlfile -XSL file -OUT outfile +

+

+ Note that there are some subtle differences between the FOP and Xalan command-lines. +

+
+
+ Memory Usage +

+ FOP can consume quite a bit of memory, even though this has been continually improved. + This is partly inherent to the formatting process and partly caused by implementation choices. + All FO processors currently on the market have memory problems with certain layouts. +

+

+ If you are running out of memory when using FOP, here are some ideas that may help: +

+
    +
  • + Increase memory available to the JVM. See + the -Xmx option + for more information. + + It is usually unwise to increase the memory allocated to the JVM beyond the amount of + physical RAM, as this will generally cause significantly slower performance. + +
  • +
  • + Avoid forward references. + Forward references are references to some later part of a document. + Examples include page number citations which refer to pages which follow the citation, + tables of contents at the beginning of a document, and page numbering schemes that + include the total number of pages in the document + ("page N of TOTAL"). + Forward references cause all subsequent pages to be held in memory until the reference + can be resolved, i.e. until the page with the referenced element is encountered. + Forward references may be required by the task, but if you are getting a memory + overflow, at least consider the possibility of eliminating them. + A table of contents could be replaced by PDF bookmarks instead or moved to the end of + the document (reshuffle the paper could after printing). +
  • +
  • + Avoid large images, especially if they are scaled down. + If they need to be scaled, scale them in another application upstream from FOP. + For many image formats, memory consumption is driven mainly by the size of the image + file itself, not its dimensions (width*height), so increasing the compression rate + may help. +
  • +
  • + Use multiple page sequences. + FOP starts rendering after the end of a page sequence is encountered. + While the actual rendering is done page-by-page, some additional memory is + freed after the page sequence has been rendered. + This can be substantial if the page sequence contains lots of FO elements. +
  • +
+

+ One of FOP's stated design goals is to be able to process input of arbitrary size. + Addressing this goal is one of the prime motivations behind the + FOP Redesign. +

+
+
+ Problems +

If you have problems running FOP, please see the "How to get Help" page.

+
+ +
diff --git a/src/documentation/content/xdocs/0.92/servlets.xml b/src/documentation/content/xdocs/0.92/servlets.xml new file mode 100644 index 000000000..b26cef592 --- /dev/null +++ b/src/documentation/content/xdocs/0.92/servlets.xml @@ -0,0 +1,259 @@ + + + + + +
+ Servlets + How to use Apache FOP in a Servlet + $Revision$ +
+ +
+ Overview +

+ This page discusses topic all around using Apache FOP in a servlet environment. +

+
+
+ Example Servlets in the FOP distribution +

+ In the directory {fop-dir}/src/java/org/apache/fop/servlet, you'll find a working example + of a FOP-enabled servlet. +

+

+ The servlet is automatically built when you build Apache FOP using the supplied Ant script. After building + the servlet, drop fop.war into the webapps directory of Apache Tomcat (or any other web container). Then, you can use + URLs like the following to generate PDF files: +

+
    +
  • http://localhost:8080/fop/fop?fo=/home/path/to/fofile.fo
  • +
  • http://localhost:8080/fop/fop?xml=/home/path/to/xmlfile.xml&xsl=/home/path/to/xslfile.xsl
  • +
+

+

The source code for the servlet can be found under {fop-dir}/src/java/org/apache/fop/servlet/FopServlet.java.

+ + This example servlet should not be used on a public web server connected to the Internet as it does not contain + any measures to prevent Denial-of-Service-Attacks. It is provided as an example and as a starting point for + your own servlet. + +
+
+ Create your own Servlet + + This section assumes you are familiar with embedding FOP. + +
+ A minimal Servlet +

+ Here is a minimal code snippet to demonstrate the basics: +

+ private FopFactory fopFactory = FopFactory.newInstance(); +private TransformerFactory tFactory = TransformerFactory.newInstance(); + +public void doGet(HttpServletRequest request, + HttpServletResponse response) throws ServletException { + try { + response.setContentType("application/pdf"); + Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, response.getOutputStream()); + Transformer transformer = tFactory.newTransformer(); + Source src = new StreamSource("foo.fo"); + Result res = new SAXResult(fop.getDefaultHandler()); + transformer.transform(src, res); + } catch (Exception ex) { + throw new ServletException(ex); + } +} + + There are numerous problems with the code snippet above. + Its purpose is only to demonstrate the basic concepts. + See below for details. + +
+
+ Adding XSL tranformation (XSLT) +

+ A common requirement is to transform an XML source to + XSL-FO using an XSL transformation. It is recommended to use + JAXP for this task. The following snippet shows the basic + code: +

+ private FopFactory fopFactory = FopFactory.newInstance(); +private TransformerFactory tFactory = TransformerFactory.newInstance(); + +public void init() throws ServletException { + //Optionally customize the FopFactory and TransformerFactory here +} + +[..] + + //Setup a buffer to obtain the content length + ByteArrayOutputStream out = new ByteArrayOutputStream(); + + //Setup FOP + Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, out); + + //Setup Transformer + Source xsltSrc = new StreamSource(new File("foo-xml2fo.xsl")); + Transformer transformer = tFactory.newTransformer(xsltSrc); + + //Make sure the XSL transformation's result is piped through to FOP + Result res = new SAXResult(fop.getDefaultHandler()); + + //Setup input + Source src = new StreamSource(new File("foo.xml")); + + //Start the transformation and rendering process + transformer.transform(src, res); + + //Prepare response + response.setContentType("application/pdf"); + response.setContentLength(out.size()); + + //Send content to Browser + response.getOutputStream().write(out.toByteArray()); + response.getOutputStream().flush(); + + Buffering the generated PDF in a ByteArrayOutputStream is done to avoid potential + problems with the Acrobat Reader Plug-in in Microsoft Internet Explorer. + +

+ The Source instance used above is simply an + example. If you have to read the XML from a string, supply + a new StreamSource(new + StringReader(xmlstring)). Constructing and reparsing + an XML string is generally less desirable than using a + SAXSource if you generate your XML. You can alternatively + supply a DOMSource as well. You may also use dynamically + generated XSL if you like. +

+

+ Because you have an explicit Transformer object, you can also use it to + explicitely set parameters for the transformation run. +

+
+
+ Custom configuration +

+ You can easily set up your own FOUserAgent as demonstrated on the Embedding page. +

+
+
+ Improving performance +

+ There are several options to consider: +

+
    +
  • + Instead of java.io.ByteArrayOutputStream consider using the ByteArrayOutputStream + implementation from the Jakarta Commons IO project which allocates less memory. + The full class name is: org.apache.commons.io.output.ByteArrayOutputStream +
  • +
  • + In certain cases it can help to write the generated PDF to a temporary file so + you can quickly reuse the file. This is especially useful, if Internet Explorer + calls the servlet multiple times with the same request or if you often generate + equal PDFs. +
  • +
+

+ Of course, the + performance hints from the Embedding page + apply here, too. +

+
+
+
+ Notes on Microsoft Internet Explorer +

+ Some versions of Internet Explorer will not automatically show the PDF or call the servlet multiple times. + These are well-known limitations of Internet Explorer and are not a problem of the servlet. + However, Internet Explorer can still be used to download the PDF so that it can be viewed later. + Here are some suggestions in this context: +

+
    +
  • + Use an URL ending in .pdf, like + http://myserver/servlet/stuff.pdf. Yes, the servlet can + be configured to handle this. If the URL has to contain parameters, + try to have both the base URL as well as the last parameter end in + .pdf, if necessary append a dummy parameter, like + http://myserver/servlet/stuff.pdf?par1=a&par2=b&d=.pdf. The + effect may depend on IEx version. +
  • +
  • + Give IEx the opportunity to cache. In particular, ensure the + server does not set any headers causing IEx not to cache the + content. This may be a real problem if the document is sent + over HTTPS, because most IEx installations will by default + not cache any content retrieved over HTTPS. + Setting the Expires header entry may help in + this case:
    response.setDateHeader("Expires", + System.currentTimeMillis() + cacheExpiringDuration * + 1000);
    Consult your server manual and the + relevant RFCs for further details on HTTP headers and + caching. +
  • +
  • + Cache in the server. It may help to include a parameter in + the URL which has a timestamp as the value min order to + decide whether a request is repeated. IEx is reported to + retrieve a document up to three times, but never more often. +
  • +
+
+
+ Servlet Engines +

+ When using a servlet engine, there are potential CLASSPATH issues, and potential conflicts + with existing XML/XSLT libraries. Servlet containers also often use their own classloaders + for loading webapps, which can cause bugs and security problems. +

+
+ Tomcat +

+ Check Tomcat's documentation for detailed instructions about installing FOP and Cocoon. + There are known bugs that must be addressed, particularly for Tomcat 4.0.3. +

+
+
+ WebSphere 3.5 +

+ Put a copy of a working parser in some directory where WebSphere can access it. + For example, if /usr/webapps/yourapp/servlets is the CLASSPATH for your servlets, + copy the Xerces jar into it (any other directory would also be fine). + Do not add the jar to the servlet CLASSPATH, but add it to the CLASSPATH of the + application server which contains your web application. + In the WebSphere administration console, click on the "environment" button in the + "general" tab. In the "variable name" box, enter "CLASSPATH". + In the "value" box, enter the correct path to the parser jar file + (/usr/webapps/yourapp/servlets/Xerces.jar in our example here). + Press "OK", then apply the change and restart the application server. +

+
+
+
+ Handling complex use cases +

+ Sometimes the requirements for a servlet get quite sophisticated: SQL data sources, + multiple XSL transformations, merging of several datasources etc. In such a case + consider using Apache Cocoon instead + of a custom servlet to accomplish your goal. +

+
+ +
\ No newline at end of file diff --git a/src/documentation/content/xdocs/0.92/upgrading.xml b/src/documentation/content/xdocs/0.92/upgrading.xml new file mode 100644 index 000000000..b60a1c5e7 --- /dev/null +++ b/src/documentation/content/xdocs/0.92/upgrading.xml @@ -0,0 +1,119 @@ + + + + + +
+ Upgrading from an Earlier Version of Apache FOP + $Revision$ +
+ +
+ Important! +

+ If you're planning to upgrade to the latest FOP version there are a few very important things + to consider: +

+
    +
  • + More than half of the codebase has been rewritten over the last three years. The code is + relatively new and possibly not as stable as version 0.20.5 in every regard. But the code + is quickly approaching production level, especially when you're happy + with only PDF and PostScript output. +
  • +
  • + The API of FOP has changed considerably and is not backwards-compatible with version 0.20.5. +
  • +
  • + There have been changes to the end-user API between 0.91 beta and 0.92 beta. With version 0.92, + the API is now considered stable. Some methods have been deprecated and will be removed with + the next release. If you upgrade from 0.91 beta, you will need to adjust your Java code. +
  • +
  • +

    + The new code is much more strict about the interpretation of the XSL-FO 1.0 specification. + Things that worked fine in version 0.20.5 might start to produce warnings or even errors + now. FOP 0.20.5 contains many bugs which have been corrected in the new code. +

    + + While FOP 0.20.5 allowed you to have empty fo:table-cell elements, the new code + will complain about that (unless relaxed validation is enabled) because the specification + demands at least one block-level element ((%block;)+, see + XSL-FO 1.0, 6.7.10) + inside an fo:table-cell element. + +
  • +
  • + Extensions and Renderers written for version 0.20.5 will not work with the new code! The new FOP + extension for Barcode4J will be available in + January 2006. +
  • +
  • + The PCL Renderer and the MIF Handler have not been resurrected, yet! They are currently non-functional + and hope for someone to step up and reimplement them. +
  • +
  • + By looking at the Compliance page you might get the impression + that the new code is much more advanced than version 0.20.5. That's true but there may still + be a few things that may not be handled as gracefully by the new code as by version 0.20.5. +
  • +
+
+
+ What you need to know when you upgrade! +

+ When you use your existing FO files or XML/XSL files which work fine with FOP version + 0.20.5 against this FOP version some things may not work as expected. The following + list will hopefully help you to identify and correct those problems. +

+
    +
  • + Check the Compliance page for the feature causing + trouble. It may contain the necessary information to understand and resolve the problem. +
  • +
  • + Not all 0.20.5 output formats are supported. PDF and Postscript should be fully supported. + See Output Targets for a more complete description. +
  • +
  • + As stated above empty table cells <fo:table-cell></fo:table-cell> + are not allowed by the specification. The same applies to empty static-content + and block-container elements, for example. +
  • +
  • + 0.20.5 is not XSL-FO compliant with respect to sizing images (external-graphic) + or instream-foreign-object + objects. If images or SVGs are sized differently in your outputs with the new FOP version + check Bug 37136 + as it contains some hints on what to. The file + + "examples/fo/basic/images.fo" has + a number of good examples that shows the new, more correct behaviour. +
  • +
  • + The fox:outline extension not implemented in this version anymore. + It has been superseded by the new bookmark elements from XSL-FO 1.1. +
  • +
  • + The fox:destination extension is also not implemented in this version + although it may be added in the future. See also + Bug 37157. +
  • +
+
+ +
diff --git a/src/documentation/content/xdocs/compliance.ihtml b/src/documentation/content/xdocs/compliance.ihtml index 3f7b7b037..bf034b19d 100644 --- a/src/documentation/content/xdocs/compliance.ihtml +++ b/src/documentation/content/xdocs/compliance.ihtml @@ -209,7 +209,7 @@ 0.20.5 (current stable) - 0.91 beta (unstable) + 0.92 beta @@ -647,7 +647,7 @@ [0.20.5] For absolute positioning, use 'position="absolute"' (as 'absolute-position="absolute"' is not implemented), and specify all four of "left", "top", "width" and "height"
  • - [0.91 beta] No known restrictions. + [0.92 beta] No known restrictions.
  • @@ -861,7 +861,7 @@ [0.20.5] Only works for table of contents without any problems. The case where the page number doesn't fit on a line isn't handled, and any text on the same line and after the page-number might not appear exactly where you want it to.
  • - [0.91 beta] After the page number is known, no relayout is performed. The appearance may be suboptimal depending on the use case. + [0.92 beta] After the page number is known, no relayout is performed. The appearance may be suboptimal depending on the use case.
  • @@ -910,7 +910,7 @@ @@ -1391,7 +1391,7 @@ @@ -1438,7 +1438,7 @@ @@ -1510,7 +1510,7 @@ 0.20.5 (current stable) - 0.91 beta (unstable) + 0.92 beta (unstable) @@ -1585,7 +1585,7 @@ [0.20.5] Use shorthand position="absolute" as a workaround.
  • - [0.91 beta] No restrictions. The 0.20.5 work-around is not supported. + [0.92 beta] No restrictions. The 0.20.5 work-around is not supported.
  • @@ -2079,7 +2079,7 @@ @@ -2103,7 +2103,7 @@ @@ -2908,7 +2908,7 @@ [0.20.5] font-family lists are not supported, use a single font-family name
  • - [0.91 beta] font-family lists are allowed but glyph based font selection is not supported + [0.92 beta] font-family lists are allowed but glyph based font selection is not supported
  • @@ -3063,7 +3063,7 @@ [0.20.5] "normal", "bolder" and "lighter" are not supported
  • - [0.91 beta] TODO <relative> font weights + [0.92 beta] TODO <relative> font weights
  • @@ -3336,7 +3336,7 @@ [0.20.5] space-before.optimum supported
  • - [0.91 beta] Space adjustment may not fully work everywhere, yet. + [0.92 beta] Space adjustment may not fully work everywhere, yet.
  • @@ -3363,7 +3363,7 @@ [0.20.5] space-after.optimum supported
  • - [0.91 beta] Space adjustment may not fully work everywhere, yet. + [0.92 beta] Space adjustment may not fully work everywhere, yet.
  • @@ -3572,7 +3572,7 @@ [0.20.5] For table-cell, the "height" attribute must be set for the parent table-row; setting the height of the table or the table-cell results in vertical centering having no effect.
  • - [0.91 beta] TODO Check e-g, i-f-o. + [0.92 beta] TODO Check e-g, i-f-o.
  • @@ -3986,7 +3986,7 @@ @@ -4004,15 +4004,11 @@ no - - partial + + yes - +   @@ -4034,7 +4030,8 @@ @@ -4146,7 +4143,7 @@ @@ -4513,10 +4510,10 @@ [0.20.5] works only in table rows
  • - [0.91 beta] works on all implemented block-level FOs, but not on inline-level FOs. + [0.92 beta] works on all implemented block-level FOs, but not on inline-level FOs.
  • - [0.91 beta] <integer> values are not supported. + [0.92 beta] <integer> values are not supported.
  • @@ -4543,10 +4540,10 @@ [0.20.5] works only in table rows
  • - [0.91 beta] works on all implemented block-level FOs, but not on inline-level FOs. + [0.92 beta] works on all implemented block-level FOs, but not on inline-level FOs.
  • - [0.91 beta] <integer> values are not supported. + [0.92 beta] <integer> values are not supported.
  • @@ -4573,10 +4570,10 @@ [0.20.5] works only in table rows
  • - [0.91 beta] works on all implemented FOs, except list- and table-related and inline-level FOs. + [0.92 beta] works on all implemented FOs, except list- and table-related and inline-level FOs.
  • - [0.91 beta] <integer> values are not supported. + [0.92 beta] <integer> values are not supported.
  • @@ -4740,7 +4737,7 @@ [0.20.5] not value "page"
  • - [0.91 beta] Not supported + [0.92 beta] Not supported
  • @@ -4767,7 +4764,7 @@ [0.20.5] not value "use-content"
  • - [0.91 beta] Value "use-content" does not work in all circumstances. + [0.92 beta] Value "use-content" does not work in all circumstances.
  • @@ -5589,13 +5586,13 @@ partial - - partial + + yes @@ -6221,7 +6218,7 @@ @@ -6637,7 +6634,7 @@ @@ -6915,7 +6912,7 @@ 0.20.5 (current stable) - 0.91 beta (unstable) + 0.92 beta (unstable) @@ -7101,11 +7098,11 @@ no - - no + + yes -   +   diff --git a/src/documentation/content/xdocs/dev/release.xml b/src/documentation/content/xdocs/dev/release.xml index c916725eb..17059af46 100644 --- a/src/documentation/content/xdocs/dev/release.xml +++ b/src/documentation/content/xdocs/dev/release.xml @@ -1,6 +1,6 @@ - + @@ -135,11 +134,12 @@ When is the next released planned? -

    This depends on progress made so it is not possible to predict - any dates. However, we think that at the current rate of progress - we can start releasing again in the second half of 2005. If you +

    + When it's ready and the committers have enough time to go through + the time-consuming process of creating a release. We'll try to do + a new release every 3 or 4 months, but that's no promise. If you want to speed up the process, consider to - contribute to FOP

    + contribute to FOP.

    @@ -495,7 +495,7 @@ Check the following:

    don't work.

    - These properties are not implemented, except on table rows. In + These properties are not implemented on version 0.20.5 and earlier, except on table rows. In order to take advantage of them, you have to nest stuff to be kept together in a table.

    @@ -523,6 +523,9 @@ Check the following:

    ]]> +

    + Consider upgrading to the latest version which supports keeps. +

    diff --git a/src/documentation/content/xdocs/index.xml b/src/documentation/content/xdocs/index.xml index e74bfb780..517537355 100644 --- a/src/documentation/content/xdocs/index.xml +++ b/src/documentation/content/xdocs/index.xml @@ -1,6 +1,6 @@ - + @@ -102,7 +102,9 @@ + + @@ -111,7 +113,7 @@