Browse Source

Merged changes from Trunk (minus JARs).

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_Color@965380 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-1_1rc1old
Jeremias Maerki 13 years ago
parent
commit
25072c1b24
67 changed files with 4780 additions and 3260 deletions
  1. 1
    1
      NOTICE
  2. 52
    1
      README
  3. 30
    17
      build.xml
  4. 3
    2
      fop.bat
  5. 26
    25
      src/documentation/content/.htaccess
  6. 4
    11
      src/documentation/content/doap.rdf
  7. 0
    121
      src/documentation/content/xdocs/0.94/extensions.xml
  8. 0
    322
      src/documentation/content/xdocs/0.94/fonts.xml
  9. 0
    401
      src/documentation/content/xdocs/0.94/graphics.xml
  10. 0
    146
      src/documentation/content/xdocs/0.94/intermediate.xml
  11. 167
    0
      src/documentation/content/xdocs/1.0/accessibility.xml
  12. 40
    0
      src/documentation/content/xdocs/1.0/anttask.xml
  13. 3
    3
      src/documentation/content/xdocs/1.0/compiling.xml
  14. 125
    17
      src/documentation/content/xdocs/1.0/configuration.xml
  15. 135
    122
      src/documentation/content/xdocs/1.0/embedding.xml
  16. 449
    0
      src/documentation/content/xdocs/1.0/events.xml
  17. 340
    0
      src/documentation/content/xdocs/1.0/extensions.xml
  18. 564
    0
      src/documentation/content/xdocs/1.0/fonts.xml
  19. 0
    0
      src/documentation/content/xdocs/1.0/fotree/disabled-testcases.xml
  20. 590
    0
      src/documentation/content/xdocs/1.0/graphics.xml
  21. 0
    0
      src/documentation/content/xdocs/1.0/hyphenation.xml
  22. 10
    13
      src/documentation/content/xdocs/1.0/index.xml
  23. 331
    0
      src/documentation/content/xdocs/1.0/intermediate.xml
  24. 3
    6
      src/documentation/content/xdocs/1.0/known-issues.xml
  25. 3
    3
      src/documentation/content/xdocs/1.0/knownissues_overview.xml
  26. 8
    110
      src/documentation/content/xdocs/1.0/layoutengine/disabled-testcases.xml
  27. 243
    0
      src/documentation/content/xdocs/1.0/metadata.xml
  28. 500
    37
      src/documentation/content/xdocs/1.0/output.xml
  29. 16
    7
      src/documentation/content/xdocs/1.0/pdfa.xml
  30. 2
    4
      src/documentation/content/xdocs/1.0/pdfencryption.xml
  31. 2
    2
      src/documentation/content/xdocs/1.0/pdfx.xml
  32. 127
    113
      src/documentation/content/xdocs/1.0/running.xml
  33. 1
    1
      src/documentation/content/xdocs/1.0/servlets.xml
  34. 13
    17
      src/documentation/content/xdocs/1.0/upgrading.xml
  35. 113
    826
      src/documentation/content/xdocs/compliance.ihtml
  36. 24
    12
      src/documentation/content/xdocs/dev/release.xml
  37. 8
    8
      src/documentation/content/xdocs/download.xml
  38. 1
    1
      src/documentation/content/xdocs/examples.xml
  39. 45
    56
      src/documentation/content/xdocs/faq.xml
  40. 1
    1
      src/documentation/content/xdocs/fo.xml
  41. 3
    3
      src/documentation/content/xdocs/index.xml
  42. 1
    1
      src/documentation/content/xdocs/maillist.xml
  43. 10
    2
      src/documentation/content/xdocs/news-data.xml
  44. 9
    9
      src/documentation/content/xdocs/quickstartguide.xml
  45. 0
    551
      src/documentation/content/xdocs/relnotes.xml
  46. 24
    15
      src/documentation/content/xdocs/resources.xml
  47. 16
    15
      src/documentation/content/xdocs/site.xml
  48. 10
    189
      src/documentation/content/xdocs/status.xml
  49. 1
    1
      src/documentation/content/xdocs/tabs.xml
  50. 1
    1
      src/documentation/content/xdocs/trunk/fonts.xml
  51. 4
    8
      src/documentation/content/xdocs/trunk/graphics.xml
  52. 2
    0
      src/documentation/skinconf.xml
  53. 0
    1
      src/java/org/apache/fop/afp/AFPPaintingState.java
  54. 61
    0
      src/java/org/apache/fop/afp/GrayScaleColorConverter.java
  55. 10
    2
      src/java/org/apache/fop/events/LoggingEventListener.java
  56. 111
    0
      src/java/org/apache/fop/image/loader/batik/GenericFOPBridgeContext.java
  57. 46
    0
      src/java/org/apache/fop/image/loader/batik/GenericFOPImageElementBridge.java
  58. 24
    2
      src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java
  59. 3
    3
      src/java/org/apache/fop/pdf/PDFName.java
  60. 250
    0
      src/java/org/apache/fop/util/ColorExt.java
  61. 9
    1
      status.xml
  62. 58
    0
      test/java/org/apache/fop/threading/AvalonAdapter.java
  63. 15
    13
      test/java/org/apache/fop/threading/FOPTestbed.java
  64. 4
    33
      test/java/org/apache/fop/threading/FOProcessorImpl.java
  65. 124
    0
      test/java/org/apache/fop/threading/IFProcessorImpl.java
  66. 2
    2
      test/java/org/apache/fop/threading/Processor.java
  67. 2
    2
      test/java/org/apache/fop/threading/sample.cfg.xml

+ 1
- 1
NOTICE View File

@@ -1,5 +1,5 @@
Apache FOP
Copyright 1999-2009 The Apache Software Foundation
Copyright 1999-2010 The Apache Software Foundation

This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

+ 52
- 1
README View File

@@ -47,7 +47,10 @@ License version 2.0:
Info: src/java/org/apache/fop/pdf/sRGB Color Space Profile.icm.LICENSE.txt
- K3 3 of 9 barcode font (TrueType)
File: examples/fo/advanced/K3.TTF
Info: example/fo/advanced/K3.README
Info: examples/fo/advanced/K3.README
- DejaVu LGC Serif font (TrueType)
File: test/resources/fonts/DejaVuLGCSerif.ttf
Info: test/resources/fonts/DejaVuLGCSerif.LICENSE

Where to get help?
@@ -90,6 +93,54 @@ http://xmlgraphics.apache.org/fop/stable/running.html
RELEASE NOTES
==============================================================================

Version 1.0
===========

This is a production grade release of Apache FOP.
It contains many bug fixes and new features. See below for details.

Compliance
----------

This release implements the XSL 1.0 and 1.1 recommendations to a high
degree of compliance. See the compliance page
http://xmlgraphics.apache.org/fop/compliance.html for a detailed
overview.

Known issues
------------

The known issues of this release are listed at
http://xmlgraphics.apache.org/fop/1.0/knownissues_overview.html.

Major Changes in Version 1.0
----------------------------

* Added support for addressing all glyphs available in a Type 1 font
* Added support for auto-configuring TrueType Collections. XML font
metrics files for *.ttc fonts are not required anymore.
* Added support for rendering pages using Java Printing System.
* Support character-by-character font-selection strategy on
fo:character element.
* Implemented word-by-ford font-selection strategy on text.
* AFP Output: Various enhancements
* FOP now creates ToUnicode CMaps for single-byte fonts that don't use
built-in encodings
* Introduced a new, additional intermediate format optimized for
performance. See the intermediate format documentation for details.
* Added an initial set of extensions for prepress support.
* Added limited support for different page widths within a page-sequence.
* Added support for TrueType fonts with symbol character maps (like
"Wingdings" and "Symbol").
* Added an event handling framework which allows to get better feedback
from within FOP with the ability to customize problem management.

The long list of changes in this release is available at
http://xmlgraphics.apache.org/fop/1.0/changes_1.0.html.

The long list of changes in this and earlier releases is available at
http://xmlgraphics.apache.org/fop/changes.html.

Version 0.95
============


+ 30
- 17
build.xml View File

@@ -57,7 +57,6 @@ list of possible build targets.
<property file="${basedir}/build-local.properties"/>
<property file="${basedir}/build.properties"/>
<property environment="env"/>
<property name="build.lib.dir" value="${basedir}/lib/build"/>
<fileset dir="${basedir}" id="dist.bin">
<include name="conf/**"/>
<include name="examples/**"/>
@@ -85,12 +84,22 @@ list of possible build targets.
<include name="lib/xml-apis*"/>
</patternset>
</fileset>
<patternset id="dist.src.lib.tools">
<include name="lib/build/asm*"/>
<include name="lib/build/backport-util-concurrent*"/>
<include name="lib/build/jaxen*"/>
<include name="lib/build/pmd*"/>
<include name="lib/build/qdox*"/>
<include name="lib/build/retroweaver*"/>
<include name="lib/build/xmlunit*"/>
</patternset>
<fileset dir="${basedir}" id="dist.src">
<include name="src/**"/>
<include name="conf/**"/>
<include name="hyph/hyphenation.dtd"/>
<include name="hyph/readme"/>
<patternset refid="dist.lib"/>
<patternset refid="dist.src.lib.tools"/>
<include name="lib/servlet*"/>
<include name="test/**"/>
<include name="examples/**"/>
@@ -103,6 +112,8 @@ list of possible build targets.
<include name="build.*"/>
<include name="forrest.properties"/>
<include name="fop.bat"/>
<include name="fop.cmd"/>
<include name="fop.js"/>
<include name="fop"/>
</fileset>
<path id="libs-build-classpath">
@@ -110,10 +121,10 @@ list of possible build targets.
<include name="*.jar"/>
</fileset>
</path>
<property name="lib-build-tools" value="${basedir}/lib/build"/>
<path id="libs-build-tools-classpath">
<property name="lib-tools" value="${basedir}/lib/build"/>
<path id="libs-tools-build-classpath">
<path refid="libs-build-classpath"/>
<fileset dir="${lib-build-tools}">
<fileset dir="${lib-tools}">
<include name="*.jar"/>
</fileset>
</path>
@@ -134,7 +145,7 @@ list of possible build targets.
<property name="name" value="fop"/>
<property name="NAME" value="FOP"/>
<property name="version" value="svn-trunk"/>
<property name="year" value="1999-2009"/>
<property name="year" value="1999-2010"/>
<property name="javac.debug" value="on"/>
<property name="javac.optimize" value="off"/>
<property name="javac.deprecation" value="on"/>
@@ -226,7 +237,7 @@ list of possible build targets.
<echo message="${jce.message}"/>
<available property="jdk14.present" classname="java.lang.CharSequence"/>
<fail message="${Name} requires at least Java 1.4!" unless="jdk14.present"/>
<available property="junit.present" classname="junit.framework.TestCase" classpathref="libs-build-tools-classpath"/>
<available property="junit.present" classname="junit.framework.TestCase" classpathref="libs-tools-build-classpath"/>
<condition property="junit.message" value="JUnit Support PRESENT">
<equals arg1="${junit.present}" arg2="true"/>
</condition>
@@ -238,7 +249,7 @@ list of possible build targets.
<echo message="${junit.message}"/>
<condition property="xmlunit.present">
<and>
<available classname="org.custommonkey.xmlunit.XMLTestCase" classpathref="libs-build-tools-classpath"/>
<available classname="org.custommonkey.xmlunit.XMLTestCase" classpathref="libs-tools-build-classpath"/>
<isset property="junit.present"/>
</and>
</condition>
@@ -344,7 +355,7 @@ list of possible build targets.
<src path="${src.codegen.dir}/java"/>
<patternset includes="**/*.java"/>
<classpath>
<path refid="libs-build-tools-classpath"/>
<path refid="libs-tools-build-classpath"/>
<pathelement location="${build.classes.dir}"/>
</classpath>
</javac>
@@ -355,7 +366,7 @@ list of possible build targets.
</copy>
<taskdef name="eventResourceGenerator" classname="org.apache.fop.tools.EventProducerCollectorTask">
<classpath>
<path refid="libs-build-tools-classpath"/>
<path refid="libs-tools-build-classpath"/>
<pathelement location="${build.classes.dir}"/>
<pathelement location="${build.codegen-classes.dir}"/>
</classpath>
@@ -472,7 +483,7 @@ list of possible build targets.
<target name="retro-avail" depends="compile" if="java14.rt.lib">
<taskdef name="retroweaver" classname="net.sourceforge.retroweaver.ant.RetroWeaverTask">
<classpath>
<path refid="libs-build-tools-classpath"/>
<path refid="libs-tools-build-classpath"/>
</classpath>
</taskdef>
<path id="verify-classpath">
@@ -718,7 +729,7 @@ list of possible build targets.
<src path="${test.dir}/java"/>
<patternset refid="test-sources"/>
<classpath>
<path refid="libs-build-tools-classpath"/>
<path refid="libs-tools-build-classpath"/>
<fileset dir="${build.dir}">
<include name="fop.jar"/>
</fileset>
@@ -917,7 +928,7 @@ list of possible build targets.
<formatter type="xml" usefile="true"/>
<classpath>
<pathelement location="${build.dir}/test-classes"/>
<path refid="libs-build-tools-classpath"/>
<path refid="libs-tools-build-classpath"/>
<pathelement location="${build.dir}/fop.jar"/>
</classpath>
<test name="@{testsuite}" todir="${junit.reports.dir}" outfile="@{outfile}"/>
@@ -1116,7 +1127,7 @@ NOTE:
<and>
<available classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
<classpath>
<path refid="libs-build-tools-classpath"/>
<path refid="libs-tools-build-classpath"/>
</classpath>
</available>
<available file="${checkstyle.noframes.xslt}"/>
@@ -1124,11 +1135,11 @@ NOTE:
</condition>
<target name="checkstyle-avail" unless="checkstyle.avail">
<echo message="Checkstyle support NOT present. Please download it from http://checkstyle.sf.net/ and"/>
<echo message="..copy or link checkstyle-all-5.0.jar to ${lib-build-tools}"/>
<echo message="..copy or link checkstyle-all-5.0.jar to ${lib-tools}"/>
<echo message="..copy or link checkstyle-noframes.xsl to ${checkstyle.noframes.xslt}"/>
</target>
<target name="checkstyle" depends="init, checkstyle-avail" if="checkstyle.avail" description="Runs Checkstyle for a code quality report">
<taskdef name="checkstyle" classname="com.puppycrawl.tools.checkstyle.CheckStyleTask" classpathref="libs-build-tools-classpath"/>
<taskdef name="checkstyle" classname="com.puppycrawl.tools.checkstyle.CheckStyleTask" classpathref="libs-tools-build-classpath"/>
<checkstyle config="checkstyle-5.0.xml" failonviolation="false">
<fileset dir="${src.java.dir}" includes="**/*.java"/>
<formatter type="xml" toFile="${build.dir}/report_checkstyle.xml"/>
@@ -1142,7 +1153,7 @@ NOTE:
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask">
<classpath>
<path refid="libs-build-classpath"/>
<path refid="libs-build-tools-classpath"/>
<path refid="libs-tools-build-classpath"/>
</classpath>
</taskdef>
<pmd shortFilenames="true" targetjdk="${javac.target}">
@@ -1160,7 +1171,7 @@ NOTE:
<taskdef name="cpd" classname="net.sourceforge.pmd.cpd.CPDTask">
<classpath>
<path refid="libs-build-classpath"/>
<path refid="libs-build-tools-classpath"/>
<path refid="libs-tools-build-classpath"/>
</classpath>
</taskdef>
<cpd minimumTokenCount="100" outputFile="${build.dir}/report_cpd.txt">
@@ -1298,6 +1309,7 @@ NOTE:
<fileset dir="${build.dir}/maven"/>
<metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
</jar>
<move file="${build.dir}/${name}-${version}-bundle.jar" todir="${basedir}"/>
</target>
<!-- =================================================================== -->
<!-- Generate examples -->
@@ -1368,6 +1380,7 @@ NOTE:
<delete>
<fileset dir="${basedir}" includes="${name}-*.tar.gz"/>
<fileset dir="${basedir}" includes="${name}-*.zip"/>
<fileset dir="${basedir}" includes="${name}-bundle.jar"/>
</delete>
</target>
<target name="validate-xdocs" description="Validate the xdocs. Point schemas.dir to Forrest's 'schemas' directory.">

+ 3
- 2
fop.bat View File

@@ -13,6 +13,7 @@ REM distributed under the License is distributed on an "AS IS" BASIS,
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
REM See the License for the specific language governing permissions and
REM limitations under the License.
REM $Id$
rem %~dp0 is the expanded pathname of the current script under NT
set LOCAL_FOP_HOME=
@@ -61,7 +62,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.7.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xmlgraphics-commons-1.4svn.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xmlgraphics-commons-1.4.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\avalon-framework-4.2.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-io-1.3.1.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-logging-1.0.4.jar
@@ -80,5 +81,5 @@ goto runFop
if "%JAVACMD%" == "" set JAVACMD=java
:runFop
rem ECHO "%JAVACMD%"
rem ECHO "%JAVACMD%" %JAVAOPTS% %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" %FOP_OPTS% org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%
"%JAVACMD%" %JAVAOPTS% %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" %FOP_OPTS% org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%

+ 26
- 25
src/documentation/content/.htaccess View File

@@ -1,38 +1,39 @@
# redirect moved files
RedirectMatch Permanent ^/fop/anttask(.*) http://xmlgraphics.apache.org/fop/0.95/anttask$1
RedirectMatch Permanent ^/fop/compiling(.*) http://xmlgraphics.apache.org/fop/0.95/compiling$1
RedirectMatch Permanent ^/fop/configuration(.*) http://xmlgraphics.apache.org/fop/0.95/configuration$1
RedirectMatch Permanent ^/fop/embedding(.*) http://xmlgraphics.apache.org/fop/0.95/embedding$1
RedirectMatch Permanent ^/fop/extensions(.*) http://xmlgraphics.apache.org/fop/0.95/extensions$1
RedirectMatch Permanent ^/fop/fonts(.*) http://xmlgraphics.apache.org/fop/0.95/fonts$1
RedirectMatch Permanent ^/fop/graphics(.*) http://xmlgraphics.apache.org/fop/0.95/graphics$1
RedirectMatch Permanent ^/fop/hyphenation(.*) http://xmlgraphics.apache.org/fop/0.95/hyphenation$1
RedirectMatch Permanent ^/fop/intermediate(.*) http://xmlgraphics.apache.org/fop/0.95/intermediate$1
RedirectMatch Permanent ^/fop/output(.*) http://xmlgraphics.apache.org/fop/0.95/output$1
RedirectMatch Permanent ^/fop/pdfa(.*) http://xmlgraphics.apache.org/fop/0.95/pdfa$1
RedirectMatch Permanent ^/fop/pdfencryption(.*) http://xmlgraphics.apache.org/fop/0.95/pdfencryption$1
RedirectMatch Permanent ^/fop/pdfx(.*) http://xmlgraphics.apache.org/fop/0.95/pdfx$1
RedirectMatch Permanent ^/fop/running(.*) http://xmlgraphics.apache.org/fop/0.95/running$1
RedirectMatch Permanent ^/fop/servlets(.*) http://xmlgraphics.apache.org/fop/0.95/servlets$1
RedirectMatch Permanent ^/fop/upgrading(.*) http://xmlgraphics.apache.org/fop/0.95/upgrading$1
RedirectMatch Permanent ^/fop/anttask(.*) http://xmlgraphics.apache.org/fop/1.0/anttask$1
RedirectMatch Permanent ^/fop/compiling(.*) http://xmlgraphics.apache.org/fop/1.0/compiling$1
RedirectMatch Permanent ^/fop/configuration(.*) http://xmlgraphics.apache.org/fop/1.0/configuration$1
RedirectMatch Permanent ^/fop/embedding(.*) http://xmlgraphics.apache.org/fop/1.0/embedding$1
RedirectMatch Permanent ^/fop/extensions(.*) http://xmlgraphics.apache.org/fop/1.0/extensions$1
RedirectMatch Permanent ^/fop/fonts(.*) http://xmlgraphics.apache.org/fop/1.0/fonts$1
RedirectMatch Permanent ^/fop/graphics(.*) http://xmlgraphics.apache.org/fop/1.0/graphics$1
RedirectMatch Permanent ^/fop/hyphenation(.*) http://xmlgraphics.apache.org/fop/1.0/hyphenation$1
RedirectMatch Permanent ^/fop/intermediate(.*) http://xmlgraphics.apache.org/fop/1.0/intermediate$1
RedirectMatch Permanent ^/fop/output(.*) http://xmlgraphics.apache.org/fop/1.0/output$1
RedirectMatch Permanent ^/fop/pdfa(.*) http://xmlgraphics.apache.org/fop/1.0/pdfa$1
RedirectMatch Permanent ^/fop/pdfencryption(.*) http://xmlgraphics.apache.org/fop/1.0/pdfencryption$1
RedirectMatch Permanent ^/fop/pdfx(.*) http://xmlgraphics.apache.org/fop/1.0/pdfx$1
RedirectMatch Permanent ^/fop/running(.*) http://xmlgraphics.apache.org/fop/1.0/running$1
RedirectMatch Permanent ^/fop/servlets(.*) http://xmlgraphics.apache.org/fop/1.0/servlets$1
RedirectMatch Permanent ^/fop/upgrading(.*) http://xmlgraphics.apache.org/fop/1.0/upgrading$1

# redirect to versioned documentation
# Current stable release
Redirect Temp /fop/stable http://xmlgraphics.apache.org/fop/0.95
Redirect Temp /fop/stable http://xmlgraphics.apache.org/fop/1.0

# Current unstable release (or trunk if no beta is the latest release)
Redirect Temp /fop/unstable http://xmlgraphics.apache.org/fop/trunk

# Latest release
Redirect Temp /fop/current http://xmlgraphics.apache.org/fop/0.95
Redirect Temp /fop/latest http://xmlgraphics.apache.org/fop/0.95
Redirect Temp /fop/current http://xmlgraphics.apache.org/fop/1.0
Redirect Temp /fop/latest http://xmlgraphics.apache.org/fop/1.0

# Previous stable release
Redirect Temp /fop/previous http://xmlgraphics.apache.org/fop/0.94
Redirect Temp /fop/previous http://xmlgraphics.apache.org/fop/0.95

# Old releases
Redirect Temp /fop/maintenance http://xmlgraphics.apache.org/fop/0.94
Redirect Temp /fop/0.90alpha1 http://xmlgraphics.apache.org/fop/0.94
Redirect Temp /fop/0.91beta http://xmlgraphics.apache.org/fop/0.94
Redirect Temp /fop/0.92beta http://xmlgraphics.apache.org/fop/0.94
Redirect Temp /fop/0.93 http://xmlgraphics.apache.org/fop/0.94
Redirect Temp /fop/maintenance http://xmlgraphics.apache.org/fop/0.95
Redirect Temp /fop/0.90alpha1 http://xmlgraphics.apache.org/fop/0.95
Redirect Temp /fop/0.91beta http://xmlgraphics.apache.org/fop/0.95
Redirect Temp /fop/0.92beta http://xmlgraphics.apache.org/fop/0.95
Redirect Temp /fop/0.93 http://xmlgraphics.apache.org/fop/0.95
Redirect Temp /fop/0.94 http://xmlgraphics.apache.org/fop/0.95

+ 4
- 11
src/documentation/content/doap.rdf View File

@@ -77,22 +77,15 @@
<release>
<Version>
<name>Previous stable release</name>
<created>2007-08-23</created>
<revision>0.94</revision>
</Version>
</release>
<release>
<Version>
<name>Previous development release</name>
<created>2008-03-26</created>
<revision>0.95beta</revision>
<created>2008-08-05</created>
<revision>0.95</revision>
</Version>
</release>
<release>
<Version>
<name>Latest stable release</name>
<created>2008-08-05</created>
<revision>0.95</revision>
<created>2010-07-31</created>
<revision>1.0</revision>
</Version>
</release>
<repository>

+ 0
- 121
src/documentation/content/xdocs/0.94/extensions.xml View File

@@ -1,121 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Standard FOP Extensions</title>
<version>$Revision$</version>
</header>
<body>
<p>
By "extension", we mean any data that can be placed in the input XML document that
is not addressed by the XSL-FO standard.
By having a mechanism for supporting extensions, FOP is able to add features that
are not covered in the specification.
</p>
<p>
The extensions documented here are included with FOP, and are automatically available
to you. If you wish to add an extension of your own to FOP, please see the
<a href="../dev/extensions.html">Developers' Extension Page</a>.
</p>
<note>All extensions require the correct use of an appropriate namespace in your input document.</note>
<section id="svg">
<title>SVG</title>
<p>
Please see the <a href="graphics.html#svg">SVG documentation</a> for more details.
</p>
</section>
<section id="fo-extensions">
<title>FO Extensions</title>
<section id="fox-namespace">
<title>Namespace</title>
<p>
By convention, FO extensions in FOP use the "fox" namespace prefix.
To use any of the FO extensions, add a namespace entry for
<code>http://xmlgraphics.apache.org/fop/extensions</code> to the root element:
</p>
<source><![CDATA[<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">]]></source>
</section>
<section id="bookmarks">
<title>PDF Bookmarks</title>
<p>
In previous versions of Apache FOP there was a <code>fox:outline</code> element
which was used to create outlines in PDF files. The redesigned code makes use
of the new <a href="http://www.w3.org/TR/xsl11/#fo_bookmark-tree">bookmark feature defined in the latest XSL 1.1 working draft</a>.
</p>
</section>
<section id="named-destinations">
<title>Anchors or Named Destinations</title>
<p>This extension element hasn't been reimplemented for the redesigned code, yet.</p>
<!--p>Use the fox:destination element to define "named destinations" inside a PDF document.
These are useful as fragment identifiers, e.g. "http://server/document.pdf#anchor-name".
fox:destination elements can be placed almost anywhere in the fo document, including a child of
root, a block-level element, or an inline-level element.
For the destination to actually work, it must correspond to an "id" attribute on some fo element
within the document. In other words, the "id" attribute actually creates the "view" within the
PDF document. The fox:destination simply gives that view an independent name.
</p>
<source><![CDATA[<fox:destination internal-destination="table-of-contents"/>
...
<fo:block id="table-of-contents">Table of Contents</fo:block>]]></source>
<warning>It is possible that in some future release of FOP, <em>all </em>elements with
"id" attributes will generate named-destinations, which will eliminate the need for
fox:destination.</warning-->
</section>
<section id="table-continue-label">
<title>Table Continuation Label</title>
<p>This extension element hasn't been reimplemented for the redesigned code, yet.</p>
<!--p>Use the fox:continued-label element to create content in table-header and
table-footer cells that will appear only on pages after the first page that the table
appears. fox:continued-label is itself inline content, and is a container of fo:inline
content. This content will be laid out only if the table does not fit on a single page and flows
to following pages. Here is an example of FO code creating such a table-header:</p>
<source><![CDATA[<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block>Header column 1 with continued label
<fox:continued-label><fo:inline> (cont.)</fo:inline></fox:continued-label>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Header column 2 with no continued label</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>]]></source-->
</section>
<section id="widow-orphan-content-limit">
<title>fox:orphan-content-limit and fox:widow-content-limit</title>
<p>
The two proprietary extension properties, fox:orphan-content-limit and
fox:widow-content-limit, are used to improve the layout of list-blocks and tables.
If you have a table with many entries, you don't want a single row to be left over
on a page. You will want to make sure that at least two or three lines are kept
together. The properties take an absolute length which specifies the area at the
beginning (fox:widow-content-limit) or at the end (fox:orphan-content-limit) of a
table or list-block. The properties are inherited and only have an effect on fo:table
and fo:list-block. An example: fox:widow-content-limit="3 * 1.2em" would make sure
the you'll have at least three lines (assuming line-height="1.2") together on a table
or list-block.
</p>
</section>
</section>
</body>
</document>


+ 0
- 322
src/documentation/content/xdocs/0.94/fonts.xml View File

@@ -1,322 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Apache FOP: Fonts</title>
<version>$Revision$</version>
<authors>
<person name="Jeremias Märki" email=""/>
<person name="Tore Engvig" email=""/>
<person name="Adrian Cumiskey" email=""/>
</authors>
</header>
<body>
<section id="intro">
<title>Summary</title>
<note>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.
</note>
<p>The following table summarizes the font capabilities of the various FOP renderers:</p>
<table>
<tr>
<th>Renderer</th>
<th>Base-14</th>
<th>AWT/OS</th>
<th>Custom</th>
<th>Custom Embedding</th>
</tr>
<tr>
<td>PDF</td>
<td>yes</td>
<td>no</td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td>PostScript</td>
<td>yes</td>
<td>no</td>
<td>yes</td>
<td>yes</td>
</tr>
<!--tr> NOT AVAILABLE YET!!!
<td>PCL</td>
<td>yes (modified)</td>
<td>no</td>
<td>no</td>
<td>no</td>
</tr-->
<tr>
<td>TXT</td>
<td>yes (used for layout but not for output)</td>
<td>no</td>
<td>yes (used for layout but not for output)</td>
<td>no</td>
</tr>
<tr>
<td>AWT</td>
<td>if available from OS</td>
<td>yes</td>
<td>yes</td>
<td>n/a (display only)</td>
</tr>
<tr>
<td>Print</td>
<td>if available from OS</td>
<td>yes</td>
<td>yes</td>
<td>controlled by OS printer driver</td>
</tr>
<tr>
<td>RTF</td>
<td>n/a (font metrics not needed)</td>
<td>n/a</td>
<td>n/a</td>
<td>n/a</td>
</tr>
<tr>
<td>MIF</td>
<td>n/a (font metrics not needed)</td>
<td>n/a</td>
<td>n/a</td>
<td>n/a</td>
</tr>
<tr>
<td>SVG</td>
<td>if available from OS</td>
<td>yes</td>
<td>no</td>
<td>no</td>
</tr>
<tr>
<td>XML</td>
<td>yes</td>
<td>no</td>
<td>yes</td>
<td>n/a</td>
</tr>
</table>
</section>
<section>
<title>Base-14 Fonts</title>
<p>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.</p>
</section>
<section id="awt">
<title>AWT/Operating System Fonts</title>
<p>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.</p>
</section>
<section id="custom">
<title>Custom Fonts</title>
<p>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:</p>
<ul>
<li><a href="http://partners.adobe.com/asn/developer/type/ftypes.html">Adobe font types</a></li>
<li><a href="http://partners.adobe.com/asn/developer/technotes/fonts.html">Adobe Font Technote</a></li>
</ul>
<section id="type1-metrics">
<title>Type 1 Font Metrics</title>
<p>FOP includes PFMReader, which reads the PFM file that normally comes with a Type 1 font, and generates an appropriate font metrics file for it.
To use it, run the class org.apache.fop.fonts.apps.PFMReader:</p>
<p>Windows (on JDK 1.4 and later):</p>
<source>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</source>
<p>Windows (on JDK 1.3.x):</p>
<source>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</source>
<p>Unix (on JDK 1.4 and later):</p>
<source>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</source>
<p>Unix (on JDK 1.3.1):</p>
<source>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</source>
<p>PFMReader [options]:</p>
<ul>
<li><strong>-fn &lt;fontname&gt;</strong> 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.</li>
</ul>
<note>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.</note>
<note>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.</note>
</section>
<section id="truetype-metrics">
<title>TrueType Font Metrics</title>
<p>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:</p>
<source>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</source>
<p>TTFReader [options]:</p>
<ul>
<li><strong>-d &lt;DEBUG | INFO &gt;</strong> Sets the debug level (default is
INFO).</li>
<li><strong>-fn &lt;fontname&gt;</strong> Same as for PFMReader.</li>
<li><strong>-ttcname &lt;fontname&gt;</strong> 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.</li>
<li><strong>-enc ansi</strong> 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:</li>
</ul>
<table id="ttf-encoding">
<tr>
<th>Issue</th>
<th>WinAnsi</th>
<th>CID-keyed</th>
</tr>
<tr>
<td>Usable Character Set</td>
<td>Limited to WinAnsi character set, which is roughly equivalent to iso-8889-1.</td>
<td>Limited only by the characters in the font itself.</td>
</tr>
<tr>
<td>Embedding the Font</td>
<td>Optional.</td>
<td>Mandatory. Not embedding the font produces invalid PDF documents.</td>
</tr>
</table>
<warning>
You may experience failures with certain TrueType fonts, especially if they don't contain
the so-called Unicode "cmap" table. TTFReader can currently not deal with font like this.
</warning>
</section>
<section id="truetype-collections-metrics">
<title>TrueType Collections Font Metrics</title>
<p>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.</p>
<p>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.</p>
<p>Here is an example of generating a metrics file for a .ttc file:</p>
<source>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</source>
</section>
<section id="register">
<title>Register Fonts with FOP</title>
<p>You must tell FOP how to find and use the font metrics files by registering them in the <a href="configuration.html">FOP Configuration</a>. Add entries for your custom fonts, regardless of font type, to the configuration file in a manner similar to the following:</p>
<source><![CDATA[
<fonts>
<!-- register a particular font -->
<font metrics-url="file:///C:/myfonts/FTL_____.xml" kerning="yes"
embed-url="file:///C:/myfonts/FTL_____.pfb">
<font-triplet name="FrutigerLight" style="normal" weight="normal"/>
</font>
<!-- register all the fonts found in a directory -->
<directory>C:\MyFonts1</directory>
<!-- register all the fonts found in a directory
and all of its sub directories (use with care) -->
<directory recursive="true">C:\MyFonts2</directory>

<!-- automatically detect operating system installed fonts -->
<auto-detect/>
</fonts>]]></source>
<note>
Review the documentation for <a href="configuration.html">FOP Configuration</a> for
instructions on making the FOP configuration available to FOP when it runs. Otherwise,
FOP has no way of finding your custom font information.
</note>
<ul>
<li>
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 <a href="configuration.html">FOP: Configuration</a> for more information.
</li>
<li>
If relative URLs are specified, they are evaluated relative to the value of the
"font-base" setting. If there is no "font-base" setting, the fonts are evaluated
relative to the base directory.
</li>
<li>Either an "embed-url" or a "metrics-url" must be specified for font tag configurations.</li>
<li>The font "kerning" attribute is optional.</li>
<li>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.</li>
<li>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.</li>
<li>The fonts "directory" tag can be used to register fonts contained within a single or list of directory paths. The "recursive" attribute can be specified to recursively add fonts from all sub directories.</li>
<li>Fonts registered with "font" tag configurations override fonts found by means of "directory" tag definitions.</li>
<li>Fonts found as a result of a "directory" tag configuration override fonts found as a result of the "auto-detect" tag being specified.</li>
<li>The fonts "auto-detect" tag can be used to automatically register fonts that are found to be installed on the native operating system.
<ul>
<li>On Unix platforms the autodetect feature looks in java user.home + "/.fonts", "/usr/local/fonts", "/usr/share/fonts" and "/usr/X11R6/lib/X11/fonts" for fonts it is able to use.</li>
<li>On Mac platforms the autodetect feature looks in java user.home + "/Library/Fonts/, "/Library/Fonts/", "/System/Library/Fonts/" and "/Network/Library/Fonts/" for fonts it is able to use.</li>
<li>On Windows platforms the autodetect feature attempts to determine the Windows fonts directory (usually C:\WINDOWS\FONTS) and also the existence of a PSFONTS directory for fonts it is able to use.</li>
</ul>
</li>
</ul>
<!--note>Cocoon users will need to setup the config, see FOPSerializer for more information.</note-->
</section>
<section id="embedding">
<title>Embedding</title>
<note>The PostScript renderer does not yet support TrueType fonts, but can embed Type 1 fonts.</note>
<note>The font is simply embedded into the PDF file, it is not converted.</note>
<p>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.</p>
<warning>
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.
</warning>
<p>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.</p>
<p>When embedding PostScript fonts, the entire font is always embedded.</p>
<p>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.</p>
</section>
<section id="embedding-base14">
<title>Explicitly embedding the base 14 fonts</title>
<p>
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.
</p>
<p>Example:</p>
<source><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<font-metrics type="TYPE1">
<font-name>Symbol</font-name>
<embed/>
<encoding>SymbolEncoding</encoding>
<cap-height>673</cap-height>
<x-height>766</x-height>
[..]]]></source>
</section>
</section>
</body>
</document>

+ 0
- 401
src/documentation/content/xdocs/0.94/graphics.xml View File

@@ -1,401 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Apache FOP: Graphics Formats</title>
<version>$Revision$</version>
</header>
<body>
<section id="support-overview">
<title>Overview of Graphics Support</title>
<p>
The table below summarizes the <em>theoretical</em> support for graphical formats within FOP. In other words, within the constraints of the limitations listed here, these formats <em>should</em> 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.
</p>
<table>
<tr>
<th>Format</th>
<th>Type</th>
<th><a href="#native">FOP native support</a></th>
<th><a href="#batik">Batik SVG</a></th>
<th><a href="#batik-codecs">Batik codecs</a></th>
<th><a href="#imageio">Image I/O</a></th>
<th><a href="#jai">JAI</a></th>
<th><a href="#jimi">JIMI</a></th>
</tr>
<tr>
<td><a href="#bmp">BMP</a> (Microsoft Windows Bitmap)</td>
<td>bitmap</td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="#eps">EPS</a> (Encapsulated PostScript)</td>
<td>metafile (both bitmap and vector), probably most frequently used for vector drawings</td>
<td>(X)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>GIF (Graphics Interchange Format)</td>
<td>bitmap</td>
<td>X</td>
<td></td>
<td></td>
<td>X</td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td><a href="#jpeg">JPEG</a> (Joint Photographic Experts Group)</td>
<td>bitmap</td>
<td>(X)</td>
<td></td>
<td></td>
<td>X</td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="#png">PNG</a> (Portable Network Graphic)</td>
<td>bitmap</td>
<td></td>
<td></td>
<td>X</td>
<td>X</td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="#svg">SVG</a> (Scalable Vector Graphics)</td>
<td>vector (with embedded bitmaps)</td>
<td></td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="#tiff">TIFF</a> (Tag Image Format File)</td>
<td>bitmap</td>
<td>(X)</td>
<td></td>
<td>X</td>
<td>X</td>
<td>X</td>
<td></td>
<!--td><a href="#native">FOP native</a> or <a href="#jai">JAI</a>, depending on the subformat. See <a href="#tiff">TIFF</a> for more details.(JIMI also supports TIFF, but this has not been implemented within FOP).</td-->
</tr>
<tr>
<td><a href="#emf">EMF</a> (Windows Enhanced Metafile)</td>
<td>vector (with embedded bitmaps)</td>
<td>(X)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<note>"(X)" means restricted support. Please see the details below.</note>
</section>
<section id="packages">
<title>Graphics Packages</title>
<section id="native">
<title>FOP Native</title>
<p>
FOP has native ability to handle some graphic file formats.
</p>
</section>
<section id="batik-codecs">
<title>"Internal" codecs</title>
<p>
Apache XML Graphics Commons contains codecs for PNG and TIFF access. FOP can use these.
</p>
</section>
<section id="imageio">
<title>Image I/O (JDK 1.4 or higher)</title>
<p>
For JDKs 1.4 or higher, FOP provides a wrapper to load images through the
<a class="fork" href="http://java.sun.com/j2se/1.4.2/docs/guide/imageio/index.html">JDK's Image I/O API</a> (JSR 015).
Image I/O allows to dynamically add additional image codecs. An example of such an add-on library are the
<a class="fork" href="http://java.sun.com/products/java-media/jai/">JAI Image I/O Tools</a> available from Sun.
</p>
</section>
<section id="jimi">
<title>JIMI</title>
<p>
Because of licensing issues, the JIMI image library is not included in the FOP distribution. First, <a class="fork" href="http://java.sun.com/products/jimi">download</a> 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.
</p>
</section>
<section id="jai">
<title>JAI (Java Advanced Imaging API)</title>
<p>
FOP has been compiled with JAI support, but JAI is not included in the FOP distribution.
To use it, install <a href="http://java.sun.com/products/java-media/jai">JAI</a>, 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 <a href="http://java.sun.com/products/java-media/jai/forDevelopers/jaifaq.html#platforms">What platforms are supported?</a> on the JAI FAQ page for more details.
</p>
</section>
<section id="batik">
<title>Apache Batik</title>
<p>Current FOP distributions include a distribution of the Apache <a class="fork" href="ext:batik">Batik</a> 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.</p>
<warning>Batik must be run in a graphical environment.</warning>
<p>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.</p>
<p>Here are some workarounds:</p>
<ul>
<li>If you are using JDK 1.4, start it with the <code>-Djava.awt.headless=true</code> command line option.</li>
<li>Install an X server which provides an in-memory framebuffer without actually using a screen device or any display hardware. One example is Xvfb.</li>
<li>Install a toolkit which emulates AWT without the need for an underlying X server. One example is the <a href="http://www.eteks.com/pja/en">PJA toolkit</a>, which is free and comes with detailed installation instructions.</li>
</ul>
</section>
</section>
<section id="bmp">
<title>BMP</title>
<p>FOP native support for BMP images is limited to the RGB color-space.</p>
</section>
<section id="eps">
<title>EPS</title>
<p>FOP provides support for two output targets:</p>
<ul>
<li>PostScript (full support).</li>
<li>
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.
</li>
</ul>
<warning>
Please note that the EPS embedding feature has been <strong>deprecated</strong> in the
PDF specification version 1.4. You should not use this feature anymore, especially
since newer PDF tools don't support embedded EPS files anymore.
</warning>
<p>
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.
</p>
</section>
<section id="jpeg">
<title>JPEG</title>
<p>
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.
</p>
</section>
<section id="png">
<title>PNG</title>
<p>
If using JAI for PNG support, only RGB and RGBA color-spaces are supported for
FOP rendering.
</p>
<p>
Transparency is supported but not guaranteed to work with every output format.
</p>
</section>
<section id="svg">
<title>SVG</title>
<section id="svg-intro">
<title>Introduction</title>
<p>FOP uses <a href="#batik"> Apache Batik</a> for SVG support.
This format can be handled as an <code>fo:instream-foreign-object</code> or in a separate
file referenced with <code>fo:external-graphic</code>.</p>
<note>
Batik's SVG Rasterizer utility may also be used to convert standalone SVG
documents into PDF. For more information please see the
<a href="http://xmlgraphics.apache.org/batik/svgrasterizer.html">SVG Rasterizer documentation</a>
on the Batik site.
</note>
</section>
<section id="svg-pdf-graphics">
<title>Placing SVG Graphics into PDF</title>
<p>
The SVG is rendered into PDF by using PDF commands to draw and fill
lines and curves. This means that the graphical objects created with
this remain as vector graphics. The same applies to PostScript output.
For other output formats the SVG graphic will be converted to a bitmap
image.
</p>
<p>
There are a number of SVG things that cannot be converted directly into
PDF. Parts of the graphic such as effects, patterns and images are inserted
into the PDF as a raster graphic. The resolution of these raster images can
be controlled through the "target resolution" setting in the
<a href="configuration.html">configuration</a>.</p>
<p>
Currently transparency is limited in PDF so many svg images that
contain effects or graphics with transparent areas may not be displayed
correctly.
</p>
</section>
<section id="svg-pdf-text">
<title>Placing SVG Text into PDF and PostScript</title>
<p>If possible, Batik will use normal PDF or PostScript text when inserting text. It does
this by checking if the text can be drawn normally and the font is
supported. This example svg <a href="../dev/svg/text.svg">text.svg</a> /
<!--link href="../dev/svg/text.pdf"-->text.pdf<!--/link-->
shows how various types and effects with text are handled.
Note that tspan and outlined text are not yet implemented.</p>
<p>
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 output files large and when it is viewed the
viewer may not normally draw those fine curves very well (In Adobe Acrobat, turning on
"Smooth Line Art" in the preferences will fix this).
If the text is inserted into the output file using the inbuilt text commands
it will use a single character.
</p>
<p>
Note that because SVG text can be rendered as either text or a vector graphic, you
may need to consider settings in your viewer for both. The Acrobat viewer has both
"smooth line art" and "smooth text" settings that may need to be set for SVG images
to be displayed nicely on your screen (see Edit / Preferences / Display).
This setting will not affect the printing of your document, which should be OK in
any case, but will only affect the quality of the screen display.</p>
</section>
<section id="svg-scaling">
<title>Scaling</title>
<p>
Currently, SVG images are rendered with the dimensions specified <em>in the SVG
file</em>, within the viewport specified in the fo:external-graphic element.
For everything to work properly, the two should be equal. The SVG standard leaves
this issue as an implementation detail. FOP will probably implement a scaling
mechanism in the future.
</p>
<p>
If you use pixels to specify the size of an SVG graphic the "source resolution" setting
in the <a href="configuration.html">configuration</a> will be used to determine the
size of a pixel. The use of pixels to specify sizes is discouraged as they may
be interpreted differently in different environments.
</p>
</section>
<section id="svg-problems">
<title>Known Problems</title>
<ul>
<li>
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.
</li>
<li>
There is some problem with a gradient inside a pattern causing a PDF
error when viewed in acrobat 5.
</li>
<li>
Text is not always handled correctly, it may select the wrong font
especially if characters have multiple fonts in the font list.
</li>
<li>
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.
</li>
<li>
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.
</li>
<li>
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.
</li>
</ul>
</section>
</section>
<section id="tiff">
<title>TIFF</title>
<p>
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):
</p>
<ul>
<li>single channel images (i.e., bi-level and grayscale only)</li>
<li>uncompressed images, or images using CCITT T.4, CCITT T.6, or JPEG compression</li>
<li>images using white-is-zero encoding in the TIFF PhotometricInterpretation tag</li>
</ul>
<note>
Native support in this case means that the images can be embedded into the output format
without decoding it.
</note>
<p><em>JAI:</em> Supports RGB and RGBA only for FOP rendering.</p>
</section>
<section id="emf">
<title>EMF</title>
<p>Windows Enhanced Metafiles (EMF) are only supported in RTF output.</p>
</section>
<section id="resolution">
<title>Graphics Resolution</title>
<p>
Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution
values. FOP tries to use this resolution information whenever possible to determine
the image's intrinsic size. This size is used during the layout process when it is not
superceeded by an explicit size on fo:external-graphic (content-width and content-height
properties).
</p>
<p>
Please note that not all images contain resolution information. If it's not available
72 dpi is assumed (the default resolution of PDF and PostScript).
</p>
<p>
Bitmap images are generally embedded into the output format at their original resolution
(as is). No resampling of the image is performed. Explicit resampling is on our wishlist,
but hasn't been implemented, yet. Bitmaps included in SVG graphics may be resampled to
the resolution specified in the "target resolution" setting in the
<a href="configuration.html">configuration</a> if SVG filters are applied. This can be
used as a work-around to resample images in FO documents.
</p>
</section>
<section id="caching">
<title>Image caching</title>
<p>
FOP caches images between runs. There is one cache per FopFactory instance. The URI is
used as a key to identify images which means that when a particular URI appears again,
the image is taken from the cache. If you have a servlet that generates a different
image each time it is called with the same URL you need to use a constantly
changing dummy parameter on the URL to avoid caching.
</p>
<p>
The image cache has been improved considerably in the redesigned code. Therefore, a
resetCache() method like in earlier versions of FOP has become unnecessary. If you
still experience OutOfMemoryErrors, please notify us.
</p>
</section>
</body>
</document>

+ 0
- 146
src/documentation/content/xdocs/0.94/intermediate.xml View File

@@ -1,146 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Intermediate Format</title>
<version>$Revision$</version>
</header>
<body>
<note>
Please note that the intermediate format is an <strong>advanced feature</strong> and can be ignored by most
users of Apache FOP.
</note>
<section id="introduction">
<title>Introduction</title>
<p>
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
<a href="http://www.w3.org/TR/2001/REC-xsl-20011015/slice1.html#section-N742-Formatting">XSL-FO specification in chapter 1.1.2</a>.
The IF can be generated through the area tree XML Renderer (the XMLRenderer).
</p>
<p>
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.
</p>
</section>
<section id="usage">
<title>Usage of the Intermediate Format</title>
<p>
As already mentioned, the IF is generated by using the <strong>XMLRenderer</strong> (MIME type:
<strong>application/X-fop-areatree</strong>). 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.
</p>
<p>
The second step is to reparse the IF file using the <strong>AreaTreeParser</strong> 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
<a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/"><code>examples/embedding</code></a>
directory in the FOP distribution
</p>
<p>
The basic pattern to parse the IF format looks like this:
</p>
<source><![CDATA[
FopFactory fopFactory = FopFactory.newInstance();
// Setup output
OutputStream out = new java.io.FileOutputStream(pdffile);
out = new java.io.BufferedOutputStream(out);
try {
//Setup fonts and user agent
FontInfo fontInfo = new FontInfo();
FOUserAgent userAgent = fopFactory.newFOUserAgent();

//Construct the AreaTreeModel that will received the individual pages
AreaTreeModel treeModel = new RenderPagesModel(userAgent,
MimeConstants.MIME_PDF, fontInfo, out);
//Parse the IF file into the area tree
AreaTreeParser parser = new AreaTreeParser();
Source src = new StreamSource(myIFFile);
parser.parse(src, treeModel, userAgent);
//Signal the end of the processing. The renderer can finalize the target document.
treeModel.endDocument();
} finally {
out.close();
}]]></source>
<p>
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
<code>endDocument()</code> on the AreaTreeModel. This lets the Renderer know that the processing
is now finished.
</p>
<p>
The intermediate format can also be used from the <a href="running.html#standalone-start">command-line</a>
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.
</p>
<section id="concat">
<title>Concatenating Documents</title>
<p>
This initial example is obviously not very useful. It would be faster to create the PDF file
directly. As the <a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/ExampleConcat.java">ExampleConcat.java</a>
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.
</p>
</section>
<section id="modifying">
<title>Modifying Documents</title>
<p>
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.
</p>
</section>
<section id="advanced">
<title>Advanced Use</title>
<p>
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 <code>setTransformerHandler()</code> 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 <code>getContentHandler()</code>).
</p>
</section>
</section>
</body>
</document>

+ 167
- 0
src/documentation/content/xdocs/1.0/accessibility.xml View File

@@ -0,0 +1,167 @@
<?xml version="1.0" standalone="no"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "document-v20.dtd">
<document>
<header>
<title>Accessibility</title>
</header>
<body>
<section id="overview">
<title>Overview</title>
<p>
This page describes the
<a href="http://en.wikipedia.org/wiki/Accessibility">accessibility</a>
features of Apache FOP.
<a href="http://www.section508.gov/">Section 508</a> defines accessibility in the context
of electronic documents for the USA but other countries have similar requirements.
</p>
<p>
Accessibility features are available only for the PDF output format and there are some
implementation limitations. Also, certain actions must be undertaken by the content creator
to ensure that FOP can create a truly accessible document.
</p>
</section>
<section>
<title>Enabling accessibility</title>
<p>There are 3 ways to enable accessibility:</p>
<ol>
<li>
<strong>Command line:</strong> The command line option -a turns on accessibility:
<code>fop -a -fo mydocument.fo -pdf mydocument.pdf</code>
</li>
<li>
<strong>Embedding:</strong> <code>userAgent.setAccessibility(true);</code>
</li>
<li>
<strong>Optional setting in fop.xconf file:</strong>
<pre>
&lt;fop version="1.0"&gt;
&lt;accessibility&gt;true&lt;/accessibility&gt;
...
&lt;/fop&gt;
</pre>
</li>
</ol>
<p>
When accessibility is enabled, additional information relating to the logical structure of
the document is added to the PDF. That information allows the PDF viewer (or a
text-to-speech application) to retrieve the natural reading order of the document.
</p>
<note>The processing of the logical structure is memory-hungry. You may need to adjust the
Java heap size in order to process larger files.</note>
</section>
<section id="source">
<title>Changes to your XSL-FO input files</title>
<p>
Apache FOP cannot automatically generate accessible PDFs. Some of the work can only be
performed by the content provider. Following are some changes that may be necessary to
your XSL-FO content in order to generate really accessible documents:
</p>
<ul>
<li>Table cells must have a table row as their parent.</li>
<li>
Images must have an alternate text: use the <code>fox:alt-text</code> extension attribute
(in the <a href="extensions.html#fox-namespace">fox namespace</a>) on
<code>fo:external-graphic</code> and <code>fo:instream-foreign-object</code> to specify a
short text describing the image.
</li>
<li>
Ensure that the order of <code>fo:block-container</code> elements in a page corresponds to
the reading order.
</li>
<li>
Specify the natural language of the document using the language and country properties
(or via the <code>xml:lang</code> shorthand property).
</li>
</ul>
</section>
<section id="customTags">
<title>Customized Tagging</title>
<p>The <a href="#PDFReference">PDF Reference</a> defines a set of standard Structure Types to
tag content. For example, ‘P’ is used for identifying paragraphs, ‘H1’ to ‘H6’ for headers,
‘L’ for lists, ‘Div’ for block-level groups of elements, etc. This standard set is aimed at
improving interoperability between applications producing or consuming PDF. </p>
<p>FOP provides a default mapping of Formatting Objects to elements from that standard set.
For example, <code>fo:page-sequence</code> is mapped to ‘Part’, <code>fo:block</code> is
mapped to ‘P’, <code>fo:list-block</code> to ‘L’, etc.</p>
<p>You may want to customize that mapping to improve the accuracy of the tagging or deal with
particular FO constructs. For example, you may want to make use of the ‘H1’ to ‘H6’ tags to
make the hierarchical structure of the document appear in the PDF. This is achieved by using
the <code>role</code> XSL-FO property:</p>
<source>...
&lt;fo:block role="H1" font-weight="bold"&gt;I. A Level 1 Heading&lt;/fo:block&gt;
&lt;fo:block&gt;This is the first paragraph of the first section...&lt;/fo:block&gt;
...</source>
<p>If a non-standard structure type is specified, FOP will issue a warning and fall back to
the default tag associated to the Formatting Object.</p>
</section>
<section id="testing">
<title>Testing</title>
<p>
Accessible PDFs can be tested, for example, using Adobe Acrobat Professional. Its
Accessibility Check feature creates a report indicating any deficiencies with a PDF
document. Alternatively, you can just let a screen reader read the document aloud.
</p>
</section>
<section id="limitations">
<title>Limitations</title>
<p>
Accessibility support in Apache FOP is relatively new, so there are certain
limitations. Please help us identify and close any gaps.
</p>
<ul>
<li>
The natural language can currently only be specified at the page-sequence level. The
document language is derived from the language of the first page-sequence. It is
currently not possible to override the language inside the content below the
page-sequence level.
</li>
<li>
It's currently not possible to specify the expanded form of an abbreviation or acronym.
</li>
<li>
SVG graphics (or images in general) are treated as a single figure. Text contained in
SVGs is not accessible. It's only possible to work with <code>fox:alt-text</code>.
</li>
<li>
The side regions (region-before, region-after etc.) are currently not specially
identified. Screen readers may read their content at page changes.
</li>
</ul>
</section>
<section id="links">
<title>Related Links</title>
<p>
Many resources providing guidance about creating accessible documents can be found on the
web. Here are a few links, along with additional resources around the topic:
</p>
<ul>
<li><a href="http://www.section508.gov/">US Government - Website on Section 508</a></li>
<li><a href="http://en.wikipedia.org/wiki/Accessibility">Wikipedia on Accessibility in general</a></li>
<li><a href="http://en.wikipedia.org/wiki/Portable_Document_Format#Accessibility">Wikipedia on Accessibility in PDF</a></li>
<li id="PDFReference">
<a href="http://partners.adobe.com/public/developer/en/pdf/PDFReference.pdf">PDF
Reference 1.4</a> (look up chapters 9.7 "Tagged PDF" and 9.8 "Accessibility Support")
</li>
<li><a href="pdfa.html">PDF/A support in Apache FOP</a></li>
<li><a href="http://wiki.apache.org/xmlgraphics-fop/PDF_Accessibility">Developer-oriented details on the accessibility features (on the Wiki)</a></li>
</ul>
</section>
</body>
</document>

src/documentation/content/xdocs/0.94/anttask.xml → src/documentation/content/xdocs/1.0/anttask.xml View File

@@ -68,6 +68,16 @@
<td>XSL-FO file to be rendered</td>
<td>Yes, if no fileset nested element is used</td>
</tr>
<tr>
<td>xmlfile</td>
<td>XML input file</td>
<td>Yes, if no fofile is specified</td>
</tr>
<tr>
<td>xsltfile</td>
<td>XSLT input file</td>
<td>Yes, if no fofile is specified</td>
</tr>
<tr>
<td>outfile</td>
<td>Output filename</td>
@@ -148,6 +158,11 @@
(<code>true</code>) or not (<code>false</code>). <strong>Currently doesn't work in FOP Trunk!!!</strong></td>
<td>No, default is <code>true</code></td>
</tr>
<tr>
<td>throwexceptions</td>
<td>Controls whether or not an exception is thrown if an error occurs during rendering.</td>
<td>Default is <code>true</code></td>
</tr>
</table>
<p/>
<table><caption>Parameters specified as nested elements</caption>
@@ -189,6 +204,31 @@
<include name="*.fo"/>
</fileset>
</fop>
</target>
]]></source>
<p>
The following example transforms and converts a single XML and XSLT file to an AFP document:
</p>
<source><![CDATA[
<target name="generate-afp-from-transform" description="Generates a single AFP file from an XSLT stylesheet">
<fop format="application/x-afp"
xmlfile="c:\working\foDirectory\Document.xml"
xsltfile="c:\working\foDirectory\Document.xslt"
outfile="c:\working\afpDirectory\Document.afp" />
</target>
]]></source>
<p>
This example transforms and converts all XML files within an entire directory to PostScript:
</p>
<source><![CDATA[
<target name="generate-multiple-ps-from-transform" description="Generates multiple PostScript files using an XSLT stylesheet">
<fop format="application/postscript"
xsltfile="c:\working\foDirectory\Document.xslt"
outdir="${build.dir}" messagelevel="debug">
<fileset dir="${test.dir}">
<include name="*.xml"/>
</fileset>
</fop>
</target>
]]></source>
</section>

src/documentation/content/xdocs/0.94/compiling.xml → src/documentation/content/xdocs/1.0/compiling.xml View File

@@ -41,7 +41,7 @@
<section id="env-jdk">
<title>JDK</title>
<p>
Building FOP requires a minimum Java Development Kit (JDK/SDK) of 1.3
Building FOP requires a minimum Java Development Kit (JDK/SDK) of 1.4
(A Java Runtime Environment is not sufficient).
</p>
</section>
@@ -59,14 +59,14 @@
<p>
The build script uses <a href="ext:ant">Apache Ant</a>, 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.3 or above, which normally
your local JDK root directory. This is true even if you use JDK 1.4 or above, which normally
does not need this setting.
</p>
</section>
<section id="env-ant">
<title>Apache Ant</title>
<p>
<a href="ext:ant">Apache Ant</a> must be installed in order to
<a href="ext:ant">Apache Ant</a> (Version 1.7 or later) must be installed in order to
build FOP. Following best practices we don't include Ant with FOP anymore. You can find the
<a href="ext:ant/manual/">instructions to install Ant in the Ant manual</a> on the web.
</p>

src/documentation/content/xdocs/0.94/configuration.xml → src/documentation/content/xdocs/1.0/configuration.xml View File

@@ -151,6 +151,18 @@
default-page-settings element to specify the two values.</td>
<td>"height" 11 inches, "width" 8.26 inches</td>
</tr>
<tr>
<td>prefer-renderer</td>
<td>boolean (true, false)</td>
<td>
By default, FOP prefers the newer output implementations based on the
<code>IFDocumentHandler</code> interface. If no such implementation can be found for
a given MIME type, it looks for an implementation of the <code>Renderer</code> interface.
If necessary, you can invert the lookup order to prefer the Renderer variant over the
IFDocumentHandler variant by setting this value to true.
</td>
<td>false</td>
</tr>
<tr>
<td>use-cache</td>
<td>boolean (true, false)</td>
@@ -206,6 +218,42 @@
<!-- etc. etc..... -->
</fop>]]></source>
</section>
<section id="image-loading">
<title>Image Loading Customization</title>
<p>
Apache FOP uses the image loading framework from
<a href="http://xmlgraphics.apache.org/commons/">Apache XML Graphics Commons</a> to load
images using various plug-ins. Every image loader plug-in has a hard-coded usage penalty
that influences which solution is chosen if there are multiple possibilities to load an image.
Sometimes, though, these penalties need to be tweaked and this can be done in the FOP
configuration. An example:
</p>
<source><![CDATA[<fop version="1.0">
[..]
<image-loading>
<penalty value="10000"
class="org.apache.xmlgraphics.image.loader.impl.ImageLoaderRawCCITTFax"/>
<penalty value="INFINITE"
class="org.apache.xmlgraphics.image.loader.impl.ImageLoaderInternalTIFF"/>
</image-loading>
<renderers....
</fop>]]></source>
<p>
The first penalty element increases the penalty for the raw CCITT loader. This practically
forces the decoding of CCITT compressed TIFF images except if there are no TIFF codecs
available.
</p>
<p>
The second penalty element sets an "infinite" penalty for the TIFF loader using the internal
TIFF codec. This practically disables that plug-in as it will never be chosen as a possible
solution.
</p>
<p>
Negative penalties are possible to promote a plug-in but a negative penalty sum will be
treated as zero penalty in most cases. For more details on the image loading framework,
please consult the documentation there.
</p>
</section>
<section id="renderers">
<title>Renderer configuration</title>
<p>
@@ -277,7 +325,44 @@
<output-profile>C:\FOP\Color\EuropeISOCoatedFOGRA27.icc</output-profile>
<fonts....
</renderer>]]></source>
<p>
Some people don't have high requirements on color fidelity but instead want the smallest
PDF file sizes possible. In this case it's possible to disable the default sRGB color space
which XSL-FO requires. This will cause RGB colors to be generated as device-specific RGB.
Please note that this option is unavailable (and will cause an error) if you enable
PDF/A or PDF/X functionality or if you specify an output profile. This setting will make the
PDF about 4KB smaller. To disable the sRGB color space add the following setting:
</p>
<source><![CDATA[
<renderer mime="application/pdf">
<filterList...
<disable-srgb-colorspace>true</disable-srgb-colorspace>
<fonts....
</renderer>]]></source>
<p>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.</p>
<source><![CDATA[
<renderer mime="application/pdf">
<encryption-params>
<user-password>testuserpass</user-password>
<owner-password>testownerpass</owner-password>
<noprint/>
<nocopy/>
<noedit/>
<noannotations/>
</encryption-params>
</renderer>]]></source>
</section>
<section id="ps-renderer">
<title>Special Settings for the PostScript Renderer</title>
@@ -331,19 +416,42 @@
to "bitmap" which causes all text to be rendered as bitmaps.
</p>
</section>
</section>
<section id="fonts">
<title>Apache FOP Font Config</title>
<p>
Apache FOP has special Font configuration considerations, which are explained
in detail on the <a href="fonts.html">Fonts</a> page.
</p>
<section id="afp-renderer">
<title>Special Settings for the AFP Renderer</title>
<p>
</p>
<p>
Additionally, there are certain settings that control how the renderer handles various elements.
</p>
<source><![CDATA[<renderer mime="application/x-afp">
<images mode="b+w" bits-per-pixel="8" native="true"/>
<renderer-resolution>240</renderer-resolution>
<!-- a default external resource group file -->
<resource-group-file>resources.afp</resource-group-file>
</renderer>]]></source>
<p>
The default value for the images "mode" setting is "b+w" (black and white). When the images "mode" setting is "b+w" a "bits-per-pixel" setting can be provided to aid the grayscale conversion process. With this setting all images referenced in your source document are converted to an IOCA FS45 grayscale bitmap image form.
When the setting is "color" all images are converted to an IOCA FS45 color bitmap image form. When "native" setting is "true", all images encountered (TIFF, GIF, JPEG and Encapsulated Postscript etc.) will be embedded directly in the datastream in their native form using a MO:DCA Object Container.
</p>
<p>
The default value for the "renderer-resolution" is 240 dpi.
</p>
<!--
<p>
The default value for the MO:DCA "interchange-set" is "MO:DCA-L". Other compliance settings include presentation interchange sets "MO:DCA-P IS/1" and "MO:DCA-P IS/2" (Resource Groups).
</p>
-->
<p>
By default if there is no configuration definition for "resource-group-file", external resources will be placed in a file called resources.afp.
</p>
</section>
</section>

<section>
<title>When it does not work</title>
<section>
<title>When it does not work</title>

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

<p>Check the following possibilities:</p>
<p>Check the following possibilities:</p>

<ul>
<li>The format of the configuration file has changed
<ul>
<li>The format of the configuration file has changed
considerably between FOP 0.20.5 and FOP 1.0 and its beta versions. Did
you convert your file to the new format?</li>

<li>The FOP distribution contains a schema for configuration
<li>The FOP distribution contains a schema for configuration
files, at src/foschema/fop-configuration.xsd. Did you validate your
configuration file against it? Add the following schema location to
the <code>schema</code> element:
@@ -373,13 +481,13 @@ and run the configuration file through a validating schema
parser. Note that the schema cannot detect all errors, and that it is
stricter about the order of some elements than FOP itself is.</li>

<li>Run FOP in debug mode (command line option
<li>Run FOP in debug mode (command line option
<code>-d</code>). This makes FOP report which configuration
information it finds. Check if FOP finds what you expect.</li>

</ul>
</ul>

</section>
</section>
</body>
</document>


src/documentation/content/xdocs/0.94/embedding.xml → src/documentation/content/xdocs/1.0/embedding.xml View File

@@ -29,7 +29,7 @@
<section id="overview">
<title>Overview</title>
<p>
Review <a href="running.html">Running FOP</a> for important information that applies
Review <a href="running.html">Running FOP</a> for important information that applies
to embedded applications as well as command-line use, such as options and performance.
</p>
<p>
@@ -54,7 +54,7 @@
<section id="basics">
<title>Basic Usage Pattern</title>
<p>
Apache FOP relies heavily on JAXP. It uses SAX events exclusively to receive the XSL-FO
Apache FOP relies heavily on JAXP. It uses SAX events exclusively to receive the XSL-FO
input document. It is therefore a good idea that you know a few things about JAXP (which
is a good skill anyway). Let's look at the basic usage pattern for FOP...
</p>
@@ -82,14 +82,14 @@ try {
// Step 4: Setup JAXP using identity transformer
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); // identity transformer
// Step 5: Setup input and output for XSLT transformation
// Step 5: Setup input and output for XSLT transformation
// Setup input stream
Source src = new StreamSource(new File("C:/Temp/myfile.fo"));

// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
// Step 6: Start XSLT transformation and FOP processing
transformer.transform(src, res);

@@ -102,13 +102,13 @@ try {
</p>
<ul>
<li>
<strong>Step 1:</strong> You create a new FopFactory instance. The FopFactory instance holds
<strong>Step 1:</strong> 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.
</li>
<li>
<strong>Step 2:</strong> You set up an OutputStream that the generated document
will be written to. It's a good idea to buffer the OutputStream as demonstrated
will be written to. It's a good idea to buffer the OutputStream as demonstrated
to improve performance.
</li>
<li>
@@ -119,26 +119,26 @@ try {
OutputStream you've setup up in step 2.
</li>
<li>
<strong>Step 4</strong> We recommend that you use JAXP Transformers even
if you don't do XSLT transformations to generate the XSL-FO file. This way
you can always use the same basic pattern. The example here sets up an
"identity transformer" which just passes the input (Source) unchanged to the
output (Result). You don't have to work with a SAXParser if you don't do any
<strong>Step 4</strong> We recommend that you use JAXP Transformers even
if you don't do XSLT transformations to generate the XSL-FO file. This way
you can always use the same basic pattern. The example here sets up an
"identity transformer" which just passes the input (Source) unchanged to the
output (Result). You don't have to work with a SAXParser if you don't do any
XSLT transformations.
</li>
<li>
<strong>Step 5:</strong> Here you set up the input and output for the XSLT
transformation. The Source object is set up to load the "myfile.fo" file.
The Result is set up so the output of the XSLT transformation is sent to FOP.
The FO file is sent to FOP in the form of SAX events which is the most efficient
way. Please always avoid saving intermediate results to a file or a memory buffer
<strong>Step 5:</strong> Here you set up the input and output for the XSLT
transformation. The Source object is set up to load the "myfile.fo" file.
The Result is set up so the output of the XSLT transformation is sent to FOP.
The FO file is sent to FOP in the form of SAX events which is the most efficient
way. Please always avoid saving intermediate results to a file or a memory buffer
because that affects performance negatively.
</li>
<li>
<strong>Step 6:</strong> Finally, we start the XSLT transformation by starting
the JAXP Transformer. As soon as the JAXP Transformer starts to send its output
to FOP, FOP itself starts its processing in the background. When the
<code>transform()</code> method returns FOP will also have finished converting
<strong>Step 6:</strong> Finally, we start the XSLT transformation by starting
the JAXP Transformer. As soon as the JAXP Transformer starts to send its output
to FOP, FOP itself starts its processing in the background. When the
<code>transform()</code> method returns FOP will also have finished converting
the FO file to a PDF file and you can close the OutputStream.
<note label="Tip!">
It's a good idea to enclose the whole conversion in a try..finally statement. If
@@ -148,16 +148,16 @@ try {
</li>
</ul>
<p>
If you're not totally familiar with JAXP Transformers, please have a look at the
If you're not totally familiar with JAXP Transformers, please have a look at the
<a href="#examples">Embedding examples</a> below. The section contains examples
for all sorts of use cases. If you look at all of them in turn you should be able
to see the patterns in use and the flexibility this approach offers without adding
too much complexity.
</p>
<p>
This may look complicated at first, but it's really just the combination of an
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
for debugging purposes, for example when you're tracking down a bug in your
stylesheet. You can easily write the XSL-FO output from the XSL transformation
to a file to check if that part generates the expected output. An example for that
can be found in the <a href="#examples">Embedding examples</a> (See "ExampleXML2FO").
@@ -166,40 +166,50 @@ try {
<title>Logging</title>
<p>
Logging is now a little different than it was in FOP 0.20.5. We've switched from
Avalon Logging to <a href="ext:jakarta/commons/logging">Jakarta Commons Logging</a>.
Avalon Logging to <a href="ext:commons-logging">Jakarta Commons Logging</a>.
While with Avalon Logging the loggers were directly given to FOP, FOP now retrieves
its logger(s) through a statically available LogFactory. This is similar to the
general pattern that you use when you work with Apache Log4J directly, for example.
We call this "static logging" (Commons Logging, Log4J) as opposed to "instance logging"
We call this "static logging" (Commons Logging, Log4J) as opposed to "instance logging"
(Avalon Logging). This has a consequence: You can't give FOP a logger for each
processing run anymore. The log output of multiple, simultaneously running FOP instances
is sent to the same logger.
</p>
<note>
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 <a href="http://wiki.apache.org/xmlgraphics-fop/ProcessingFeedback">Wiki page</a>
which documents what we're going to build.
</note>
<p>
By default, <a href="ext:jakarta/commons/logging">Jakarta Commons Logging</a> uses
By default, <a href="ext:commons-logging">Jakarta Commons Logging</a> uses
JDK logging (available in JDKs 1.4 or higher) as its backend. You can configure Commons
Logging to use an alternative backend, for example Log4J. Please consult the
<a href="ext:jakarta/commons/logging">documentation for Jakarta Commons Logging</a> on
<a href="ext:commons-logging">documentation for Jakarta Commons Logging</a> on
how to configure alternative backends.
</p>
<p>
As a result of the above we differentiate between two kinds of "logging":
</p>
<ul>
<li>(FOP-)Developer-oriented logging</li>
<li><a href="events.html">User/Integrator-oriented feedback</a> (NEW!)</li>
</ul>
<p>
The use of "feedback" instead of "logging" is intentional. Most people were using
log output as a means to get feedback from events within FOP. Therefore, FOP now
includes an <code>event</code> package which can be used to receive feedback from
the layout engine and other components within FOP <strong>per rendering run</strong>.
This feedback is not just some
text but event objects with parameters so these events can be interpreted by code.
Of course, there is a facility to turn these events into normal human-readable
messages. For details, please read on on the <a href="events.html">Events page</a>.
This leaves normal logging to be mostly a thing used by the FOP developers
although anyone can surely activate certain logging categories but the feedback
from the loggers won't be separated by processing runs. If this is required,
the <a href="events.html">Events subsystem</a> is the right approach.
</p>
</section>
<section id="render">
<title>Processing XSL-FO</title>
<p>
Once the Fop instance is set up, call <code>getDefaultHandler()</code> to obtain a SAX
DefaultHandler instance to which you can send the SAX events making up the XSL-FO
Once the Fop instance is set up, call <code>getDefaultHandler()</code> to obtain a SAX
DefaultHandler instance to which you can send the SAX events making up the XSL-FO
document you'd like to render. FOP processing starts as soon as the DefaultHandler's
<code>startDocument()</code> method is called. Processing stops again when the
DefaultHandler's <code>endDocument()</code> method is called. Please refer to the basic
@@ -210,15 +220,15 @@ try {
<section id="render-with-xslt">
<title>Processing XSL-FO generated from XML+XSLT</title>
<p>
If you want to process XSL-FO generated from XML using XSLT we recommend
again using standard JAXP to do the XSLT part and piping the generated SAX
events directly through to FOP. The only thing you'd change to do that
If you want to process XSL-FO generated from XML using XSLT we recommend
again using standard JAXP to do the XSLT part and piping the generated SAX
events directly through to FOP. The only thing you'd change to do that
on the basic usage pattern above is to set up the Transformer differently:
</p>
<source><![CDATA[
//without XSLT:
//Transformer transformer = factory.newTransformer(); // identity transformer
//with XSLT:
Source xslt = new StreamSource(new File("mystylesheet.xsl"));
Transformer transformer = factory.newTransformer(xslt);]]></source>
@@ -227,14 +237,14 @@ try {
<section id="input">
<title>Input Sources</title>
<p>
The input XSL-FO document is always received by FOP as a SAX stream (see the
The input XSL-FO document is always received by FOP as a SAX stream (see the
<a href="../dev/design/parsing.html">Parsing Design Document</a> for the rationale).
</p>
<p>
However, you may not always have your input document available as a SAX stream.
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.
to set up the right Source instance as input for the JAXP transformation.
A few examples:
</p>
<ul>
@@ -263,8 +273,8 @@ try {
<p>
There are a variety of upstream data manipulations possible.
For example, you may have a DOM and an XSL stylesheet; or you may want to
set variables in the stylesheet. Interface documentation and some cookbook
solutions to these situations are provided in
set variables in the stylesheet. Interface documentation and some cookbook
solutions to these situations are provided in
<a href="http://xml.apache.org/xalan-j/usagepatterns.html">Xalan Basic Usage Patterns</a>.
</p>
</section>
@@ -278,7 +288,7 @@ try {
<title>Customizing the FopFactory</title>
<p>
The FopFactory holds configuration data and references to objects which are reusable over
multiple rendering runs. It's important to instantiate it only once (except in special
multiple rendering runs. It's important to instantiate it only once (except in special
environments) and reuse it every time to create new FOUserAgent and Fop instances.
</p>
<p>
@@ -289,34 +299,34 @@ try {
<p>
The <strong>font base URL</strong> to use when resolving relative URLs for fonts. Example:
</p>
<source>fopFactory.setFontBaseURL("file:///C:/Temp/fonts");</source>
<source>fopFactory.getFontManager().setFontBaseURL("file:///C:/Temp/fonts");</source>
</li>
<li>
<p>
The <strong>hyphenation base URL</strong> to use when resolving relative URLs for
The <strong>hyphenation base URL</strong> to use when resolving relative URLs for
hyphenation patterns. Example:
</p>
<source>fopFactory.setHyphenBaseURL("file:///C:/Temp/hyph");</source>
</li>
<li>
<p>
Disable <strong>strict validation</strong>. When disabled FOP is less strict about the rules
Disable <strong>strict validation</strong>. When disabled FOP is less strict about the rules
established by the XSL-FO specification. Example:
</p>
<source>fopFactory.setStrictValidation(false);</source>
</li>
<li>
<p>
Enable an <strong>alternative set of rules for text indents</strong> that tries to mimic the behaviour of many commercial
FO implementations, that chose to break the specification in this respect. The default of this option is
'false', which causes Apache FOP to behave exactly as described in the specification. To enable the
Enable an <strong>alternative set of rules for text indents</strong> that tries to mimic the behaviour of many commercial
FO implementations, that chose to break the specification in this respect. The default of this option is
'false', which causes Apache FOP to behave exactly as described in the specification. To enable the
alternative behaviour, call:
</p>
<source>fopFactory.setBreakIndentInheritanceOnReferenceAreaBoundary(true);</source>
</li>
<li>
<p>
Set the <strong>source resolution</strong> for the document. This is used internally to determine the pixel
Set the <strong>source resolution</strong> for the document. This is used internally to determine the pixel
size for SVG images and bitmap images without resolution information. Default: 72 dpi. Example:
</p>
<source>fopFactory.setSourceResolution(96); // =96dpi (dots/pixels per Inch)</source>
@@ -324,7 +334,7 @@ try {
<li>
<p>
Manually add an <strong>ElementMapping instance</strong>. If you want to supply a special FOP extension
you can give the instance to the FOUserAgent. Normally, the FOP extensions can be automatically detected
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:
</p>
<source>fopFactory.addElementMapping(myElementMapping); // myElementMapping is a org.apache.fop.fo.ElementMapping</source>
@@ -332,13 +342,13 @@ try {
<li>
<p>
Set a <strong>URIResolver</strong> for custom URI resolution. By supplying a JAXP URIResolver you can add
custom URI resolution functionality to FOP. For example, you can use
custom URI resolution functionality to FOP. For example, you can use
<a href="ext:xml.apache.org/commons/resolver">Apache XML Commons Resolver</a> to make use of XCatalogs. Example:
</p>
<source>fopFactory.setURIResolver(myResolver); // myResolver is a javax.xml.transform.URIResolver</source>
<note>
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
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.
</note>
</li>
@@ -347,9 +357,9 @@ try {
<section id="user-agent">
<title>Customizing the User Agent</title>
<p>
The user agent is the entity that allows you to interact with a single rendering run, i.e. the processing of a single
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
of FOUserAgent using the appropriate factory method on FopFactory and pass that
to the factory method that will create a new Fop instance:
</p>
<source><![CDATA[
@@ -406,16 +416,16 @@ try {
</li>
<li>
<p>
Set the <strong>target resolution</strong> for the document. This is used to
specify the output resolution for bitmap images generated by bitmap renderers
(such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter
Set the <strong>target resolution</strong> for the document. This is used to
specify the output resolution for bitmap images generated by bitmap renderers
(such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter
effects and such. Default: 72 dpi. Example:
</p>
<source>userAgent.setTargetResolution(300); // =300dpi (dots/pixels per Inch)</source>
</li>
<li>
<p>
Set <strong>your own Renderer instance</strong>. If you want to supply your own renderer or
Set <strong>your own Renderer instance</strong>. 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:
</p>
@@ -423,8 +433,8 @@ try {
</li>
<li>
<p>
Set <strong>your own FOEventHandler instance</strong>. If you want to supply your own FOEventHandler or
configure an FOEventHandler subclass in a special way you can give the instance to the FOUserAgent. Normally,
Set <strong>your own FOEventHandler instance</strong>. If you want to supply your own FOEventHandler or
configure an FOEventHandler subclass in a special way you can give the instance to the FOUserAgent. Normally,
the FOEventHandler instance is created by FOP. Example:
</p>
<source>userAgent.setFOEventHandlerOverride(myFOEventHandler); // myFOEventHandler is an org.apache.fop.fo.FOEventHandler</source>
@@ -432,7 +442,7 @@ try {
<li>
<p>
Set a <strong>URIResolver</strong> for custom URI resolution. By supplying a JAXP URIResolver you can add
custom URI resolution functionality to FOP. For example, you can use
custom URI resolution functionality to FOP. For example, you can use
<a href="ext:xml.apache.org/commons/resolver">Apache XML Commons Resolver</a> to make use of XCatalogs. Example:
</p>
<source>userAgent.setURIResolver(myResolver); // myResolver is a javax.xml.transform.URIResolver</source>
@@ -452,7 +462,7 @@ try {
<section id="config-external">
<title>Using a Configuration File</title>
<p>
Instead of setting the parameters manually in code as shown above you can also set
Instead of setting the parameters manually in code as shown above you can also set
many values from an XML configuration file:
</p>
<source><![CDATA[
@@ -479,7 +489,7 @@ fopFactory.setUserConfig(new File("C:/Temp/mycfg.xml"));]]></source>
<p>
Fop instances shouldn't (and can't) be reused. Please recreate
Fop and FOUserAgent instances for each rendering run using the FopFactory.
This is a cheap operation as all reusable information is held in the
This is a cheap operation as all reusable information is held in the
FopFactory. That's why it's so important to reuse the FopFactory instance.
</p>
</section>
@@ -505,12 +515,12 @@ fopFactory.setUserConfig(new File("C:/Temp/mycfg.xml"));]]></source>
<section id="render-info">
<title>Getting information on the rendering process</title>
<p>
To get the number of pages that were rendered by FOP you can call
<code>Fop.getResults()</code>. This returns a <code>FormattingResults</code> object
where you can look up the number of pages produced. It also gives you the
page-sequences that were produced along with their id attribute and their
numbers of pages. This is particularly useful if you render multiple
documents (each enclosed by a page-sequence) and have to know the number of
To get the number of pages that were rendered by FOP you can call
<code>Fop.getResults()</code>. This returns a <code>FormattingResults</code> object
where you can look up the number of pages produced. It also gives you the
page-sequences that were produced along with their id attribute and their
numbers of pages. This is particularly useful if you render multiple
documents (each enclosed by a page-sequence) and have to know the number of
pages of each document.
</p>
</section>
@@ -522,19 +532,19 @@ fopFactory.setUserConfig(new File("C:/Temp/mycfg.xml"));]]></source>
</p>
<ul>
<li>
Whenever possible, try to use SAX to couple the individual components involved
Whenever possible, try to use SAX to couple the individual components involved
(parser, XSL transformer, SQL datasource etc.).
</li>
<li>
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:
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:
<code>out = new java.io.BufferedOutputStream(out);</code>
<br/>
Make sure you properly close the OutputStream when FOP is finished.
</li>
<li>
Cache the stylesheet. If you use the same stylesheet multiple times
Cache the stylesheet. If you use the same stylesheet multiple times
you can set up a JAXP <code>Templates</code> object and reuse it each time you do
the XSL transformation. (More information can be found
<a class="fork" href="http://www.javaworld.com/javaworld/jw-05-2003/jw-0502-xsl.html">here</a>.)
@@ -547,6 +557,9 @@ fopFactory.setUserConfig(new File("C:/Temp/mycfg.xml"));]]></source>
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.
</li>
<li>
You may also wish to consider trying to reduce <a href="http://xmlgraphics.apache.org/fop/trunk/running.html#memory">memory usage</a>.
</li>
</ul>
</section>
<section id="multithreading">
@@ -557,7 +570,7 @@ fopFactory.setUserConfig(new File("C:/Temp/mycfg.xml"));]]></source>
If you encounter any suspicious behaviour, please notify us.
</p>
<p>
There is also a known issue with fonts being jumbled between threads when using
There is also a known issue with fonts being jumbled between threads when using
the Java2D/AWT renderer (which is used by the -awt and -print output options).
In general, you cannot safely run multiple threads through the AWT renderer.
</p>
@@ -565,7 +578,7 @@ fopFactory.setUserConfig(new File("C:/Temp/mycfg.xml"));]]></source>
<section id="examples">
<title>Examples</title>
<p>
The directory "{fop-dir}/examples/embedding" contains several working examples.
The directory "{fop-dir}/examples/embedding" contains several working examples.
</p>
<section id="ExampleFO2PDF">
<title>ExampleFO2PDF.java</title>
@@ -579,104 +592,104 @@ file to PDF using FOP.
</section>
<section id="ExampleXML2FO">
<title>ExampleXML2FO.java</title>
<p>This
<p>This
<a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2FO.java?view=markup">
example</a>
has nothing to do with FOP. It is there to show you how an XML
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
transformation. Make sure you've got a JAXP-compliant XSLT processor in your
classpath (ex. <a href="http://xml.apache.org/xalan-j">Xalan</a>).
</p>
<figure src="images/EmbeddingExampleXML2FO.png" alt="Example XML to XSL-FO"/>
</section>
<section id="ExampleXML2PDF">
<title>ExampleXML2PDF.java</title>
<p>This
<p>This
<a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleXML2PDF.java?view=markup">
example</a>
demonstrates how you can convert an arbitrary XML file to PDF
using XSLT and XSL-FO/FOP. It is a combination of the first two examples
above. The example uses JAXP to transform the XML file to XSL-FO and FOP to
demonstrates how you can convert an arbitrary XML file to PDF
using XSLT and XSL-FO/FOP. It is a combination of the first two examples
above. The example uses JAXP to transform the XML file to XSL-FO and FOP to
transform the XSL-FO to PDF.
</p>
<figure src="images/EmbeddingExampleXML2PDF.png" alt="Example XML to PDF (via XSL-FO)"/>
<p>
The output (XSL-FO) from the XSL transformation is piped through to FOP using
SAX events. This is the most efficient way to do this because the
intermediate result doesn't have to be saved somewhere. Often, novice users
save the intermediate result in a file, a byte array or a DOM tree. We
strongly discourage you to do this if it isn't absolutely necessary. The
The output (XSL-FO) from the XSL transformation is piped through to FOP using
SAX events. This is the most efficient way to do this because the
intermediate result doesn't have to be saved somewhere. Often, novice users
save the intermediate result in a file, a byte array or a DOM tree. We
strongly discourage you to do this if it isn't absolutely necessary. The
performance is significantly higher with SAX.
</p>
</section>
<section id="ExampleObj2XML">
<title>ExampleObj2XML.java</title>
<p>This
<p>This
<a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleObj2XML.java?view=markup">
example</a>
is a preparatory example for the next one. It's an example that
shows how an arbitrary Java object can be converted to XML. It's an often
needed task to do this. Often people create a DOM tree from a Java object and
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
to do this using SAX, which will probably be faster and not even more
complicated once you know how this works.
</p>
<figure src="images/EmbeddingExampleObj2XML.png" alt="Example Java object to XML"/>
<p>
For this example we've created two classes: ProjectTeam and ProjectMember
(found in xml-fop/examples/embedding/java/embedding/model). They represent
the same data structure found in
xml-fop/examples/embedding/xml/xml/projectteam.xml. We want to serialize to XML a
project team with several members which exist as Java objects.
Therefore we created the two classes: ProjectTeamInputSource and
For this example we've created two classes: ProjectTeam and ProjectMember
(found in xml-fop/examples/embedding/java/embedding/model). They represent
the same data structure found in
xml-fop/examples/embedding/xml/xml/projectteam.xml. We want to serialize to XML a
project team with several members which exist as Java objects.
Therefore we created the two classes: ProjectTeamInputSource and
ProjectTeamXMLReader (in the same place as ProjectTeam above).
</p>
<p>
The XMLReader implementation (regard it as a special kind of XML parser) is
responsible for creating SAX events from the Java object. The InputSource
The XMLReader implementation (regard it as a special kind of XML parser) is
responsible for creating SAX events from the Java object. The InputSource
class is only used to hold the ProjectTeam object to be used.
</p>
<p>
Have a look at the source of ExampleObj2XML.java to find out how this is
used. For more detailed information see other resources on JAXP (ex.
Have a look at the source of ExampleObj2XML.java to find out how this is
used. For more detailed information see other resources on JAXP (ex.
<a class="fork" href="http://java.sun.com/xml/jaxp/dist/1.1/docs/tutorial/xslt/3_generate.html">An older JAXP tutorial</a>).
</p>
</section>
<section id="ExampleObj2PDF">
<title>ExampleObj2PDF.java</title>
<p>This
<p>This
<a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleObj2PDF.java?view=markup">
example</a>
combines the previous and the third to demonstrate
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
by generating SAX events from the Java object that get fed to an XSL
transformation. The result of the transformation is then converted to PDF
using FOP as before.
</p>
<figure src="images/EmbeddingExampleObj2PDF.png" alt="Example Java object to PDF (via XML and XSL-FO)"/>
</section>
<section id="ExampleDOM2PDF">
<title>ExampleDOM2PDF.java</title>
<p>This
<p>This
<a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleDOM2PDF.java?view=markup">
example</a>
has FOP use a DOMSource instead of a StreamSource in order to
has FOP use a DOMSource instead of a StreamSource in order to
use a DOM tree as input for an XSL transformation.
</p>
</section>
<section id="ExampleSVG2PDF">
<title>ExampleSVG2PDF.java (PDF Transcoder example)</title>
<p>This
<p>This
<a href="http://svn.apache.org/viewcvs.cgi/xmlgraphics/fop/trunk/examples/embedding/java/embedding/ExampleSVG2PDF.java?view=markup">
example</a>
shows the usage of the PDF Transcoder, a sub-application within FOP.
shows the usage of the PDF Transcoder, a sub-application within FOP.
It is used to generate a PDF document from an SVG file.
</p>
</section>
<section id="example-notes">
<title>Final notes</title>
<p>
These examples should give you an idea of what's possible. It should be easy
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

+ 449
- 0
src/documentation/content/xdocs/1.0/events.xml View File

@@ -0,0 +1,449 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Events/Processing Feedback</title>
<version>$Revision$</version>
</header>
<body>
<section id="introduction">
<title>Introduction</title>
<p>
In versions until 0.20.5, FOP used
<a href="http://excalibur.apache.org/framework/index.html">Avalon-style Logging</a> where
it was possible to supply a logger per processing run. During the redesign
the logging infrastructure was switched over to
<a href="http://commons.apache.org/logging/">Commons Logging</a> which is (like Log4J or
java.util.logging) a "static" logging framework (the logger is accessed through static
variables). This made it very difficult in a multi-threaded system to retrieve information
for a single processing run.
</p>
<p>
With FOP's event subsystem, we'd like to close this gap again and even go further. The
first point is to realize that we have two kinds of "logging". Firstly, we have the logging
infrastructure for the (FOP) developer who needs to be able to enable finer log messages
for certain parts of FOP to track down a certain problem. Secondly, we have the user who
would like to be informed about missing images, overflowing lines or substituted fonts.
These messages (or events) are targeted at less technical people and may ideally be
localized (translated). Furthermore, tool and solution builders would like to integrate
FOP into their own solutions. For example, an FO editor should be able to point the user
to the right place where a particular problem occurred while developing a document template.
Finally, some integrators would like to abort processing if a resource (an image or a font)
has not been found, while others would simply continue. The event system allows to
react on these events.
</p>
<p>
On this page, we won't discuss logging as such. We will show how the event subsystem can
be used for various tasks. We'll first look at the event subsystem from the consumer side.
Finally, the production of events inside FOP will be discussed (this is mostly interesting
for FOP developers only).
</p>
</section>
<section id="consumer">
<title>The consumer side</title>
<p>
The event subsystem is located in the <code>org.apache.fop.events</code> package and its
base is the <code>Event</code> class. An instance is created for each event and is sent
to a set of <code>EventListener</code> instances by the <code>EventBroadcaster</code>.
An <code>Event</code> contains:
</p>
<ul>
<li>an event ID,</li>
<li>a source object (which generated the event),</li>
<li>a severity level (Info, Warning, Error and Fatal Error) and</li>
<li>a map of named parameters.</li>
</ul>
<p>
The <code>EventFormatter</code> class can be used to translate the events into
human-readable, localized messages.
</p>
<p>
A full example of what is shown here can be found in the
<code>examples/embedding/java/embedding/events</code> directory in the FOP distribution.
The example can also be accessed
<a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/events/">via the web</a>.
</p>
<section id="write-listener">
<title>Writing an EventListener</title>
<p>
The following code sample shows a very simple EventListener. It basically just sends
all events to System.out (stdout) or System.err (stderr) depending on the event severity.
</p>
<source><![CDATA[import org.apache.fop.events.Event;
import org.apache.fop.events.EventFormatter;
import org.apache.fop.events.EventListener;
import org.apache.fop.events.model.EventSeverity;

/** A simple event listener that writes the events to stdout and stderr. */
public class SysOutEventListener implements EventListener {

/** {@inheritDoc} */
public void processEvent(Event event) {
String msg = EventFormatter.format(event);
EventSeverity severity = event.getSeverity();
if (severity == EventSeverity.INFO) {
System.out.println("[INFO ] " + msg);
} else if (severity == EventSeverity.WARN) {
System.out.println("[WARN ] " + msg);
} else if (severity == EventSeverity.ERROR) {
System.err.println("[ERROR] " + msg);
} else if (severity == EventSeverity.FATAL) {
System.err.println("[FATAL] " + msg);
} else {
assert false;
}
}
}]]></source>
<p>
You can see that for every event the method <code>processEvent</code> of the
<code>EventListener</code> will be called. Inside this method you can do whatever
processing you would like including throwing a <code>RuntimeException</code>, if you want
to abort the current processing run.
</p>
<p>
The code above also shows how you can turn an event into a human-readable, localized
message that can be presented to a user. The <code>EventFormatter</code> class does
this for you. It provides additional methods if you'd like to explicitly specify
the locale.
</p>
<p>
It is possible to gather all events for a whole processing run so they can be
evaluated afterwards. However, care should be taken about memory consumption since
the events provide references to objects inside FOP which may themselves have
references to other objects. So holding on to these objects may mean that whole
object trees cannot be released!
</p>
</section>
<section id="add-listener">
<title>Adding an EventListener</title>
<p>
To register the event listener with FOP, get the <code>EventBroadcaster</code> which
is associated with the user agent (<code>FOUserAgent</code>) and add it there:
</p>
<source><![CDATA[FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
foUserAgent.getEventBroadcaster().addEventListener(new SysOutEventListener());]]></source>
<p>
Please note that this is done separately for each processing run, i.e. for each
new user agent.
</p>
</section>
<section id="listener-example1">
<title>An additional listener example</title>
<p>
Here's an additional example of an event listener:
</p>
<p>
By default, FOP continues processing even if an image wasn't found. If you have
more strict requirements and want FOP to stop if an image is not available, you can
do something like the following in the simplest case:
</p>
<source><![CDATA[public class MyEventListener implements EventListener {

public void processEvent(Event event) {
if ("org.apache.fop.ResourceEventProducer".equals(
event.getEventGroupID())) {
event.setSeverity(EventSeverity.FATAL);
} else {
//ignore all other events (or do something of your choice)
}
}
}]]></source>
<p>
Increasing the event severity to FATAL will signal the event broadcaster to throw
an exception and stop further processing. In the above case, all resource-related
events will cause FOP to stop processing.
</p>
<p>
You can also customize the exception to throw (you can may throw a RuntimeException
or subclass yourself) and/or which event to respond to:
</p>
<source><![CDATA[public class MyEventListener implements EventListener {

public void processEvent(Event event) {
if ("org.apache.fop.ResourceEventProducer.imageNotFound"
.equals(event.getEventID())) {
//Get the FileNotFoundException that's part of the event's parameters
FileNotFoundException fnfe = (FileNotFoundException)event.getParam("fnfe");

throw new RuntimeException(EventFormatter.format(event), fnfe);
} else {
//ignore all other events (or do something of your choice)
}
}
}]]></source>
<p>
This throws a <code>RuntimeException</code> with the <code>FileNotFoundException</code>
as the cause. Further processing effectively stops in FOP. You can catch the exception
in your code and react as you see necessary.
</p>
</section>
</section>
<section id="producer">
<title>The producer side (for FOP developers)</title>
<p>
This section is primarily for FOP and FOP plug-in developers. It describes how to use
the event subsystem for producing events.
</p>
<note>
The event package has been designed in order to be theoretically useful for use cases
outside FOP. If you think this is interesting independently from FOP, please talk to
<a href="mailto:fop-dev@xmlgraphics.apache.org">us</a>.
</note>
<section id="basic-event-production">
<title>Producing and sending an event</title>
<p>
The basics are very simple. Just instantiate an <code>Event</code> object and fill
it with the necessary parameters. Then pass it to the <code>EventBroadcaster</code>
which distributes the events to the interested listeneners. Here's a code example:
</p>
<source><![CDATA[Event ev = new Event(this, "complain", EventSeverity.WARN,
Event.paramsBuilder()
.param("reason", "I'm tired")
.param("blah", new Integer(23))
.build());
EventBroadcaster broadcaster = [get it from somewhere];
broadcaster.broadcastEvent(ev);
]]></source>
<p>
The <code>Event.paramsBuilder()</code> is a
<a href="http://en.wikipedia.org/wiki/Fluent_interface">fluent interface</a>
to help with the build-up of the parameters. You could just as well instantiate a
<code>Map</code> (<code>Map&lt;String, Object&gt;</code>) and fill it with values.
</p>
</section>
<section id="event-producer">
<title>The EventProducer interface</title>
<p>
To simplify event production, the event subsystem provides the <code>EventProducer</code>
interface. You can create interfaces which extend <code>EventProducer</code>. These
interfaces will contain one method per event to be generated. By contract, each event
method must have as its first parameter a parameter named "source" (Type Object) which
indicates the object that generated the event. After that come an arbitrary number of
parameters of any type as needed by the event.
</p>
<p>
The event producer interface does not need to have any implementation. The implementation
is produced at runtime by a dynamic proxy created by <code>DefaultEventBroadcaster</code>.
The dynamic proxy creates <code>Event</code> instances for each method call against
the event producer interface. Each parameter (except "source") is added to the event's
parameter map.
</p>
<p>
To simplify the code needed to get an instance of the event producer interface it is
suggested to create a public inner provider class inside the interface.
</p>
<p>
Here's an example of such an event producer interface:
</p>
<source><![CDATA[public interface MyEventProducer extends EventProducer {

public class Provider {
public static MyEventProducer get(EventBroadcaster broadcaster) {
return (MyEventProducer)broadcaster.getEventProducerFor(MyEventProducer.class);
}
}

/**
* Complain about something.
* @param source the event source
* @param reason the reason for the complaint
* @param blah the complaint
* @event.severity WARN
*/
void complain(Object source, String reason, int blah);
}]]></source>
<p>
To produce the same event as in the first example above, you'd use the following code:
</p>
<source><![CDATA[EventBroadcaster broadcaster = [get it from somewhere];
TestEventProducer producer = TestEventProducer.Provider.get(broadcaster);
producer.complain(this, "I'm tired", 23);]]></source>
</section>
<section id="event-model">
<title>The event model</title>
<p>
Inside an invocation handler for a dynamic proxy, there's no information about
the names of each parameter. The JVM doesn't provide it. The only thing you know is
the interface and method name. In order to properly fill the <code>Event</code>'s
parameter map we need to know the parameter names. These are retrieved from an
event object model. This is found in the <code>org.apache.fop.events.model</code>
package. The data for the object model is retrieved from an XML representation of the
event model that is loaded as a resource. The XML representation is generated using an
Ant task at build time (<code>ant resourcegen</code>). The Ant task (found in
<code>src/codegen/java/org/apache/fop/tools/EventProducerCollectorTask.java</code>)
scans FOP's sources for descendants of the <code>EventProducer</code> interface and
uses <a href="http://qdox.codehaus.org/">QDox</a> to parse these interfaces.
</p>
<p>
The event model XML files are generated during build by the Ant task mentioned above when
running the "resourcegen" task. So just run <code>"ant resourcegen"</code> if you receive
a <code>MissingResourceException</code> at runtime indicating that
<code>"event-model.xml"</code> is missing.
</p>
<p>
Primarily, the QDox-based collector task records the parameters' names and types.
Furthermore, it extracts additional attributes embedded as Javadoc comments from
the methods. At the moment, the only such attribute is "@event.severity" which indicates
the default event severity (which can be changed by event listeners). The example event
producer above shows the Javadocs for an event method.
</p>
<p>
There's one more information that is extracted from the event producer information for
the event model: an optional primary exception. The first exception in the "throws"
declaration of an event method is noted. It is used to throw an exception from
the invocation handler if the event has an event severity of "FATAL" when all
listeners have been called (listeners can update the event severity). Please note
that an implementation of
<code>org.apache.fop.events.EventExceptionManager$ExceptionFactory</code> has to be
registered for the <code>EventExceptionManager</code> to be able to construct the
exception from an event.
</p>
<p>
For a given application, there can be multiple event models active at the same time.
In FOP, each renderer is considered to be a plug-in and provides its own specific
event model. The individual event models are provided through an
<code>EventModelFactory</code>. This interface is implemented for each event model
and registered through the service provider mechanism
(see the <a href="#plug-ins">plug-ins section</a> for details).
</p>
</section>
<section id="event-severity">
<title>Event severity</title>
<p>
Four different levels of severity for events has been defined:
</p>
<ol>
<li>INFO: informational only</li>
<li>WARN: a Warning</li>
<li>ERROR: an error condition from which FOP can recover. FOP will continue processing.</li>
<li>FATAL: a fatal error which causes an exception in the end and FOP will stop processing.</li>
</ol>
<p>
Event listeners can choose to ignore certain events based on their event severity.
Please note that you may recieve an event "twice" in a specific case: if there is
a fatal error an event is generated and sent to the listeners. After that an exception
is thrown with the same information and processing stops. If the fatal event is
shown to the user and the following exception is equally presented to the user it
may appear that the event is duplicated. Of course, the same information is just
published through two different channels.
</p>
</section>
<section id="plug-ins">
<title>Plug-ins to the event subsystem</title>
<p>
The event subsystem is extensible. There are a number of extension points:
</p>
<ul>
<li>
<strong><code>org.apache.fop.events.model.EventModelFactory</code>:</strong> Provides
an event model to the event subsystem.
</li>
<li>
<strong><code>org.apache.fop.events.EventExceptionManager$ExceptionFactory</code>:</strong>
Creates exceptions for events, i.e. turns an event into a specific exception.
</li>
</ul>
<p>
The names in bold above are used as filenames for the service provider files that
are placed in the <code>META-INF/services</code> directory. That way, they are
automatically detected. This is a mechanism defined by the
<a href="http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html#Service%20Provider">JAR file specification</a>.
</p>
</section>
<section id="l10n">
<title>Localization (L10n)</title>
<p>
One goal of the event subsystem was to have localized (translated) event messages.
The <code>EventFormatter</code> class can be used to convert an event to a
human-readable message. Each <code>EventProducer</code> can provide its own XML-based
translation file. If there is none, a central translation file is used, called
"EventFormatter.xml" (found in the same directory as the <code>EventFormatter</code>
class).
</p>
<p>
The XML format used by the <code>EventFormatter</code> is the same as
<a href="ext:cocoon">Apache Cocoon's</a> catalog format. Here's an example:
</p>
<source><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<catalogue xml:lang="en">
<message key="locator">
[ (See position {loc})| (See {#gatherContextInfo})| (No context info available)]
</message>
<message key="org.apache.fop.render.rtf.RTFEventProducer.explicitTableColumnsRequired">
RTF output requires that all table-columns for a table are defined. Output will be incorrect.{{locator}}
</message>
<message key="org.apache.fop.render.rtf.RTFEventProducer.ignoredDeferredEvent">
Ignored deferred event for {node} ({start,if,start,end}).{{locator}}
</message>
</catalogue>
]]></source>
<p>
The example (extracted from the RTF handler's event producer) has message templates for
two event methods. The class used to do variable replacement in the templates is
<code>org.apache.fop.util.text.AdvancedMessageFormat</code> which is more powerful
than the <code>MessageFormat</code> classes provided by the Java class library
(<code>java.util.text</code> package).
</p>
<p>
"locator" is a template that is reused by the other message templates
by referencing it through "{{locator}}". This is some kind of include command.
</p>
<p>
Normal event parameters are accessed by name inside single curly braces, for example:
"{node}". For objects, this format just uses the <code>toString()</code> method to turn
the object into a string, unless there is an <code>ObjectFormatter</code> registered
for that type (there's an example for <code>org.xml.sax.Locator</code>).
</p>
<p>
The single curly braces pattern supports additional features. For example, it is possible
to do this: "{start,if,start,end}". "if" here is a special field modifier that evaluates
"start" as a boolean and if that is true returns the text right after the second comma
("start"). Otherwise it returns the text after the third comma ("end"). The "equals"
modifier is similar to "if" but it takes as an additional (comma-separated) parameter
right after the "equals" modifier, a string that is compared to the value of the variable.
An example: {severity,equals,EventSeverity:FATAL,,some text} (this adds "some text" if
the severity is not FATAL).
</p>
<p>
Additional such modifiers can be added by implementing the
<code>AdvancedMessageFormat$Part</code> and <code>AdvancedMessageFormat$PartFactory</code>
interfaces.
</p>
<p>
Square braces can be used to specify optional template sections. The whole section will
be omitted if any of the variables used within are unavailable. Pipe (|) characters can
be used to specify alternative sub-templates (see "locator" above for an example).
</p>
<p>
Developers can also register a function (in the above example:
<code>{#gatherContextInfo})</code>
to do more complex information rendering. These functions are implementations of the
<code>AdvancedMessageFormat$Function</code> interface. Please take care that this is
done in a locale-independent way as there is no locale information available, yet.
</p>
</section>
</section>
</body>
</document>

+ 340
- 0
src/documentation/content/xdocs/1.0/extensions.xml View File

@@ -0,0 +1,340 @@
<?xml version="1.0" standalone="no"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Standard FOP Extensions</title>
<version>$Revision$</version>
</header>
<body>
<p>
By "extension", we mean any data that can be placed in the input XML document that
is not addressed by the XSL-FO standard.
By having a mechanism for supporting extensions, FOP is able to add features that
are not covered in the specification.
</p>
<p>
The extensions documented here are included with FOP, and are automatically available
to you. If you wish to add an extension of your own to FOP, please see the
<a href="../dev/extensions.html">Developers' Extension Page</a>.
</p>
<note>All extensions require the correct use of an appropriate namespace in your input document.</note>
<section id="svg">
<title>SVG</title>
<p>
Please see the <a href="graphics.html#svg">SVG documentation</a> for more details.
</p>
</section>
<section id="fo-extensions">
<title>FO Extensions</title>
<section id="fox-namespace">
<title>Namespace</title>
<p>
By convention, FO extensions in FOP use the "fox" namespace prefix.
To use any of the FO extensions, add a namespace entry for
<code>http://xmlgraphics.apache.org/fop/extensions</code> to the root element:
</p>
<source><![CDATA[<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:fox="http://xmlgraphics.apache.org/fop/extensions">]]></source>
</section>
<section id="bookmarks">
<title>PDF Bookmarks</title>
<p>
In previous versions of Apache FOP there was a <code>fox:outline</code> element
which was used to create outlines in PDF files. The redesigned code makes use
of the new <a href="http://www.w3.org/TR/xsl11/#fo_bookmark-tree">bookmark feature defined in the latest XSL 1.1 working draft</a>.
</p>
</section>
<section id="named-destinations">
<title>Anchors or Named Destinations</title>
<p>Use the fox:destination element to define "named destinations" inside a PDF document.
These are useful as fragment identifiers, e.g. "http://server/document.pdf#anchor-name".
fox:destination elements can be placed almost anywhere in the fo document, including a child of
root, a block-level element, or an inline-level element.
For the destination to actually work, it must correspond to an "id" attribute on some fo element
within the document. In other words, the "id" attribute actually creates the "view" within the
PDF document. The fox:destination simply gives that view an independent name.
</p>
<source><![CDATA[<fox:destination internal-destination="table-of-contents"/>
...
<fo:block id="table-of-contents">Table of Contents</fo:block>]]></source>
<warning>It is possible that in some future release of FOP, <em>all </em>elements with
"id" attributes will generate named-destinations, which will eliminate the need for
fox:destination.</warning>
</section>
<section id="table-continue-label">
<title>Table Continuation Label</title>
<p>This extension element hasn't been reimplemented for the redesigned code, yet.</p>
<!--p>Use the fox:continued-label element to create content in table-header and
table-footer cells that will appear only on pages after the first page that the table
appears. fox:continued-label is itself inline content, and is a container of fo:inline
content. This content will be laid out only if the table does not fit on a single page and flows
to following pages. Here is an example of FO code creating such a table-header:</p>
<source><![CDATA[<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block>Header column 1 with continued label
<fox:continued-label><fo:inline> (cont.)</fo:inline></fox:continued-label>
</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Header column 2 with no continued label</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>]]></source-->
</section>
<section id="widow-orphan-content-limit">
<title>fox:orphan-content-limit and fox:widow-content-limit</title>
<p>
The two proprietary extension properties, fox:orphan-content-limit and
fox:widow-content-limit, are used to improve the layout of list-blocks and tables.
If you have a table with many entries, you don't want a single row to be left over
on a page. You will want to make sure that at least two or three lines are kept
together. The properties take an absolute length which specifies the area at the
beginning (fox:widow-content-limit) or at the end (fox:orphan-content-limit) of a
table or list-block. The properties are inherited and only have an effect on fo:table
and fo:list-block. An example: fox:widow-content-limit="3 * 1.2em" would make sure
the you'll have at least three lines (assuming line-height="1.2") together on a table
or list-block.
</p>
</section>
<section id="external-document">
<title>fox:external-document</title>
<note>
This feature is incomplete. Support for multi-page documents will be added shortly.
At the moment, only single-page images will work. And this will not work with RTF output.
</note>
<p>
This is a proprietary extension element which allows to add whole images as pages to
an FO document. For example, if you have a scanned document or a fax as multi-page TIFF
file, you can append or insert this document using the <code>fox:external-document</code>
element. Each page of the external document will create one full page in the target
format.
</p>
<p>
The <code>fox:external-document</code> element is structurally a peer to
<code>fo:page-sequence</code>, so wherever you can put an <code>fo:page-sequence</code>
you could also place a <code>fox:external-document</code>.
Therefore, the specified contents for <code>fo:root</code> change to:
</p>
<p>
<code>
(layout-master-set, declarations?, bookmark-tree?, (page-sequence|page-sequence-wrapper|fox:external-document|fox:destination)+)
</code>
</p>
<section>
<title>Specification</title>
<p>
The <code>fox:external-document</code> extension formatting object is used to specify
how to create a (sub-)sequence of pages within a document. The content of these pages
comes from the individual subimages/pages of an image or paged document (for example:
multi-page TIFF in the form of faxes or scanned documents, or PDF files). The
formatting object creates the necessary areas to display one image per page.
</p>
<p>
In terms of page numbers, the behaviour is the same as for
<code>fo:page-sequence</code>. The placement of the image inside the page is similar
to that of <code>fo:external-graphic</code> or <code>fo:instream-foreign-object</code>,
i.e. the viewport (and therefore the page size) is defined by either the intrinsic
size of the image or by the size properties that apply to this formatting object.
</p>
<p>Content: EMPTY</p>
<p>The following properties apply to this formatting object:</p>
<ul>
<li>(Common Accessibility Properties) (not implemented, yet)</li>
<li>(Common Aural Properties) (not implemented, yet)</li>
<li>block-progression-dimension</li>
<li>content-height</li>
<li>content-type</li>
<li>content-width</li>
<li>display-align</li>
<li>height</li>
<li>id</li>
<li>inline-progression-dimension</li>
<li>overflow</li>
<li>pages: &lt;page-set&gt; (see below) (not implemented, yet)</li>
<li>reference-orientation</li>
<li>scaling</li>
<li>scaling-method</li>
<li>src</li>
<li>text-align</li>
<li>width</li>
</ul>
<p>
Datatype "page-set": Value: auto | &lt;integer-range&gt;,
Default: "auto" which means all pages/subimages of the document.
&lt;integer-range&gt; allows values such as "7" or "1-3"
</p>
<note>
<code>fox:external-document</code> is not suitable for concatenating FO documents.
For this, XInclude is recommended.
</note>
</section>
</section>
<section id="transform">
<title>Free-form Transformation for fo:block-container</title>
<p>
For <code>fo:block-container</code> elements whose <code>absolute-position</code> set to
"absolute" or "fixed" you can use the extension attribute <code>fox:transform</code>
to apply a free-form transformation to the whole block-container. The content of the
<code>fox:transform</code> attribute is the same as for
<a href="http://www.w3.org/TR/SVG/coords.html#TransformAttribute">SVG's transform attribute</a>.
The transformation specified here is performed in addition to other implicit
transformations of the block-container (resulting from top, left and other properties)
and after them.
</p>
<p>
Examples: <code>fox:transform="rotate(45)"</code> would rotate the block-container
by 45 degrees clock-wise around its upper-left corner.
<code>fox:transform="translate(10000,0)"</code> would move the block-container to the
right by 10 points (=10000 millipoints, FOP uses millipoints internally!).
</p>
<note>
This extension attribute doesn't work for all output formats! It's currently only
supported for PDF, PS and Java2D-based renderers.
</note>
</section>
<section id="color-functions">
<title>Color functions</title>
<p>
XSL-FO supports specifying color using the rgb(), rgb-icc() and system-color() functions.
Apache FOP provides additional color functions for special use cases. Please note that
using these functions compromises the interoperability of an FO document.
</p>
<section id="color-function-cmyk">
<title>cmyk()</title>
<p><code>color cmyk(numeric, numeric, numeric, numeric)</code></p>
<p>
This function will construct a color in device-specific CMYK color space. The numbers
must be between 0.0 and 1.0. For output formats that don't support device-specific
color space the CMYK value is converted to an sRGB value.
</p>
</section>
<section id="pseudo-color-profiles">
<title>#CMYK pseudo-profile</title>
<p><code>color rgb-icc(numeric, numeric, numeric, #CMYK, numeric, numeric, numeric, numeric)</code></p>
<p>
The <code>rgb-icc</code> function will respond to a pseudo-profile called "#CMYK"
which indicates a device-specific CMYK color space. The "#CMYK" profile is implicitely
available and doesn't have to be (and cannot be) defined through an
<code>fo:color-profile</code> element. It is provided for compatibility with certain
commercial XSL-FO implementations. Please note that this is not part of the official
specification but rather a convention. The following two color specifications are
equivalent:
</p>
<ul>
<li><code>cmyk(0%,0%,20%,40%)</code></li>
<li><code>rgb-icc(153, 153, 102, #CMYK, 0, 0, 0.2, 0.4)</code></li>
</ul>
</section>
</section>
<section id="prepress">
<title>Prepress Support</title>
<p>
This section defines a number of extensions related to
<a href="http://en.wikipedia.org/wiki/Prepress">prepress</a> support.
<code>fox:scale</code> defines a general scale factor for the generated pages.
<code>fox:bleed</code> defines the
<a href="http://en.wikipedia.org/wiki/Bleed_%28printing%29">bleed area</a> for a page.
<code>fox:crop-offset</code> defines the outer edges of the area in which crop marks,
registration marks, color bars and page information are placed.
For details, please read on below.
</p>
<note>
Those extensions have been implemented in the PDF and Java2D renderers only.
</note>
<section id="scale">
<title>fox:scale</title>
<p>Value: &lt;number&gt;{1,2}</p>
<p>Initial: 1</p>
<p>Applies to: fo:simple-page-master</p>
<p>
This property specifies a scale factor along resp. the x and y axes. If only one number
is provided it is used for both the x and y scales. A scale factor smaller than 1
shrinks the page. A scale factor greater than 1 enlarges the page.
</p>
</section>
<section id="bleed">
<title>fox:bleed</title>
<p>
Value: &lt;length&gt;{1,4}
</p>
<p>
Initial: 0pt
</p>
<p>Applies to: fo:simple-page-master</p>
<p>
If there is only one value, it applies to all sides. If there are two values, the top and bottom
bleed widths are set to the first value and the right and left bleed widths are set to the second.
If there are three values, the top is set to the first value, the left and right are set to the second,
and the bottom is set to the third. If there are four values, they apply to the top, right, bottom, and
left, respectively.
(Corresponds to <a href="http://www.w3.org/TR/xsl11/#padding">the definition of
padding</a>).
</p>
<p>
This extension indirectly defines the BleedBox and is calculated by expanding the TrimBox by
the bleed widths. The lengths must be non-negative.
</p>
</section>
<section id="cropOffset">
<title>fox:crop-offset</title>
<p>
Value: &lt;length&gt;{1,4}
</p>
<p>
Initial: bleed (see below)
</p>
<p>Applies to: fo:simple-page-master</p>
<p>
Same behaviour as with fox:bleed. The initial value is set to the same values as the
fox:bleed property.
</p>
<p>
This extension indirectly defines the MediaBox and is calculated by expanding
the TrimBox by the crop offsets. The lengths must be non-negative.
</p>
</section>
<section id="cropBox">
<title>fox:crop-box</title>
<p>
Value: [trim-box | bleed-box | media-box]
</p>
<p>
Initial: media-box
</p>
<p>Applies to: fo:simple-page-master</p>
<p>
The crop box controls how Acrobat displays the page (CropBox in PDF) or how the Java2DRenderer sizes
the output media. The PDF specification defines that the CropBox defaults to the MediaBox. This extension
follows that definition. To simplify usage and cover most use cases, the three supported enumeration
values "trim-box", "bleed-box" and "media-box" set the CropBox to one of those three other boxes.
</p>
<p>
If requested in the future, we could offer to specify the CropBox in absolute coordinates rather
than just by referencing another box.
</p>
</section>
</section>
</section>
</body>
</document>


+ 564
- 0
src/documentation/content/xdocs/1.0/fonts.xml View File

@@ -0,0 +1,564 @@
<?xml version="1.0" standalone="no"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Apache FOP: Fonts</title>
<version>$Revision$</version>
<authors>
<person name="Jeremias M&#xE4;rki" email=""/>
<person name="Tore Engvig" email=""/>
<person name="Adrian Cumiskey" email=""/>
<person name="Max Berger" email=""/>
</authors>
</header>
<body>
<section id="intro">
<title>Summary</title>
<p>The following table summarizes the font capabilities of the various FOP renderers:</p>
<table>
<tr>
<th>Renderer</th>
<th>Base-14</th>
<th>AWT/OS</th>
<th>Custom</th>
<th>Custom Embedding</th>
</tr>
<tr>
<td>PDF</td>
<td>yes</td>
<td>no</td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td>PostScript</td>
<td>yes</td>
<td>no</td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td>PCL</td>
<td>yes (modified)</td>
<td>yes (painted as bitmaps)</td>
<td>yes (painted as bitmaps)</td>
<td>no</td>
</tr>
<tr>
<td>AFP</td>
<td>no</td>
<td>no</td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td>Java2D/AWT/Bitmap</td>
<td>if available from OS</td>
<td>yes</td>
<td>yes</td>
<td>n/a (display only)</td>
</tr>
<tr>
<td>Print</td>
<td>if available from OS</td>
<td>yes</td>
<td>yes</td>
<td>controlled by OS printer driver</td>
</tr>
<tr>
<td>RTF</td>
<td>n/a (font metrics not needed)</td>
<td>n/a</td>
<td>n/a</td>
<td>n/a</td>
</tr>
<tr>
<td>TXT</td>
<td>yes (used for layout but not for output)</td>
<td>no</td>
<td>yes (used for layout but not for output)</td>
<td>no</td>
</tr>
<!--tr> NOT AVAILABLE
<td>MIF</td>
<td>n/a (font metrics not needed)</td>
<td>n/a</td>
<td>n/a</td>
<td>n/a</td>
</tr-->
<!--tr> NOT AVAILABLE
<td>SVG</td>
<td>if available from OS</td>
<td>yes</td>
<td>no</td>
<td>no</td>
</tr-->
<tr>
<td>XML</td>
<td>yes</td>
<td>no</td>
<td>yes</td>
<td>n/a</td>
</tr>
</table>
</section>
<section>
<title>Base-14 Fonts</title>
<p>
The Adobe PostScript and PDF Specification specify a set of 14 fonts that must be
available to every PostScript interpreter and PDF reader:
Helvetica (normal, bold, italic, bold italic),
Times (normal, bold, italic, bold italic),
Courier (normal, bold, italic, bold italic),
Symbol and ZapfDingbats.
</p>
<p>
The following font family names are hard-coded into FOP for the Base-14 font set:
</p>
<table>
<tr>
<th>Base-14 font</th>
<th>font families</th>
</tr>
<tr>
<td>Helvetica</td>
<td>Helvetica, sans-serif, SansSerif</td>
</tr>
<tr>
<td>Times</td>
<td>Times, Times Roman, Times-Roman, serif, any</td>
</tr>
<tr>
<td>Courier</td>
<td>Courier, monospace, Monospaced</td>
</tr>
<tr>
<td>Symbol</td>
<td>Symbol</td>
</tr>
<tr>
<td>ZapfDingbats</td>
<td>ZapfDingbats</td>
</tr>
</table>
<p>
Please note that recent versions of Adobe Acrobat Reader replace
"Helvetica" with "Arial" and "Times" with "Times New Roman" internally.
GhostScript replaces "Helvetica" with "Nimbus Sans L" and "Times" with
"Nimbus Roman No9 L". Other document viewers may do similar font
substitutions. If you need to make sure that there are no such
substitutions, you need to specify an explicit font and embed it in
the target document.
</p>
</section>
<section id="missing-fonts">
<title>Missing Fonts</title>
<p>
When FOP does not have a specific font at its disposal (because it's
not installed in the operating system or set up in FOP's configuration),
the font is replaced with "any". "any" is internally mapped to the
Base-14 font "Times" (see above).
</p>
</section>
<section id="missing-glyphs">
<title>Missing Glyphs</title>
<p>
Every font contains a particular set of
<a href="http://en.wikipedia.org/wiki/Glyph">glyphs</a>. If no glyph can be found for
a given character, FOP will issue a warning and use the glpyh for "#" (if available)
instead. Before it does that, it consults a (currently hard-coded) registry of
glyph substitution groups (see Glyphs.java in Apache XML Graphics Commons).
This registry can supply alternative glyphs in some cases (like using space when a no-break
space is requested). But there's no guarantee that the result will be as expected (for
example, in the case of hyphens and similar glyphs). A better way is to use a font that
has all the necessary glyphs. This glyph substitution is only a last resort.
</p>
</section>
<section id="awt">
<title>Java2D/AWT/Operating System Fonts</title>
<p>
The Java2D family of renderers (Java2D, AWT, Print, TIFF, PNG), use the
Java AWT subsystem for font metric information. Through operating system
registration, the AWT subsystem knows what fonts are available on the system,
and the font metrics for each one.
</p>
<p>
When working with one of these output formats and you're missing a font, just
install it in your operating system and they should be available for these
renderers. Please note that this is not true for other output formats such as
PDF or PostScript.
</p>
</section>
<section id="custom">
<title>Custom Fonts</title>
<p>
Support for custom fonts is highly output format dependent (see above table).
This section shows how to add Type 1 and TrueType fonts to the PDF, PostScript and
Java2D-based renderers. Other renderers (like AFP) support other font formats. Details
in this case can be found on the page about <a href="output.html">output formats</a>.
</p>
<p>
In earlier FOP versions, it was always necessary to create an XML font metrics file
if you wanted to add a custom font. This unconvenient step has been removed and in
addition to that, FOP supports auto-registration of fonts, i.e. FOP can find fonts
installed in your operating system or can scan user-specified directories for fonts.
Font registration via XML font metrics file is still supported and may still be necessary
for some very special cases as fallback variant while we stabilize font auto-detection.
</p>
<p>
Basic information about fonts can be found at:
</p>
<ul>
<li>
<a href="http://partners.adobe.com/asn/developer/type/ftypes.html">Adobe font types</a>
</li>
<li>
<a href="http://partners.adobe.com/asn/developer/technotes/fonts.html">Adobe Font Technote</a>
</li>
</ul>
</section>
<section id="basics">
<title>Basic font configuration</title>
<p>
If you want FOP to use custom fonts, you need to tell it where to find them. This
is done in the configuration file and once per renderer (because each output format
is a little different). In the basic form, you can either tell FOP to find your
operating system fonts or you can specify directories that it will search for
support fonts. These fonts will then automatically be registered.
</p>
<source><![CDATA[
<renderers>
<renderer mime="application/pdf">
<fonts>
<!-- register all the fonts found in a directory -->
<directory>C:\MyFonts1</directory>
<!-- register all the fonts found in a directory and all of its sub directories (use with care) -->
<directory recursive="true">C:\MyFonts2</directory>

<!-- automatically detect operating system installed fonts -->
<auto-detect/>
</fonts>
</renderer>
</renderers>]]></source>
<note>
Review the documentation for <a href="configuration.html">FOP Configuration</a>
for instructions on making the FOP configuration available to FOP when it runs.
Otherwise, FOP has no way of finding your custom font information. It is currently
not possible to easily configure fonts from Java code.
</note>
</section>
<section id="advanced">
<title>Advanced font configuration</title>
<p>
The instructions found above should be sufficient for most users. Below are some
additional instructions in case the basic font configuration doesn't lead to
the desired results.
</p>
<section id="type1-metrics">
<title>Type 1 Font Metrics</title>
<p>FOP includes PFMReader, which reads the PFM file that normally comes with a Type 1 font, and generates an appropriate font metrics file for it.
To use it, run the class org.apache.fop.fonts.apps.PFMReader:</p>
<p>Windows:</p>
<source>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</source>
<p>Unix:</p>
<source>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</source>
<p>PFMReader [options]:</p>
<ul>
<li><strong>-fn &lt;fontname&gt;</strong> 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.</li>
</ul>
<note>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.</note>
<note>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.</note>
</section>
<section id="truetype-metrics">
<title>TrueType Font Metrics</title>
<p>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:</p>
<source>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</source>
<p>TTFReader [options]:</p>
<ul>
<li><strong>-d &lt;DEBUG | INFO &gt;</strong> Sets the debug level (default is
INFO).</li>
<li><strong>-fn &lt;fontname&gt;</strong> Same as for PFMReader.</li>
<li><strong>-ttcname &lt;fontname&gt;</strong> 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.</li>
<li><strong>-enc ansi</strong> 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:</li>
</ul>
<table id="ttf-encoding">
<tr>
<th>Issue</th>
<th>WinAnsi</th>
<th>CID-keyed</th>
</tr>
<tr>
<td>Usable Character Set</td>
<td>Limited to WinAnsi character set, which is roughly equivalent to iso-8889-1.</td>
<td>Limited only by the characters in the font itself.</td>
</tr>
<tr>
<td>Embedding the Font</td>
<td>Optional.</td>
<td>Mandatory. Not embedding the font produces invalid PDF documents.</td>
</tr>
</table>
<warning>
You may experience failures with certain TrueType fonts, especially if they don't contain
the so-called Unicode "cmap" table. TTFReader can currently not deal with font like this.
</warning>
</section>
<section id="truetype-collections-metrics">
<title>TrueType Collections</title>
<p>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.</p>
<p>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.</p>
<p>Here is an example of generating a metrics file for a .ttc file:</p>
<source>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</source>
<p>
Alternatively, the individual sub-fonts of a TrueType Collections can be selected
using the "sub-font" attribute on the "font" element. That means that generating
an XML font metrics file for TrueType collections is not necessary anymore. Example:
</p>
<source><![CDATA[<font embed-url="gulim.ttc" sub-font="GulimChe">
<font-triplet name="GulimChe" style="normal" weight="normal"/>
</font>]]></source>
</section>
<section id="register">
<title>Register Fonts with FOP</title>
<p>You must tell FOP how to find and use the font metrics files by registering them in the <a href="configuration.html">FOP Configuration</a>. Add entries for your custom fonts, regardless of font type, to the configuration file in a manner similar to the following:</p>
<source><![CDATA[
<renderers>
<renderer mime="application/pdf">
<fonts>
<!-- register a particular font -->
<font metrics-url="file:///C:/myfonts/FTL_____.xml" kerning="yes"
embed-url="file:///C:/myfonts/FTL_____.pfb"
encoding-mode="single-byte">
<font-triplet name="FrutigerLight" style="normal" weight="normal"/>
</font>
<!-- register all the fonts found in a directory -->
<directory>C:\MyFonts1</directory>
<!-- register all the fonts found in a directory and all of its sub directories (use with care) -->
<directory recursive="true">C:\MyFonts2</directory>

<!-- automatically detect operating system installed fonts -->
<auto-detect/>
</fonts>
</renderer>
</renderers>]]></source>
<ul>
<li>
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 <a href="configuration.html">FOP: Configuration</a> for more information.
</li>
<li>The "metrics-url" attribute is generally not necessary except if you run into problems with certain fonts.</li>
<li>Either an "embed-url" or a "metrics-url" must be specified for font tag configurations.</li>
<li>The font "kerning" attribute is optional. Default is "true".</li>
<li>If embedding is off (i.e. embed-url is not set), 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.</li>
<li>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.</li>
<li>The attribute "encoding-mode" is optional an may have the following values:
<ul>
<li>auto: default font encoding mode ("cid" for Truetype, "single-byte" for Type 1)</li>
<li>single-byte: use single-byte encodings in the target format (if applicable)</li>
<li>cid: encode as CID-keyed font (currently only supported for PDF output with TrueType fonts)</li>
</ul>
</li>
<li>The fonts "directory" tag can be used to register fonts contained within a single or list of directory paths. The "recursive" attribute can be specified to recursively add fonts from all sub directories.</li>
<li>The fonts "auto-detect" tag can be used to automatically register fonts that are found to be installed on the native operating system.</li>
<li>Fonts registered with "font" tag configurations override fonts found by means of "directory" tag definitions.</li>
<li>Fonts found as a result of a "directory" tag configuration override fonts found as a result of the "auto-detect" tag being specified.</li>
<li>
If relative URLs are specified, they are evaluated relative to the value of the
"font-base" setting. If there is no "font-base" setting, the fonts are evaluated
relative to the base directory.
</li>
</ul>
<!--note>Cocoon users will need to setup the config, see FOPSerializer for more information.</note-->
</section>
<section id="autodetect">
<title>Auto-Detect and auto-embed feature</title>
<p>When the "auto-detect" flag is set in the configuration, FOP will automatically search for fonts in the default paths for your operating system.</p>
<p>FOP will also auto-detect fonts which are available in the classpath, if they are described as "application/x-font" in the MANIFEST.MF file. For example, if your .jar file contains font/myfont.ttf:</p>
<source>Manifest-Version: 1.0
Name: font/myfont.ttf
Content-Type: application/x-font</source>
<p>This feature allows you to create JAR files containing fonts. The JAR files can be added to fop by providem them in the classpath, e.g. copying them into the lib/ directory.</p>
</section>
<section id="embedding">
<title>Embedding</title>
<p>
By default, all fonts are embedded if an output format supports font embedding. In some
cases, however, it is preferred that some fonts are only referenced. When working
with referenced fonts it is important to be in control of the target environment where
the produced document is consumed, i.e. the necessary fonts have to be installed there.
</p>
<p>
There are two different ways how you can specify that a font should be referenced:
</p>
<ol>
<li>
When using the old-style "font" element to configure a single font, font referencing
is 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.
</li>
<li>
For automatically configured fonts there's a different mechanism to specify which
fonts should be referenced rather than embedded. This is done in the "referenced-fonts"
element in the configuration. Here's an example:
</li>
</ol>
<source><![CDATA[
<fop version="1.0">
<fonts>
<referenced-fonts>
<match font-family="Helvetica"/>
<match font-family="DejaVu.*"/>
</referenced-fonts>
</fonts>
</fop>]]></source>
<p>
At the moment, you can only match fonts against their font-family. It is possible to use
regular expressions as is shown in the second example above ("DejaVu.*"). The syntax for
the regular expressions used here are the one used by the
<a href="http://java.sun.com/j2se/1.4/docs/api/java/util/regex/package-summary.html"><code>java.util.regex</code> package</a>.
So, in the above snippet "Helvetica" and all variants of the "DejaVu" font family are
referenced. If you want to reference all fonts, just specify <code>font-family=".*"</code>.
</p>
<p>
The <code>referenced-fonts</code> element can be placed either inside the general
<code>fonts</code> element (right under the root) or in the <code>fonts</code> element
under the renderer configuration. In the first case, matches apply to all renderers.
In the second case, matches only apply to the renderer where the element was specified.
Both cases can be used at the same time.
</p>
<p>
Various notes related to embedded fonts:
</p>
<ul>
<li>The PostScript renderer does not yet support TrueType fonts, but can embed Type 1 fonts.</li>
<li>The font is simply embedded into the PDF file, it is not converted.</li>
<li>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.</li>
<li>When embedding PostScript fonts, the entire font is always embedded.</li>
<li>When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a subset of the
original font, containing only the glyphs used, is embedded in the output document.
That's the default, but if you specify encoding-mode="single-byte" (see above), the
complete font is embedded.</li>
</ul>
</section>
<section id="substitution">
<title>Substitution</title>
<p>When a &lt;substitutions/&gt; section is defined in the configuration, FOP will re-map any font-family references found in your FO input to a given substitution font.</p>
<ul>
<li>If a &lt;substitution/&gt; is declared, it is mandatory that both a &lt;from/&gt; and &lt;to/&gt; child element is declared with a font-family attribute.</li>
<li>Both font-weight and font-style are optional attributes, if they are provided then a value of 'normal' is assumed.</li>
</ul>
<p>For example you could make all FO font-family references to 'Arial' with weights between 700 and 900 reference the normal 'Arial Black' font.</p>
<source><![CDATA[
<fop version="1.0">
<fonts>
<substitutions>
<substitution>
<from font-family="Arial" font-weight="700..900"/>
<to font-family="Arial Black"/>
</substitution>
<substitution>
<from font-family="FrutigerLight"/>
<to font-family="Times" font-weight="bold" font-style="italic"/>
</substitution>
</substitutions>
</fonts>
</fop>]]></source>
</section>
<!-- The following section should no longer be required
<section id="embedding-base14">
<title>Explicitly embedding the base 14 fonts</title>
<p>
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
<a href="pdfa.html">PDF/A</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.
</p>
<p>Example:</p>
<source><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<font-metrics type="TYPE1">
<font-name>Symbol</font-name>
<embed/>
<encoding>SymbolEncoding</encoding>
<cap-height>673</cap-height>
<x-height>766</x-height>
[..]]]></source>
</section-->
</section>
<section id="selection">
<title>Font Selection Strategies</title>
<p>
There are two font selection strategies: character-by-character or auto. The default is auto.</p>
<p>Auto selected the first font from the list which is able to display the most characters in a given word. This means (assume font A has characters for abclmn, font B for lnmxyz, fontlist is A,B):</p>
<ul>
<li>aaa lll xxx would be displayed in fonts A A B</li>
<li>aaaxx would be displayed in font A</li>
<li>aaaxxx would be displayed in font A</li>
<li>aaaxxxx would be displayed in font B</li>
</ul>
<p>Character-by-Character is NOT yet supported!</p>
</section>
<section id="font-list">
<title>Font List Command-Line Tool</title>
<p>
FOP contains a small command-line tool that lets you generate a list of all configured
fonts. Its class name is: <code>org.apache.fop.tools.fontlist.FontListMain</code>.
Run it with the "-?" parameter to get help for the various options.
</p>
</section>
</body>
</document>

src/documentation/content/xdocs/0.94/fotree/disabled-testcases.xml → src/documentation/content/xdocs/1.0/fotree/disabled-testcases.xml View File


+ 590
- 0
src/documentation/content/xdocs/1.0/graphics.xml View File

@@ -0,0 +1,590 @@
<?xml version="1.0" standalone="no"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Apache FOP: Graphics Formats</title>
<version>$Revision$</version>
</header>
<body>
<section id="introduction">
<title>Introduction</title>
<p>
Some noteworthy features of the image handling subsystem are:
</p>
<ul>
<li>
The image libraries Jimi and JAI are not supported. Instead, Apache FOP uses the
Image I/O API that was introduced with Java 1.4 for all bitmap codecs.
</li>
<li>
Some bitmap images are not converted to a standardized 24 bit RGB image but are
instead handled in their native format.
</li>
<li>
A plug-in mechanism offers a possibility to add support for new formats without changing
the FOP's source code.
</li>
</ul>
<p>
The actual <a href="http://xmlgraphics.apache.org/commons/image-loader.html">image loading framework</a>
does not reside in Apache FOP, but in
<a href="ext:xmlgraphics.apache.org/commons/">XML Graphics Commons</a>.
</p>
</section>
<section id="support-overview">
<title>Overview of Graphics Support</title>
<p>
The table below summarizes the <em>theoretical</em> support for graphical formats
within FOP. In other words, within the constraints of the limitations listed here,
these formats <em>should</em> work. However, many of them have not been tested,
and there may be limitations that have not yet been discovered or documented.
The packages needed to support some formats are not included in the FOP distribution
and must be installed separately. Follow the links in the "Support Through" columns
for more details.
</p>
<table>
<tr>
<th rowspan="2">Format</th>
<th rowspan="2">Type</th>
<th colspan="3">Support Through</th>
</tr>
<tr>
<th><a href="#native">Apache FOP (native)</a></th>
<th><a href="#batik">Apache Batik</a></th>
<th><a href="#imageio">Image I/O</a></th>
</tr>
<tr>
<td><a href="#bmp">BMP</a> (Microsoft Windows Bitmap)</td>
<td>bitmap</td>
<td></td>
<td></td>
<td>X [1]</td>
</tr>
<tr>
<td><a href="#emf">EMF</a> (Windows Enhanced Metafile)</td>
<td>vector (with embedded bitmaps)</td>
<td>(X)</td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="#eps">EPS</a> (Encapsulated PostScript)</td>
<td>metafile (both bitmap and vector), most frequently used for vector drawings</td>
<td>(X)</td>
<td></td>
<td></td>
</tr>
<tr>
<td>GIF (Graphics Interchange Format)</td>
<td>bitmap</td>
<td></td>
<td></td>
<td>X</td>
</tr>
<tr>
<td><a href="#jpeg">JPEG</a> (Joint Photographic Experts Group)</td>
<td>bitmap</td>
<td>(X)</td>
<td></td>
<td>X</td>
</tr>
<tr>
<td><a href="#png">PNG</a> (Portable Network Graphic)</td>
<td>bitmap</td>
<td></td>
<td></td>
<td>X</td>
</tr>
<tr>
<td><a href="#svg">SVG</a> (Scalable Vector Graphics)</td>
<td>vector (with embedded bitmaps)</td>
<td></td>
<td>X</td>
<td></td>
</tr>
<tr>
<td><a href="#tiff">TIFF</a> (Tag Image Format File)</td>
<td>bitmap</td>
<td>(X)</td>
<td></td>
<td>X [1]</td>
</tr>
<tr>
<td><a href="#wmf">WMF</a> (Windows Metafile)</td>
<td>vector (with embedded bitmaps)</td>
<td></td>
<td>(X)</td>
<td></td>
</tr>
</table>
<p>
Legend:
</p>
<ul>
<li>"(X)" means restricted support. Please see the details below.</li>
<li>
[1]: Requires the presence of <a href="http://jai-imageio.dev.java.net/">JAI Image I/O Tools</a>
(or an equivalent Image I/O compatible codec) in the classpath. JAI Image I/O Tools also
adds support for JPEG 2000, WBMP, RAW and PNM. Other Image I/O codecs may provide
support for additional formats.
</li>
</ul>
<note>
<a href="http://jai-imageio.dev.java.net/">JAI Image I/O Tools</a> is not the same as the
<a href="http://java.sun.com/javase/technologies/desktop/media/jai/">JAI library</a>! The
former simply exposes JAI's codecs using the Image&nbsp;I/O API but does not include all
the image manipulation functionality.
</note>
<section id="format-map">
<title>Map of supported image formats by output format</title>
<p>
Not all image formats are supported for all output formats! For example, while you can
use EPS (Encapsulated PostScript) files when you generate PostScript output, this format
will not be supported by any other output format. Here's an overview of which image
formats are supported by which output format:
</p>
<table>
<tr>
<th>Image Format</th>
<th>PDF</th>
<th>PostScript</th>
<th>Java2D, PNG, TIFF, AWT</th>
<th>PCL</th>
<th>AFP</th>
<th>RTF</th>
</tr>
<tr>
<td><a href="#bmp">BMP</a> (Microsoft Windows Bitmap)</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td><a href="#emf">EMF</a> (Windows Enhanced Metafile)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>X [1]</td>
</tr>
<tr>
<td><a href="#eps">EPS</a> (Encapsulated PostScript)</td>
<td></td>
<td>X [1]</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>GIF (Graphics Interchange Format)</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td><a href="#jpeg">JPEG</a> (Joint Photographic Experts Group)</td>
<td>X [1]</td>
<td>X [1]</td>
<td>X</td>
<td>X</td>
<td>X [1]</td>
<td>X</td>
</tr>
<tr>
<td><a href="#png">PNG</a> (Portable Network Graphic)</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td><a href="#svg">SVG</a> (Scalable Vector Graphics)</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td><a href="#tiff">TIFF</a> (Tag Image Format File)</td>
<td>X [2]</td>
<td>X [2]</td>
<td>X</td>
<td>X</td>
<td>X [2]</td>
<td>X</td>
</tr>
<tr>
<td><a href="#wmf">WMF</a> (Windows Metafile)</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>X</td>
</tr>
</table>
<p>
Legend:
</p>
<ul>
<li>
[1]: Supported without the need to decode the image.
</li>
<li>
[2]: Supported without the need to decode the image, but only for certain subtypes.
</li>
</ul>
</section>
</section>
<section id="packages">
<title>Graphics Packages</title>
<section id="native">
<title>XML Graphics Commons Native</title>
<p>
<a href="ext:xmlgraphics.apache.org/commons">XML Graphics Commons</a> supports a number
of graphic file formats natively as basic functionality: all bitmap formats for which
there are Image I/O codecs available (JPEG, PNG, GIF, TIFF, etc.), EPS and EMF.
</p>
</section>
<section id="fop-native">
<title>FOP Native</title>
<p>
FOP has no native image plug-ins for the image loading framework of its own but currently
hosts the Batik-dependent SVG and WMF plug-ins until they can be moved to
<a href="ext:xmlgraphics.apache.org/batik">Apache Batik</a>.
</p>
</section>
<section id="batik">
<title>Apache Batik</title>
<p>
<a href="ext:xmlgraphics.apache.org/batik">Apache Batik</a> will later receive the
SVG and WMF plug-ins for the image loading framework that are currently hosted inside
FOP.
</p>
<p>
Current FOP distributions include a distribution of the
<a class="fork" href="ext:xmlgraphics.apache.org/batik">Apache Batik</a>.
Because Batik's API changes frequently, it is highly recommended that you use the
version that ships with FOP, at least when running FOP.
</p>
<warning>Batik must be run in a graphical environment.</warning>
<p>
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.
</p>
<p>Here are some workarounds:</p>
<ul>
<li>
Start Java with the <code>-Djava.awt.headless=true</code> command line option.
</li>
<li>
Install an X server which provides an in-memory framebuffer without actually using a
screen device or any display hardware. One example is Xvfb.
</li>
<li>
Install a toolkit which emulates AWT without the need for an underlying X server. One
example is the <a href="http://www.eteks.com/pja/en">PJA toolkit</a>, which is free
and comes with detailed installation instructions.
</li>
</ul>
</section>
<section id="imageio">
<title>Image I/O</title>
<p>
The image loading framework in <a href="ext:xmlgraphics.apache.org/commons">XML Graphics Commons</a>
provides a wrapper to load images through the
<a class="fork" href="http://java.sun.com/j2se/1.4.2/docs/guide/imageio/index.html">JDK's Image I/O API</a> (JSR 015).
Image I/O allows to dynamically add additional image codecs. An example of such an
add-on library are the
<a class="fork" href="http://java.sun.com/products/java-media/jai/">JAI Image I/O Tools</a>
available from Sun.
</p>
</section>
</section>
<section id="image-formats">
<title>Details on image formats</title>
<section id="bmp">
<title>BMP</title>
<p>
BMP images are supported through an Image I/O codec. There may be limitations of the
codec which are outside the control of Apache FOP.
</p>
</section>
<section id="emf">
<title>EMF</title>
<p>
Windows Enhanced Metafiles (EMF) are only supported in RTF output where they are
embedded without decoding.
</p>
</section>
<section id="eps">
<title>EPS</title>
<p>Apache FOP allows to use EPS files when generating PostScript output only.</p>
<p>
Other output targets can't be supported at the moment because
FOP lacks a PostScript interpreter. Furthermore, FOP is currently not able
to parse the preview bitmaps sometimes contained in EPS files.
</p>
</section>
<section id="gif">
<title>GIF</title>
<p>
GIF images are supported through an Image&nbsp;I/O codec. Transparency is supported but
not guaranteed to work with every output format.
</p>
</section>
<section id="jpeg">
<title>JPEG</title>
<p>
FOP native support (i.e. the handling of undecoded images) of JPEG does not include all
variants, especially those containing unusual color lookup tables and color profiles.
If you have trouble with a JPEG image in FOP, try opening it with an image processing
program (such as Photoshop or Gimp) and then saving it. Specifying 24-bit color output
may also help. For the PDF and PostScript renderers most JPEG images can be passed
through without decompression. User reports indicate that grayscale, RGB, and
CMYK color spaces are all rendered properly. However, for other output formats, the
JPEG images have to be decompressed. Tests have shown that there are some limitation
in some Image&nbsp;I/O codecs concerning images in the CMYK color space. Work-arounds are
in place but may not always work as expected.
</p>
</section>
<section id="png">
<title>PNG</title>
<p>
PNG images are supported through an Image&nbsp;I/O codec. Transparency is supported but
not guaranteed to work with every output format.
</p>
</section>
<section id="svg">
<title>SVG</title>
<section id="svg-intro">
<title>Introduction</title>
<p>FOP uses <a href="#batik"> Apache Batik</a> for SVG support.
This format can be handled as an <code>fo:instream-foreign-object</code> or in a separate
file referenced with <code>fo:external-graphic</code>.</p>
<note>
Batik's SVG Rasterizer utility may also be used to convert standalone SVG
documents into PDF. For more information please see the
<a href="http://xmlgraphics.apache.org/batik/svgrasterizer.html">SVG Rasterizer documentation</a>
on the Batik site.
</note>
</section>
<section id="svg-pdf-graphics">
<title>Placing SVG Graphics into PDF</title>
<p>
The SVG is rendered into PDF by using PDF commands to draw and fill
lines and curves. This means that the graphical objects created with
this remain as vector graphics. The same applies to PostScript output.
For other output formats the SVG graphic may be converted to a bitmap
image.
</p>
<p>
There are a number of SVG things that cannot be converted directly into
PDF. Parts of the graphic such as effects, patterns and images are inserted
into the PDF as a raster graphic. The resolution of these raster images can
be controlled through the "target resolution" setting in the
<a href="configuration.html">configuration</a>.</p>
<p>
Currently transparency is limited in PDF so some SVG images that
contain effects or graphics with transparent areas may not be displayed
correctly.
</p>
</section>
<section id="svg-pdf-text">
<title>Placing SVG Text into PDF and PostScript</title>
<p>If possible, Batik will use normal PDF or PostScript text when inserting text. It does
this by checking if the text can be drawn normally and the font is
supported. This example svg <a href="../dev/svg/text.svg">text.svg</a> /
<a href="../dev/svg/text.pdf">text.pdf</a> / <a href="../dev/svg/text.png">text.png</a>
shows how various types and effects with text are handled.
Note that SVG font support is not yet implemented. Furthermore, text handling in
PostScript output is inferior to PDF output - more text will be painted as shapes in
PS than in PDF.
</p>
<p>
When there's no support to paint text using native text operations,
text is converted and drawn as a set of shapes by Batik, using the
stroking text painter. This means that a typical character will
have about 10 curves (each curve consists of at least 20 characters).
This can make the output files large and when it is viewed the
viewer may not normally draw those fine curves very well (In Adobe Acrobat, turning on
"Smooth Line Art" in the preferences will fix this). Copy/paste functionality
will not be supported in this case.
If the text is inserted into the output file using the inbuilt text commands
it will use a single character.
</p>
<p>
Note that because SVG text can be rendered as either text or a vector graphic, you
may need to consider settings in your viewer for both. The Acrobat viewer has both
"smooth line art" and "smooth text" settings that may need to be set for SVG images
to be displayed nicely on your screen (see Edit / Preferences / Display).
This setting will not affect the printing of your document, which should be OK in
any case, but will only affect the quality of the screen display.
</p>
</section>
<section id="svg-font-selection">
<title>Font selection notes</title>
<p>
Apache Batik uses the AWT/Java2D subsystem as font source while FOP has its own font
subsystem. Great care has been taken that font selection does the best possible choices.
But it must be noted when creating PDF or PostScript that a font used in SVG graphics
needs to be registered with the operating system as well as in FOP's configuration.
By using FOP's font auto-detection, you simply have to install the font in the operating
system and not care about anything else. This is less of an issue if you create
formats like TIFFs, PNGs or PCL because in these cases SVG graphics are usually rendered
to bitmaps which means that on both sides (Batik and FOP), AWT/Java2D is used as the
single font source.
</p>
<p>
Whenever an SVG is converted into a PDF or PostScript file, the font that has been used
inside Batik has to be mapped to a font used by the actual output format. Features like
font substitution in FOP may need to be taken into account but can also be an advantage
when working around font mapping issues. Like for XSL-FO content, you'll get a warning
if a particular font could not be found and had to be substituted, or if a particular
glyph is missing in a font.
</p>
</section>
<section id="svg-scaling">
<title>Scaling</title>
<p>
Currently, SVG images are rendered with the dimensions specified <em>in the SVG
file</em>, within the viewport specified in the fo:external-graphic element.
For everything to work properly, the two should be equal. The SVG standard leaves
this issue as an implementation detail. Additional scaling options are available
through XSL-FO means.
</p>
<p>
If you use pixels to specify the size of an SVG graphic the "source resolution" setting
in the <a href="configuration.html">configuration</a> will be used to determine the
size of a pixel. The use of pixels to specify sizes is discouraged as they may
be interpreted differently in different environments.
</p>
</section>
<section id="svg-problems">
<title>Known Problems</title>
<ul>
<li>
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.
</li>
<li>
There is some problem with a gradient inside a pattern which may cause a PDF
error when viewed in Acrobat 5.
</li>
<li>
Text is not always handled correctly, it may select the wrong font
especially if characters have multiple fonts in the font list.
</li>
<li>
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.
</li>
</ul>
</section>
</section>
<section id="tiff">
<title>TIFF</title>
<p>
FOP can embed TIFF images without decompression into PDF, PostScript and AFP if they
have either CCITT T.4, CCITT T.6, or JPEG compression. Otherwise, a TIFF-capable
Image&nbsp;I/O codec is necessary for decoding the image.
</p>
<p>
There may be some limitation concerning images in the CMYK color space.
</p>
</section>
<section id="wmf">
<title>WMF</title>
<p>
Windows Metafiles (WMF) are supported through classes in
<a href="ext:xmlgraphics.apache.org/batik">Apache Batik</a>. At the moment, support
for this format is experimental and may not always work as expected.
</p>
</section>
</section>
<section id="resolution">
<title>Graphics Resolution</title>
<p>
Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution
values. FOP tries to use this resolution information whenever possible to determine
the image's intrinsic size. This size is used during the layout process when it is not
superseded by an explicit size on fo:external-graphic (content-width and content-height
properties).
</p>
<p>
Please note that not all images contain resolution information. If it's not available
the source resolution set on the FopFactory (or through the user configuration XML) is used.
The default here is 72 dpi.
</p>
<p>
Bitmap images are generally embedded into the output format at their original resolution
(as is). No resampling of the image is performed. Explicit resampling is on our wishlist,
but hasn't been implemented, yet. Bitmaps included in SVG graphics may be resampled to
the resolution specified in the "target resolution" setting in the
<a href="configuration.html">configuration</a> if SVG filters are applied. This can be
used as a work-around to resample images in FO documents.
</p>
</section>
<section id="page-selection">
<title>Page selection for multi-page formats</title>
<p>
Some image formats such as TIFF support multiple pages/sub-images per file. You can
select a particular page using a special URI fragment in the form:
&lt;uri&gt;#page=&lt;nr&gt;
(for example: <code>http://localhost/images/myimage.tiff#page=3</code>)
</p>
</section>
<section id="caching">
<title>Image caching</title>
<p>
FOP caches images between runs. There is one cache per FopFactory instance. The URI is
used as a key to identify images which means that when a particular URI appears again,
the image is taken from the cache. If you have a servlet that generates a different
image each time it is called with the same URI you need to use a constantly
changing dummy parameter on the URI to avoid caching.
</p>
<p>
The image cache has been improved considerably in the redesigned code. Therefore,
resetting the image cache should be a thing of the past. If you
still experience OutOfMemoryErrors, please notify us.
</p>
<p>
If all else fails, the image cache can be cleared like this:
<code>fopFactory.getImageManager().getCache().clearCache();</code>
</p>
</section>
</body>
</document>

src/documentation/content/xdocs/0.94/hyphenation.xml → src/documentation/content/xdocs/1.0/hyphenation.xml View File


src/documentation/content/xdocs/0.94/index.xml → src/documentation/content/xdocs/1.0/index.xml View File

@@ -19,21 +19,24 @@
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Apache FOP Version 0.94</title>
<title>Apache FOP Trunk (Development code)</title>
<version>$Revision$</version>
</header>
<body>
<section id="intro">
<title>Introduction</title>
<p>
The Apache FOP team is proud to present to you this production quality release.
We're still in the process of adding new features. We welcome any feedback you
might have and even more, any other form of help to get the project forward.
<strong>FOP Trunk</strong> is the name for the current
development code as found in the <a
href="ext:svn-repo/trunk">Subversion repository</a>. This
section of the FOP web site provides the documentation for
this version.
</p>
<p>
This fifth release contains many bug fix release and new features compared
to 0.93. To see what has changed since the last release, please visit the
<a href="changes_0.94.html">Changes Page</a> and the <a href="releaseNotes_0.94.html">Release Notes</a>.
The Apache FOP team is proud to present to you this production quality codebase. It has taken
over three years to get this far and over two years without a new release from the FOP
project. We're still in the process of adding new features. We welcome any feedback you
might have and even more, any other form of help to get the project forward.
</p>
</section>
<section id="upgrading">
@@ -43,11 +46,5 @@
information contained on the <a href="upgrading.html">Upgrading page</a>!
</p>
</section>
<section id="download">
<title>Download</title>
<p>
To download this version, please visit the <a href="../download.html">download page</a>.
</p>
</section>
</body>
</document>

+ 331
- 0
src/documentation/content/xdocs/1.0/intermediate.xml View File

@@ -0,0 +1,331 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Intermediate Format</title>
<version>$Revision$</version>
</header>
<body>
<note>
Please note that the intermediate formats described here are
<strong>advanced features</strong> and can be ignored by most users of Apache FOP.
</note>
<section id="introduction">
<title>Introduction</title>
<p>
Apache FOP now provides two different so-called intermediate formats. The first one
(let's call it the area tree XML format) is basically a 1:1 XML representation of FOP's
area tree as generated by the layout engine. The area tree is conceptually defined in the
<a href="http://www.w3.org/TR/2001/REC-xsl-20011015/slice1.html#section-N742-Formatting">XSL-FO specification in chapter 1.1.2</a>.
Even though the area tree is mentioned in the XSL-FO specification, this part is not
standardized. Therefore, the area tree XML format is a FOP-proprietary XML file format.
The area tree XML can be generated through the area tree XML Renderer (the XMLRenderer).
</p>
<p>
The second intermediate format (which we shall name exactly like this: the intermediate
format)
is a recent addition which tries to meet a slightly different set of goals. It is highly
optimized for speed.
</p>
<p>
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.
</p>
</section>
<section id="which-if">
<title>Which Intermediate Format to choose?</title>
<p>
Both formats have their use cases, so the choice you will make will depend on your
particular situation. Here is a list of strengths and use cases for both formats:
</p>
<section id="strengths-at">
<title>Area Tree XML (AT XML)</title>
<ul>
<li>1:1 representation of FOP's area tree in XML.</li>
<li>Contains more structure information than the new intermediate format.</li>
<li>Used in FOP's layout engine test suite for regression testing.</li>
</ul>
</section>
<section id="strengths-if">
<title>Intermediate Format (IF)</title>
<ul>
<li>Highly optimized for speed.</li>
<li>Smaller XML files.</li>
<li>Easier to post-process.</li>
<li>XML Schema is available.</li>
<li>
Recommended for use cases where documents are formatted concurrently and later
concatenated to a single print job.
</li>
</ul>
</section>
<p>
More technical information about the two formats can be found on the
<a href="http://wiki.apache.org/xmlgraphics-fop/AreaTreeIntermediateXml/NewDesign">FOP Wiki</a>.
</p>
</section>
<section id="architecture">
<title>Architectural Overview</title>
<figure src="images/if-architecture-overview.png"
alt="Diagram with an architectural overview over the intermediate formats"/>
</section>
<section id="usage">
<title>Usage of the Area Tree XML format (AT XML)</title>
<p>
As already mentioned, the area tree XML format is generated by using the
<strong>XMLRenderer</strong> (MIME type: <strong>application/X-fop-areatree</strong>).
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.
</p>
<p>
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 format, you need to create the area tree XML 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 area tree XML 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 area tree XML
format file is the first step.
</p>
<p>
The second step is to reparse the file using the <strong>AreaTreeParser</strong> which is
found in the org.apache.fop.area package. The pages retrieved from the area tree XML 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 area tree XML
processing in the
<a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/"><code>examples/embedding</code></a>
directory in the FOP distribution.
</p>
<p>
The basic pattern to parse the area tree XML format looks like this:
</p>
<source><![CDATA[
FopFactory fopFactory = FopFactory.newInstance();
// Setup output
OutputStream out = new java.io.FileOutputStream(pdffile);
out = new java.io.BufferedOutputStream(out);
try {
//Setup fonts and user agent
FontInfo fontInfo = new FontInfo();
FOUserAgent userAgent = fopFactory.newFOUserAgent();

//Construct the AreaTreeModel that will received the individual pages
AreaTreeModel treeModel = new RenderPagesModel(userAgent,
MimeConstants.MIME_PDF, fontInfo, out);
//Parse the area tree file into the area tree
AreaTreeParser parser = new AreaTreeParser();
Source src = new StreamSource(myIFFile);
parser.parse(src, treeModel, userAgent);
//Signal the end of the processing. The renderer can finalize the target document.
treeModel.endDocument();
} finally {
out.close();
}]]></source>
<p>
This example simply reads an area tree 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
<code>endDocument()</code> on the AreaTreeModel. This lets the Renderer know that the processing
is now finished.
</p>
<p>
The area tree XML format can also be used from the <a href="running.html#standalone-start">command-line</a>
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.
</p>
<section id="concat">
<title>Concatenating Documents</title>
<p>
This initial example is obviously not very useful. It would be faster to create the PDF file
directly. As the <a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/examples/embedding/java/embedding/atxml/ExampleConcat.java">ExampleConcat.java</a>
example shows you can easily parse multiple area tree 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.
</p>
</section>
<section id="modifying">
<title>Modifying Documents</title>
<p>
One of the most important use cases for this format is obviously modifying the area
tree XML before finally rendering it to the target format. You can easily use XSLT to process
the AT XML file according to your needs. Please note, that we will currently not formally describe
the area tree XML 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.
</p>
<note>
The area tree XML format is sensitive to changes in whitespace. If you're not careful,
the modified file may not render correctly.
</note>
</section>
<section id="advanced">
<title>Advanced Use</title>
<p>
The generation of the area tree format as well as it parsing process has been designed to allow
for maximum flexibility and optimization. Please note that you can call <code>setTransformerHandler()</code> 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 <code>getContentHandler()</code>).
</p>
</section>
</section>
<section id="usage-if">
<title>Usage of the Intermediate Format (IF)</title>
<p>
The Intermediate Format (IF) is generated by the <strong>IFSerializer</strong>
(MIME type: <strong>application/X-fop-intermediate-format</strong>).
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.
</p>
<p>
The IFSerializer is an implementation of the <strong>IFDocumentHandler</strong> and
<strong>IFPainter</strong> interfaces. The <strong>IFRenderer</strong> class is responsible
for converting FOP's area tree into calls against these two interfaces.
</p>
<ul>
<li>
IFDocumentHandler: This interface is used on the document-level and defines the
overall structure of the Intermediate Format.
</li>
<li>
IFPainter: This interface is used to generate graphical page content like text, images
and borders.
</li>
</ul>
<p>
As with the AT XML, there is an important detail to consider: The various output
implementations don't all use the same font sources. To be able
to create the right IF for the ultimate output file, you need to create the IF file using
the right font setup. This is achieved by telling the IFRenderer (responsible for
converting the area tree into calls to the IFDocumentHandler and IFPainter interfaces)
to mimic another renderer. This is done by calling the IFSerializer's
mimicDocumentHandler() method with an instance of the ultimate target document handler
as the single parameter. This has a consequence: An IF file rendered with the
Java2DDocumentHandler may not look as expected when it was actually generated for the PDF
implementation. For implementations 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.
</p>
<p>
The second step is to reparse the file using the <strong>IFParser</strong> which is
found in the org.apache.fop.render.intermediate package. The IFParser simply takes an
IFDocumentHandler instance against which it generates the appropriate calls. The IFParser
is implemented as a SAX ContentHandler so you're free to choose the method for
post-processing the IF file(s). You can use XSLT or write SAX- or DOM-based code to
manipulate the contents. You can find examples for the Intermediate Format
processing in the
<a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/"><code>examples/embedding</code></a>
directory in the FOP distribution.
</p>
<p>
The basic pattern to parse the intermediate format looks like this:
</p>
<source><![CDATA[
FopFactory fopFactory = FopFactory.newInstance();
// Setup output
OutputStream out = new java.io.FileOutputStream(pdffile);
out = new java.io.BufferedOutputStream(out);
try {
//Setup user agent
FOUserAgent userAgent = fopFactory.newFOUserAgent();

//Create IFDocumentHandler instance
IFDocumentHandler targetHandler;
String mime = MimeConstants.MIME_PDF;
targetHandler = fopFactory.getRendererFactory().createDocumentHandler(
userAgent, mime);

//Setup fonts
IFUtil.setupFonts(targetHandler);
//Tell the target handler where to write the PDF to
targetHandler.setResult(new StreamResult(pdffile));

//Parse the IF file
IFParser parser = new IFParser();
Source src = new StreamSource(myIFFile);
parser.parse(src, targetHandler, userAgent);
} finally {
out.close();
}]]></source>
<p>
This example simply reads an intermediate file and renders it to a PDF file. Here
IFParser.parse() is used, but you can also just get a SAX ContentHandler by using the
IFParser.getContentHandler() method.
</p>
<section id="concat-if">
<title>Concatenating Documents</title>
<p>
This initial example is obviously not very useful. It would be faster to create the PDF file
directly (without the intermediate step). As the
<a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/examples/embedding/java/embedding/intermediate/ExampleConcat.java">ExampleConcat.java</a>
example shows you can easily parse multiple intermediate files in a row and use the
IFConcatenator class to concatenate page sequences from multiple source files to a single
output file. This particular example does the concatenation on the level of the
IFDocumentHandler interface. You could also do this in XSLT or using SAX on the XML level.
Whatever suits your process best.
</p>
</section>
<section id="modifying-if">
<title>Modifying Documents</title>
<p>
One of the most important use cases for this format is obviously modifying the
intermediate format before finally rendering it to the target format. You can easily use
XSLT to process the IF file according to your needs.
</p>
<p>
There is an XML Schema (located under
<a href="http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/documentation/intermediate-format-ng/">src/documentation/intermediate-format-ng</a>)
that helps you verify that your modified content is correct.
</p>
<p>
For certain output formats there's a caveat: Formats like AFP and PCL do not support
arbitrary transformations on the IF's "viewport" and "g" elements. Possible are
only rotations in 90 degree steps and translations.
</p>
</section>
<section id="advanced-if">
<title>Advanced Use</title>
<p>
The generation of the intermediate format as well as it parsing process has been
designed to allow for maximum flexibility and optimization. So rather than just passing
in a StreamResult to IFSerializer's setResult() method, you can also use a SAXResult
or a DOMResult. And as you've already seen , the IFParser on the other side allows you
to retrieve a ContentHandler instance where you can manually send SAX events to
start the parsing process (see <code>getContentHandler()</code>).
</p>
</section>
</section>
</body>
</document>

src/documentation/content/xdocs/0.94/known-issues.xml → src/documentation/content/xdocs/1.0/known-issues.xml View File

@@ -21,8 +21,9 @@
MIF and SVG output support have not been restored, yet.
</known-issue>
<known-issue>
Java2D/AWT support has been improved, but some problems remain,
for example with block-containers.
RTF output is inferior to other output formats supported by FOP.
For details, please see the "Output Targets" page of the release
you're using.
</known-issue>
<known-issue>
Auto table layout is not implemented, yet.
@@ -80,10 +81,6 @@
Not all FO elements can be referenced by their "id", most notably:
table-body, table-header, table-footer and table-row.
</known-issue>
<known-issue>
The backgrounds of table-body, table-header, table-footer and
table-column are not painted, yet.
</known-issue>
<known-issue>
Border and padding conditionality are not supported on table-cells, yet.
</known-issue>

src/documentation/content/xdocs/0.94/knownissues_overview.xml → src/documentation/content/xdocs/1.0/knownissues_overview.xml View File

@@ -49,7 +49,7 @@
This section lists disabled test cases in the test suite for the FO tree tests, at the time
of the release.
</p>
<xi:include href="cocoon://knownissues-raw-fotree_0.94.xml#xpointer(/document/body/*)"/>
<xi:include href="cocoon://knownissues-raw-fotree_1.0.xml#xpointer(/document/body/*)"/>
</section>
<section>
<title>Layout Engine</title>
@@ -57,12 +57,12 @@
This section lists disabled test cases in the test suite for the layout engine tests, at the
time of the release.
</p>
<xi:include href="cocoon://knownissues-raw-layoutengine_0.94.xml#xpointer(/document/body/*)"/>
<xi:include href="cocoon://knownissues-raw-layoutengine_1.0.xml#xpointer(/document/body/*)"/>
</section>
<section>
<title>Other known issues</title>
<p>This section lists other known issues.</p>
<xi:include href="cocoon://knownissues-raw-static_0.94.xml#xpointer(/document/body/*)"/>
<xi:include href="cocoon://knownissues-raw-static_1.0.xml#xpointer(/document/body/*)"/>
</section>
</section>
</body>

src/documentation/content/xdocs/0.94/layoutengine/disabled-testcases.xml → src/documentation/content/xdocs/1.0/layoutengine/disabled-testcases.xml View File

@@ -26,13 +26,6 @@
is not sized correctly if it wraps an image that is higher than the
nominal line.</description>
</testcase>
<testcase>
<name>Bugzilla #36391: reference-orientation</name>
<file>block-container_reference-orientation_bug36391.xml</file>
<description>There's a problem involving nested block-containers
and reference-orientation 180/-180.</description>
<reference>http://issues.apache.org/bugzilla/show_bug.cgi?id=36391</reference>
</testcase>
<testcase>
<name>Auto-height block-containers produce fences</name>
<file>block-container_space-before_space-after_3.xml</file>
@@ -48,8 +41,8 @@
<testcase>
<name>Hyphenation with preserved linefeeds</name>
<file>block_hyphenation_linefeed_preserve.xml</file>
<description>When hyphenation is enabled and linefeeds are preserved linefeeds
are painted as '#' and the text is output multiple times.</description>
<description>When hyphenation is enabled and linefeeds are preserved,
the text is output multiple times.</description>
</testcase>
<testcase>
<name>linefeed-treatment</name>
@@ -104,29 +97,6 @@
<description>Space resolution does not work between footnote
regions.</description>
</testcase>
<testcase>
<name>Footnotes swallowed in lists</name>
<file>footnote_in_list.xml</file>
<description>Element lists for lists are created by combining the
element lists from list-item-label and list-item-body. The
footnotes contained in the KnuthBlockBoxes are not propagated to
the combined element list.</description>
<reference>http://issues.apache.org/bugzilla/show_bug.cgi?id=37579</reference>
</testcase>
<testcase>
<name>Footnotes swallowed in tables</name>
<file>footnote_in_table.xml</file>
<description>Element lists for tables are created by combining the
element lists from the individual table-cells. The footnotes
contained in the KnuthBlockBoxes are not propagated to the combined
element list.</description>
<reference>http://issues.apache.org/bugzilla/show_bug.cgi?id=37579</reference>
</testcase>
<testcase>
<name>keeps on inlines NYI</name>
<file>inline_keep-together.xml</file>
<description>Keeps are not implemented in inline-level elements, yet.</description>
</testcase>
<testcase>
<name>NPE for table inside an inline</name>
<file>inline_block_nested_3.xml</file>
@@ -176,18 +146,6 @@
line.</description>
<reference>http://www.nabble.com/leaders-with-leader-pattern%3D%22use-content%22-t546244.html</reference>
</testcase>
<testcase>
<name>keep-with-previous doesn't work in lists</name>
<file>list-block_keep-with-previous.xml</file>
<description>Keep-with-previous doesn't work inside tables and
lists, yet.</description>
</testcase>
<testcase>
<name>keep-with-previous doesn't work in lists</name>
<file>list-item_block_keep-with-previous.xml</file>
<description>Keep-with-previous doesn't work inside tables and
lists, yet.</description>
</testcase>
<testcase>
<name>Page breaking doesn't deal with IPD changes</name>
<file>page-breaking_4.xml</file>
@@ -212,11 +170,6 @@
<description>Background-images on page-number-citations are not
placed correctly.</description>
</testcase>
<testcase>
<name>page-number-citation-last: FOs spanning multiple pages are not properly handled.</name>
<file>page-number-citation-last_basic.xml</file>
<description>Resolution of forward references does not wait until an FO is fully finished when an FO spans multiple pages.</description>
</testcase>
<testcase>
<name>IDs are not working on all FO elements</name>
<file>page-number-citation_complex_1.xml</file>
@@ -244,54 +197,6 @@
<file>region-body_column-count_bug36356.xml</file>
<description>Column balancing doesn't work as expected.</description>
</testcase>
<testcase>
<name>No background-images on table-body</name>
<file>table-body_background-image.xml</file>
<description>The backgrounds of table-body, table-header,
table-footer and table-column are not painted, yet.</description>
</testcase>
<testcase>
<name>Collapsing Border Model NYI</name>
<file>table_border-collapse_collapse_1.xml</file>
<description>Border-collapse="collapse" is not yet
implemented.</description>
</testcase>
<testcase>
<name>Collapsing Border Model NYI</name>
<file>table_border-collapse_collapse_2.xml</file>
<description>Border-collapse="collapse" is not yet
implemented.</description>
</testcase>
<testcase>
<name>Problems with border and padding on tables</name>
<file>table_border_padding.xml</file>
<description>The element list seems to not be fully correct, yet, causing
the layout to look odd.</description>
</testcase>
<testcase>
<name>keep-with-previous doesn't work inside tables</name>
<file>table-cell_block_keep-with-previous.xml</file>
<description>Keep-with-previous doesn't work inside tables and
lists, yet.</description>
</testcase>
<testcase>
<name>Border and padding conditionality is NYI on table-cells</name>
<file>table-cell_border_padding_conditionality.xml</file>
<description>Border and padding conditionality are not supported
on table-cells, yet.</description>
</testcase>
<testcase>
<name>No background-images on table-header</name>
<file>table-header_background-image.xml</file>
<description>The backgrounds of table-body, table-header,
table-footer and table-column are not painted, yet.</description>
</testcase>
<testcase>
<name>keep-with-previous doesn't work on table-rows</name>
<file>table-row_keep-with-previous.xml</file>
<description>Keep-with-previous doesn't work inside tables and
lists, yet.</description>
</testcase>
<testcase>
<name>table-cell empty area with marker.xml</name>
<file>table-cell_empty_area_with_marker.xml</file>
@@ -305,23 +210,16 @@
is probably not expressing the indended outcome according to the spec. The test
case should be revisited.</description>
</testcase>
<testcase>
<name>fo:wrapper around block-level content (with id)</name>
<file>wrapper_block_id.xml</file>
<description>"id" attributes on fo:wrapper around block-level content don't get
added to the area tree.</description>
</testcase>
<testcase>
<name>Bugzilla #40230: invalid extra page break</name>
<file>block_break-after_bug40230.xml</file>
<description>Currently an extra page is created even if there is nothing
after a block with break-after="page"</description>
<reference>http://issues.apache.org/bugzilla/show_bug.cgi?id=40230</reference>
</testcase>
<testcase>
<name>Soft hyphen with normal hyphenation enabled</name>
<file>block_shy_linebreaking_hyph.xml</file>
<description>A soft hyphen should be a preferred as break compared to a
normal hyphenation point but is not.</description>
</testcase>
<testcase>
<name>Page-keep not respected in multi-column layout</name>
<file>keep_within-page_multi-column_overflow.xml</file>
<description>The block should cause overflow in the
last column on the page, rather than be broken.</description>
</testcase>
</disabled-testcases>

+ 243
- 0
src/documentation/content/xdocs/1.0/metadata.xml View File

@@ -0,0 +1,243 @@
<?xml version="1.0" standalone="no"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "document-v20.dtd">
<document>
<header>
<title>Metadata</title>
</header>
<body>
<section id="overview">
<title>Overview</title>
<p>
Document metadata is an important tool for categorizing and finding documents.
Various formats support different kinds of metadata representation and to
different levels. One of the more popular and flexible means of representing
document or object metadata is
<a href="http://www.adobe.com/products/xmp/">XMP (eXtensible Metadata Platform, specified by Adobe)</a>.
PDF 1.4 introduced the use of XMP. The XMP specification lists recommendation for
embedding XMP metdata in other document and image formats. Given its flexibility it makes
sense to make use this approach in the XSL-FO context. Unfortunately, unlike SVG which
also refers to XMP, XSL-FO doesn't recommend a preferred way of specifying document and
object metadata. Therefore, there's no portable way to represent metadata in XSL-FO
documents. Each implementation does it differently.
</p>
</section>
<section id="xmp-in-fo">
<title>Embedding XMP in an XSL-FO document</title>
<p>
As noted above, there's no officially recommended way to embed metadata in XSL-FO.
Apache FOP supports embedding XMP in XSL-FO. Currently, only support for document-level
metadata is implemented. Object-level metadata will be implemented when there's
interest.
</p>
<p>
Document-level metadata can be specified in the <code>fo:declarations</code> element.
XMP specification recommends to use <code>x:xmpmeta</code>, <code>rdf:RDF</code>, and
<code>rdf:Description</code> elements as shown in example below. Both
<code>x:xmpmeta</code> and <code>rdf:RDF</code> elements are recognized as the top-level
element introducing an XMP fragment (as per the XMP specification).
</p>
<section id="xmp-example">
<title>Example</title>
<source><![CDATA[[..]
</fo:layout-master-set>
<fo:declarations>
<x:xmpmeta xmlns:x="adobe:ns:meta/">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:dc="http://purl.org/dc/elements/1.1/">
<!-- Dublin Core properties go here -->
<dc:title>Document title</dc:title>
<dc:creator>Document author</dc:creator>
<dc:description>Document subject</dc:description>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/">
<!-- XMP properties go here -->
<xmp:CreatorTool>Tool used to make the PDF</xmp:CreatorTool>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
</fo:declarations>
<fo:page-sequence ...
[..]]]></source>
<note>
<code>fo:declarations</code> <strong>must</strong> be declared after
<code>fo:layout-master-set</code> and before the first <code>page-sequence</code>.
</note>
</section>
</section>
<section id="xmp-impl-in-fop">
<title>Implementation in Apache FOP</title>
<p>
Currently, XMP support is only available for PDF output.
</p>
<p>
Originally, you could set some metadata information through FOP's FOUserAgent by
using its set*() methods (like setTitle(String) or setAuthor(String). These values are
directly used to set value in the PDF Info object. Since PDF 1.4, adding metadata as an
XMP document to a PDF is possible. That means that there are now two mechanisms in PDF
that hold metadata.
</p>
<p>
Apache FOP now synchronizes the Info and the Metadata object in PDF, i.e. when you
set the title and the author through the FOUserAgent, the two values will end up in
the (old) Info object and in the new Metadata object as XMP content. If instead of
FOUserAgent, you embed XMP metadata in the XSL-FO document (as shown above), the
XMP metadata will be used as-is in the PDF Metadata object and some values from the
XMP metadata will be copied to the Info object to maintain backwards-compatibility
for PDF readers that don't support XMP metadata.
</p>
<p>
The mapping between the Info and the Metadata object used by Apache FOP comes from
the <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=38920">PDF/A-1 specification</a>.
For convenience, here's the mapping table:
</p>
<table>
<tr>
<th colspan="2">Document information dictionary</th>
<th colspan="3">XMP</th>
</tr>
<tr>
<th>Entry</th>
<th>PDF type</th>
<th>Property</th>
<th>XMP type</th>
<th>Category</th>
</tr>
<tr>
<td>Title</td>
<td>text string</td>
<td>dc:title</td>
<td>Text</td>
<td>External</td>
</tr>
<tr>
<td>Author</td>
<td>text string</td>
<td>dc:creator</td>
<td>seq Text</td>
<td>External</td>
</tr>
<tr>
<td>Subject</td>
<td>text string</td>
<td>dc:description["x-default"]</td>
<td>Text</td>
<td>External</td>
</tr>
<tr>
<td>Keywords</td>
<td>text string</td>
<td>pdf:Keywords</td>
<td>Text</td>
<td>External</td>
</tr>
<tr>
<td>Creator</td>
<td>text string</td>
<td>xmp:CreatorTool</td>
<td>Text</td>
<td>External</td>
</tr>
<tr>
<td>Producer</td>
<td>text string</td>
<td>pdf:Producer</td>
<td>Text</td>
<td>Internal</td>
</tr>
<tr>
<td>CreationDate</td>
<td>date</td>
<td>xmp:CreationDate</td>
<td>Date</td>
<td>Internal</td>
</tr>
<tr>
<td>ModDate</td>
<td>date</td>
<td>xmp:ModifyDate</td>
<td>Date</td>
<td>Internal</td>
</tr>
</table>
<note>
"Internal" in the Category column means that the user should not set this value.
It is set by the application.
</note>
<note>
The "Subject" used to be mapped to <code>dc:subject</code> in the initial publication of
PDF/A-1 (ISO 19005-1). In the
<a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=45613">Technical Corrigendum 1</a>
this was changed to map to <code>dc:description["x-default"]</code>.
</note>
<section id="namespaces">
<title>Namespaces</title>
<p>
Metadata is made of property sets where each property set uses a different namespace URI.
</p>
<p>
The following is a listing of namespaces that Apache FOP recognizes and acts upon,
mostly to synchronize the XMP metadata with the PDF Info dictionary:
</p>
<table>
<tr>
<th>Set/Schema</th>
<th>Namespace Prefix</th>
<th>Namespace URI</th>
</tr>
<tr>
<td>Dublin Core</td>
<td>dc</td>
<td>http://purl.org/dc/elements/1.1/</td>
</tr>
<tr>
<td>XMP Basic</td>
<td>xmp</td>
<td>http://ns.adobe.com/xap/1.0/</td>
</tr>
<tr>
<td>Adobe PDF Schema</td>
<td>pdf</td>
<td>http://ns.adobe.com/pdf/1.3/</td>
</tr>
</table>
<p>
Please refer to the <a href="http://partners.adobe.com/public/developer/en/xmp/sdk/XMPspecification.pdf">XMP Specification</a>
for information on other metadata namespaces.
</p>
<p>
Property sets (Namespaces) not listed here are simply passed through to the final
document (if supported). That is useful if you want to specify a custom metadata
schema.
</p>
</section>
</section>
<section id="links">
<title>Links</title>
<ul>
<li><a href="http://www.adobe.com/products/xmp/">Adobe's Extensible Metadata Platform (XMP) website</a></li>
<li><a href="http://partners.adobe.com/public/developer/en/xmp/sdk/XMPspecification.pdf">Adobe XMP Specification</a></li>
<li><a href="http://partners.adobe.com/public/developer/en/xmp/sdk/XMPspecification.pdf">Adobe XMP Specification</a></li>
<li><a href="http://dublincore.org/">http://dublincore.org/</a></li>
</ul>
</section>
</body>
</document>

src/documentation/content/xdocs/0.94/output.xml → src/documentation/content/xdocs/1.0/output.xml View File

@@ -48,6 +48,35 @@
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.
</p>
<p>
Theoretically, there's some potential to make the output of the PDF/PS renderers match
the output of the Java2D-based renderers. If FOP used the font metrics from its own
font subsystem but still used Java2D for text painting in the Java2D-based renderers,
this could probably be achieved. However, this approach hasn't been implemented, yet.
</p>
<p>
With a work-around, it is possible to match the PDF/PS output in a Java2D-based
renderer pretty closely. The clue is to use the
<a href="intermediate.html">intermediate format</a>. The trick is to layout the
document using FOP's own font subsystem but then render the document using Java2D.
Here are the necessary steps (using the command-line):
</p>
<ol>
<li>
Produce an IF file: <code>fop -fo myfile.fo -at application/pdf myfile.at.xml</code><br/>
Specifying "application/pdf" for the "-at" parameter causes FOP to use FOP's own
font subsystem (which is used by the PDF renderer). Note that no PDF file is created
in this step.
</li>
<li>Render to a PDF file: <code>fop -atin myfile.at.xml -pdf myfile.pdf</code></li>
<li>Render to a Java2D-based renderer:
<ul>
<li><code>fop -atin myfile.at.xml -print</code></li>
<li><code>fop -atin myfile.at.xml -awt</code></li>
<li><code>fop -atin myfile.at.xml -tiff myfile.tiff</code></li>
</ul>
</li>
</ol>
</section>
<section id="general-direct-output">
<title>Output to a Printer or Other Device</title>
@@ -105,7 +134,7 @@ out = proc.getOutputStream();]]></source>
<section id="pdf-postprocess">
<title>Post-processing</title>
<p>
FOP does not currently support several desirable PDF features: XMP metadata and watermarks.
FOP does not currently support several desirable PDF features: watermarks and signatures.
One workaround is to use Adobe Acrobat (the full version, not the Reader) to process
the file manually or with scripting that it supports.
</p>
@@ -212,6 +241,8 @@ out = proc.getOutputStream();]]></source>
<auto-rotate-landscape>false</auto-rotate-landscape>
<language-level>3</language-level>
<optimize-resources>false</optimize-resources>
<safe-set-page-device>false</safe-set-page-device>
<dsc-compliant>true</dsc-compliant>
</renderer>]]></source>
<p>
The default value for the "auto-rotate-landscape" setting is "false". Setting it
@@ -230,6 +261,20 @@ out = proc.getOutputStream();]]></source>
reduce file size but can potentially increase the memory needed in the interpreter
to process.
</p>
<p>
The default value for the "safe-set-page-device" setting is "false". Setting it
to "true" will cause the renderer to invoke a postscript macro which guards against
the possibility of invalid/unsupported postscript key/values being issued to the
implementing postscript page device.
</p>
<p>
The default value for the "dsc-compliant" setting is "true". Setting it
to "false" will break DSC compliance by minimizing the number of setpagedevice
calls in the postscript document output. This feature may be useful when unwanted
blank pages are experienced in your postscript output. This problem is caused by
the particular postscript implementation issuing unwanted postscript subsystem
initgraphics/erasepage calls on each setpagedevice call.
</p>
</section>
<section id="ps-limitations">
<title>Limitations</title>
@@ -313,6 +358,7 @@ out = proc.getOutputStream();]]></source>
<source><![CDATA[<renderer mime="application/vnd.hp-PCL">
<rendering>quality</rendering>
<text-rendering>bitmap</text-rendering>
<disable-pjl>false</disable-pjl>
</renderer>]]></source>
<p>
The default value for the "rendering" setting is "speed" which causes borders
@@ -327,6 +373,12 @@ out = proc.getOutputStream();]]></source>
If the mix of painting methods results in unwelcome output, you can set this
to "bitmap" which causes all text to be rendered as bitmaps.
</p>
<p>
The default value for the "disable-pjl" setting is "false". This means that
the PCL renderer usually generates PJL commands before and after the document
in order to switch a printer into PCL language. PJL commands can be disabled
if you set this value to "true".
</p>
<p>
You can control the output resolution for the PCL using the "target resolution"
setting on the FOUserAgent. The actual value will be rounded up to the next
@@ -370,20 +422,92 @@ out = proc.getOutputStream();]]></source>
Consult the technical reference for your printer for all available values.
</p>
</section>
<section id="pcl-output-bin">
<title>Output Bin</title>
<p>
The <code>output-bin</code> extension attribute on fo:simple-page-master allows to
select the output bin into which the printed output should be fed. Example:
</p>
<source><![CDATA[
<fo:layout-master-set>
<fo:simple-page-master master-name="simple" pcl:output-bin="2">
...
</fo:simple-page-master>
</fo:layout-master-set>
]]></source>
<p>
Note: the output bin number is a positive integer and the value depends on
the target printer. Not all PCL printers support the same output bins.
Usually,
"1" is the upper output bin,
"2" is the lower (rear) output bin.
Consult the technical reference for your printer for all available values.
</p>
</section>
<section id="pcl-duplex-mode">
<title>Page Duplex Mode</title>
<p>
The duplex-mode extension attribute on fo:simple-page-master allows to
select the duplex mode to be used for a particular simple-page-master.
Example:
</p>
<source><![CDATA[
<fo:layout-master-set>
<fo:simple-page-master master-name="simple" pcl:duplex-mode="0">
...
</fo:simple-page-master>
</fo:layout-master-set>
]]></source>
<p>
Note: the duplex is a positive integer and the value depends on
the target printer. Not all PCL printers support duplexing.
Usually,
"0" is simplex,
"1" is duplex (long-edge binding),
"2" is duplex (short-edge binding).

Consult the technical reference for your printer for all available values.
</p>
</section>
</section>
</section>
<section id="afp">
<title>AFP</title>
<warning>The AFP Renderer is a new addition (27-Apr-2006) to the sandbox and as such not yet fully tested or feature complete.</warning>
<p>
The FOP AFP Renderer deals with creating documents conforming to the IBM AFP document architecture
also refered to as MO:DCA (Mixed Object Document Content Architecture).
</p>
<p>
The mapping of XSL-FO elements to the major MO:DCA structures is as follows:
</p>
<table>
<tr>
<th>XSL-FO element</th>
<th>MO:DCA-P object</th>
</tr>
<tr>
<td>fo:root</td>
<td>Document</td>
</tr>
<tr>
<td>fo:page-sequence</td>
<td>Page Group</td>
</tr>
<tr>
<td>fo:simple-page-master</td>
<td>Page</td>
</tr>
</table>
<p>
FOP creates exactly one Document per Printfile with an optional Resource Group at the
beginning. FOP does not create document indices.
</p>
<section id="afp-references">
<title>References</title>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Advanced_Function_Presentation">AFP (Advanced Function Presentation)</a></li>
<li><a href="http://wiki.apache.org/xmlgraphics-fop/AFPResources">AFP Resources on the FOP WIKI</a></li>
<li><a href="http://wiki.apache.org/xmlgraphics-fop/AFPOutput">Technical notes on AFP output in FOP</a></li>
</ul>
</section>
<section id="afp-limitations">
@@ -399,10 +523,24 @@ out = proc.getOutputStream();]]></source>
</li>
</ul>
</section>
<section id="afp-compatibility">
<title>Deployment in older environments</title>
<p>
There are still a big number of older (or limited) MO:DCA/IPDS environments in production
out there. AFP has grown in functionality over time and not every environment supports the
latest features. We're trying to make AFP output work in as many environments as possible.
However, to make AFP output work on older environments it is recommended to set to
configuration to 1 bit per pixel (see below on how to do this). In this case, all images
are converted to bi-level images using IOCA function set 10 (FS10) and are enclosed in
page-segments since some implementation cannot deal with IOCA objects directly.
If a higher number of bits per pixel is configured, FOP has to switch to at least FS11
which may not work everywhere.
</p>
</section>
<section id="afp-configuration">
<title>Configuration</title>
<section id="afp-font-config">
<title>Fonts</title>
<title>Fonts</title>
<p>The AFP Renderer requires special configuration particularly related to fonts.
AFP Render configuration is done through the normal FOP configuration file. The MIME type
for the AFP Renderer is application/x-afp which means the AFP Renderer section in the FOP configuration file
@@ -411,18 +549,19 @@ out = proc.getOutputStream();]]></source>
<!-- AFP Renderer -->
...
</renderer>]]></source>
<p>There are 3 font configuration variants supported:</p>
<p>There are 4 font configuration variants supported:</p>
<ol>
<li>IBM Raster fonts</li>
<li>IBM Outline fonts</li>
<li>IBM CID-keyed (Type 0) fonts</li>
<li>FOP built-in Base14 fonts</li>
</ol>
<p>A typical raster font configuration looks like:</p>
<source><![CDATA[ <!-- This is an example of mapping actual IBM raster fonts / code pages to a FOP font -->
<font>
<!-- The afp-font element defines the IBM code page, the matching Java encoding and the
path to the font -->
<afp-font type="raster" codepage="T1V10500" encoding="Cp500" path="fonts/ibm">
base URI for the font -->
<afp-font type="raster" codepage="T1V10500" encoding="Cp500" base-uri="fonts/ibm/">
<!-- For a raster font a separate element for each font size is required providing
the font size and the corresponding IBM Character set name -->
<afp-raster-font size="7" characterset="C0N20070"/>
@@ -448,15 +587,36 @@ out = proc.getOutputStream();]]></source>
However, the characterset definition is now required within the afp-font element.</p>
<source><![CDATA[ <font>
<afp-font type="outline" codepage="T1V10500" encoding="Cp500" characterset="CZH200 "
path="fonts/ibm" />
base-uri="file:/fonts/ibm" />
<font-triplet name="sans-serif" style="normal" weight="normal"/>
<font-triplet name="Helvetica" style="normal" weight="normal"/>
<font-triplet name="any" style="normal" weight="normal"/>
</font>
]]></source>
<p>
If "base-uri" is missing or a relative URI, the fonts are resolved relative to
the font base URI specified in the configuration (or on the FopFactory).
</p>
<note>
Previously, the location of the font files was given by the "path" attribute. This is still
supported for the time being, but you should move to using the more flexible "base-uri"
attribute so you can profit from the power of URI resolvers.
</note>
<p>A CID-keyed font (Type 0, double-byte outline font) configuration is much the same as an outline font.
However, the characterset definition is now required within the afp-font element.</p>
<source><![CDATA[ <font>
<afp-font type="CIDKeyed" characterset="CZJHMNU"
codepage="T1120000" encoding="UnicodeBigUnmarked"
base-uri="file:/fonts/ibm" />
<font-triplet name="J-Heisei Mincho" style="normal" weight="normal" />
</font>
]]></source>
<p>
Note that the value of the encoding attribute in the example is the double-byte encoding 'UnicodeBigUnmarked' (UTF-16BE).
</p>
<p>Experimentation has shown that the font metrics for the FOP built-in Base14 fonts are actually
very similar to some of the IBM outline and raster fonts. In cases were the IBM font files are not
available the path attribute in the afp-font element can be replaced by a base14-font attribute
available the base-uri attribute in the afp-font element can be replaced by a base14-font attribute
giving the name of the matching Base14 font. In this case the AFP Renderer will take the
font metrics from the built-in font.</p>
<source><![CDATA[ <!-- The following are examples of defining outline fonts based on FOP built-in
@@ -527,20 +687,102 @@ out = proc.getOutputStream();]]></source>
<font-triplet name="monospace" style="normal" weight="bold"/>
<font-triplet name="Courier" style="normal" weight="bold"/>
</font>]]></source>
<p>
By default, all manually configured fonts are embedded, unless they are matched in the
<a href="fonts.html#embedding"><code>referenced-fonts</code> section of the configuration file</a>.
However, the default fonts shown above will not be embedded.
</p>
</section>
<section id="afp-renderer-resolution-config">
<title>Output Resolution</title>
<p>By default the AFP Renderer creates output with a resolution of 240 dpi.
This can be overridden by the &lt;renderer-resolution/&gt; configuration element. Example:</p>
<source><![CDATA[
<renderer-resolution>240</renderer-resolution>]]></source>
</section>
<section id="afp-image-config">
<title>Images</title>
<p>By default the AFP Renderer converts all images to 8 bit grey level.
This can be overridden by the &lt;images&gt; configuration element. Example:</p>
This can be overridden by the &lt;images/&gt; configuration element. Example:</p>
<source><![CDATA[
<images mode="color" />
]]></source>
<p>This will put images as RGB images into the AFP output stream. The default setting is:</p>
<source><![CDATA[
<images mode="b+w" bits-per-pixel="8" />
<images mode="b+w" bits-per-pixel="8" native="true"/>
]]></source>
<p>Only the values "color" and "b+w" are allowed for the mode attribute.</p>
<p>The bits-per-pixel attribute is ignored if mode is "color". For "b+w" mode is must be 1, 4, or 8.</p>
<source><![CDATA[
<images native="true"/>
]]></source>
<p>Only the values "color" and "b+w" are allowed for the mode attribute. The bits-per-pixel
attribute is ignored if mode is "color". For "b+w" mode is must be 1, 4, or 8.</p>
<p>When the native attribute is specified and set to "true", all image resources will be natively injected
into the datastream using an object container rather than being converted into an IOCA FS45 image.
Support for native image formats (e.g. JPEG, TIFF, GIF) is not always available on printer implementations
so by default this configuration option is set to "false".</p>
<p>
Setting <code>cmyk="true"</code> on the <code>images</code> element will enable CMYK
colors. This will only have an effect if the color mode is set to "color". Example:
</p>
<source><![CDATA[
<images mode="color" cmyk="true"/>]]></source>
<p>
When the color mode is set to 1 bit (bi-level), the "dithering-quality" attribute can
be used to select the level of quality to use when converting images to bi-level images.
Valid values for this attribute are floating point numbers from 0.0 (fastest) to
1.0 (best), or special values: "minimum" (=0.0), "maximum" (1.0),
"medium" (0.5, the default). For the higher settings to work as expected, JAI needs to
be present in the classpath. If JAI is present, 0.0 results in a minimal darkness-level
switching between white and black. 0.5 does bayer-based dithering and 1.0 will use
error-diffusion dithering. The higher the value, the higher the quality and the slower
the processing of the images.
</p>
<source><![CDATA[
<images mode="b+w" bits-per-pixel="1" dithering-quality="maximum"/>]]></source>
</section>
<section id="afp-shading-config">
<title>Shading</title>
<p>
By default, filled rectangles are painted using their given color using a PTOCA I-axis rule
(DIR). But not all environments handle these colors correctly. That's why a setting is
supported that paints the rectangles using an ordered dither pattern (bi-level) with
an inline IOCA FS10 image that is used together with the "replicate and trim" mapping.
The optional "shading" element can be used to control the shading mode. Its default value
is "color". To enable the dithered mode, use "dithered". Example:
</p>
<source><![CDATA[
<shading>dithered</shading>
]]></source>
</section>
<section id="afp-resource-group-file">
<title>Resource Group File</title>
<p>By default the AFP Renderer will place all data resource objects such as images within
the document of the main output datastream. An external resource group file where document resources
may be specified with the &lt;resource-group-file/&gt; configuration element. Example:</p>
<source><![CDATA[
<resource-group-file>external_resources.afp</resource-group-file>
]]></source>
<note>Be careful when using this option not to overwrite existing resource files from previous rendering runs.</note>
</section>
<section id="afp-resource-level-defaults">
<title>Resource Level Defaults</title>
<p>
By default, bitmap image objects (or page segments derived from them) are put in the
print-file-level resource group and GOCA graphics are inlined for compatibility with
the AFP Workbench tool.
</p>
<p>
It is possible to override these defaults, either per image (see the
<link href="#afp-foreign-attributes-resource">afp:resource-level</link>
extension attribute below) or by specifying different defaults in the configuration:
</p>
<source><![CDATA[
<default-resource-levels goca="print-file" bitmap="inline"/>]]></source>
<p>
"goca" refers to GOCA graphics and "bitmap" refers to IOCA images. The possible values
for the attributes are "inline" and "print-file". In the future,
additional possibilities may be added.
</p>
</section>
</section>
<section id="afp-extensions">
@@ -552,21 +794,22 @@ out = proc.getOutputStream();]]></source>
xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
]]></source>
<section id="afp-page-overlay">
<title>Page Overlay Extension</title>
<title>Page Overlay (IPO) Extension</title>
<p>The include-page-overlay extension element allows to define on a per simple-page-master basis a page overlay resource. Example:</p>
<source><![CDATA[
<fo:layout-master-set>
<fo:simple-page-master master-name="simple">
<afp:include-page-overlay name="O1SAMP1 " />
<afp:include-page-overlay name="O1SAMP1 " x="20mm" y="30mm" />
...
</fo:simple-page-master>
</fo:layout-master-set>
]]></source>
<p>The mandatory name attribute must refer to an 8 character (space padded) resource name that
must be known in the AFP processing environment.</p>
must be known in the AFP processing environment. Optional x and y attributes can be specified
to place the Overlay at an offset from the top left of the page.</p>
</section>
<section id="afp-page-segment">
<title>Page Segment Extension</title>
<title>Page Segment (IPS) Extension</title>
<p>The include-page-segment extension element allows to define resource substitution for fo:external-graphics elements.
Example:</p>
<source><![CDATA[
@@ -587,11 +830,21 @@ out = proc.getOutputStream();]]></source>
fo:external-graphic elements and if it is identical (string matching is used) in the generated
AFP the external graphic is replaced by a reference to the given resource.
</p>
<p>
The effect here is that whenever FOP encounters the URI specified in the extension,
it will effectively generate code to include the page segment with the given name
instead of embedding the image referenced by the URI. The URI is still required as
the underlying image serves as a provider for the intrinsic size of the image
(At the moment, FOP is unable to extract the intrinsic size of the page segment from
an AFP resource file). For the image to appear in an AFP viewer or to be printed, the
AFP resource must be available on the target device. FOP does not embed the page
segment in the generated file. Please also note that page segments cannot be scaled.
They are always rendered in their intrinsic size.
</p>
</section>
<section id="afp-tag-logical-element">
<title>Tag Logical Element Extension</title>
<p>The tag-logical-element extension element allows to injects TLEs into the AFP output stream. Example:
Example:</p>
<title>Tag Logical Element (TLE) Extension</title>
<p>The tag-logical-element extension element allows to injects TLEs into the AFP output stream. Example:</p>
<source><![CDATA[
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
@@ -601,12 +854,128 @@ out = proc.getOutputStream();]]></source>
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
[..]
<fo:page-sequence master-reference="simple">
<afp:tag-logical-element name="foo" value="bar"/>
<fo:flow flow-name="xsl-region-body">
[..]
]]></source>
<p>
The tag-logical-element extension element can appear within a simple-page-master
(page level) or it can appear as child of page-sequence (page group level).
Multiple tag-logical-element extension elements within a simple-page-master or
page-sequence are allowed. The name and value attributes are mandatory.
</p>
</section>
<section id="afp-no-operation">
<title>No Operation (NOP) Extension</title>
<p>The no-operation extension provides the ability to carry up to 32K of comments or any other type
of unarchitected data into the AFP output stream. Example:</p>
<source><![CDATA[
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
<fo:layout-master-set>
<fo:simple-page-master master-name="simple">
<afp:no-operation name="My NOP">insert up to 32k of character data here!</afp:no-operation>
</fo:simple-page-master>
</fo:layout-master-set>
]]></source>
<p>The tag-logical-element extension element can only occur within a simple-page-master.
Multiple tag-logical-element extension elements within a simple-page-master are allowed.
The name and value attributes are mandatory.
<p>The no-operation extension element can only occur within a simple-page-master.
Multiple no-operation extension elements within a simple-page-master are allowed.
The name attribute is mandatory.
</p>
</section>
<section id="afp-invoke-medium-map">
<title>Invoke Medium Map (IMM) Extension</title>
<p>
The invoke-medium-map extension allows to generate IMM fields (Invoke Medium Map) in the
generated AFP output. Example:
</p>
<source><![CDATA[
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
[..]
<fo:page-sequence master-reference="normal">
<afp:invoke-medium-map name="MYMAP"/>
<fo:flow flow-name="xsl-region-body">
[..]
]]></source>
<p>
The invoke-medium-map element is allowed as child of fo:page-sequence (page group
level) or fo:simple-page-master. It is NOT supported on document level (fo:root), yet.
FOP also doesn't support specifying medium maps inside XML (using BMM/EMM). It can
only reference an existing medium map by name. The medium map has to be constructed
through different means and available on the target platform.
</p>
</section>
<section id="afp-form-maps">
<title>Form Maps/Defs</title>
<p>
Apache FOP supports embedding an external form map resource in the
generated AFP output. This is done using the <code>afp:include-form-map</code>
extension. An example:
</p>
<source><![CDATA[
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
[..]
<fo:declarations>
<afp:include-form-map name="F1SAMP1" src="file:f1samp1.fde"/>
</fo:declarations>
]]></source>
<p>
The <code>afp:include-form-map</code> is to be placed as a direct child of
<code>fo:declarations</code>. The <code>name</code> is an AFP resource name
(max. 8 characters) and the <code>src</code> attribute is the URI identifying the
external form map resource. When such a form map is embedded, you can use the
<code>afp:invoke-medium-map</code> extension (described above) to invoke any medium
map included in the form map.
</p>
<note>
Apache FOP doesn't support a way to define a form map or medium map using XML means
inside an XSL-FO document. You will have to build the form map with some third-party
tool.
</note>
</section>
</section>
<section id="afp-foreign-attributes">
<title>Foreign Attributes</title>
<section id="afp-foreign-attributes-resource">
<title>Resource</title>
<p>The resource foreign attributes provides the ability to name and control where data object resources
(e.g. images/scalable vector graphics) will reside in the AFP output.
The afp foreign attributes are only used in conjuntion with &lt;fo:external-graphic/&gt; and &lt;instream-foreign-object/&gt;.
Example:</p>
<source><![CDATA[
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
...
<fo:block>
<fo:external-graphic width="2.0cm" content-width="2.0cm" height="1.8cm" content-height="1.8cm"
src="examples/fo/graphics/xml_feather.gif"
afp:resource-name="feather" afp:resource-level="external" afp:resource-group-file="resources.afp"/>
</fo:block>
<fo:block>
<fo:instream-foreign-object height="758.047pt" content-height="758.047pt" width="576.96pt" content-width="576.96pt"
afp:resource-name"circles" afp:resource-level="inline">
<svg xmlns="http://www.w3.org/2000/svg" width="12cm" height="12cm">
<g style="fill-opacity:0.7; stroke:black; stroke-width:0.1cm;">
<circle cx="6cm" cy="2cm" r="100" style="fill:red;" transform="translate(0,50)" />
<circle cx="6cm" cy="2cm" r="100" style="fill:blue;" transform="translate(70,150)" />
<circle cx="6cm" cy="2cm" r="100" style="fill:green;" transform="translate(-70,150)"/>
</g>
</svg>
</fo:instream-foreign-object>
</fo:block>
]]></source>
<p>The resource-level attribute where the resource object will reside in the AFP output datastream.
The possible values for this are "inline", "print-file" and "external".
When "external" is used a resource-group-file attribute must also be specified.
Please refer to the <link href="#afp-resource-level-defaults">Resource Level Defaults</link>
above to see what is used if the resource-level attribute is not specified.
</p>
<p></p>
</section>
</section>
</section>
<section id="rtf">
@@ -614,13 +983,37 @@ out = proc.getOutputStream();]]></source>
<p>
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
attempt to contain as much information from the XSL-FO document as
possible. It should be noted that is not possible (due to RTF's limitations) to map all
XSL-FO features to RTF. For complex documents, the RTF output will never reach the feature
level from PDF, for example. Thus, using RTF output is only recommended for simple documents
such as letters.
</p>
<p>
The RTF output follows Microsoft's RTF specifications
and produces best results on Microsoft Word.
</p>
<note>RTF output is currently unmaintained and lacks many features compared to other output
formats. Using other editable formats like Open Document Format, instead of producing XSL-FO
then RTF through FOP, might give better results.</note>
<p>
These are some known restrictions compared to other supported output formats (not a complete list):
</p>
<ul>
<li>
Not supported/implemented:
<ul>
<li>break-before/after (supported by the RTF library but not tied into the RTFHandler)</li>
<li>fo:page-number-citation-last</li>
<li>keeps (supported by the RTF library but not tied into the RTFHandler)</li>
<li>region-start/end (RTF limitation)</li>
<li>multiple columns</li>
</ul>
</li>
<li>Only a single page-master is supported</li>
<li>Not all variations of fo:leader are supported (RTF limitation)</li>
<li>percentages are not supported everywhere</li>
</ul>
</section>
<section id="xml">
<title>XML (Area Tree XML)</title>
@@ -653,6 +1046,16 @@ out = proc.getOutputStream();]]></source>
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.
</p>
<section id="print-issues">
<title>Known issues</title>
<p>
If you run into the problem that the printed output is incomplete on Windows:
this often happens to users printing to a PCL printer.
There seems to be an incompatibility between Java and certain PCL printer drivers
on Windows. Since most network-enabled laser printers support PostScript, try
switching to the PostScript printer driver for that printer model.
</p>
</section>
</section>
<section id="bitmap">
<title>Bitmap (TIFF/PNG)</title>
@@ -664,8 +1067,13 @@ out = proc.getOutputStream();]]></source>
<p>
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 target resolution setting
on the FOUserAgent.
page. Note: FOP can only produce multiple files (with PNG output) if
you can set a <code>java.io.File</code> indicating the primary PNG file
using the <code>FOUserAgent.setOutputFile(File)</code> method.
</p>
<p>
The quality of the bitmap depends on the target resolution setting
on the FOUserAgent and on further settings described below.
</p>
<section id="bitmap-configuration">
<title>Configuration</title>
@@ -673,15 +1081,52 @@ out = proc.getOutputStream();]]></source>
The TIFF and PNG renderer configuration currently allows the following settings:
</p>
<source><![CDATA[<renderer mime="image/png">
<color-mode>rgba</color-mode>
<transparent-page-background>true</transparent-page-background>
<background-color>white</background-color>
<anti-aliasing>true</anti-aliasing>
<rendering>quality</rendering>
<fonts><!-- described elsewhere --></fonts>
</renderer>]]></source>
<p>
The default value for the "transparent-page-background" setting is "false" which
paints an opaque, white background for the whole image. If you set this to true,
The default value for the <code>"color-mode"</code> setting is <code>"rgba"</code> which
is equivalent to a 24bit RGB image with an 8bit alpha channel for transparency.
Valid values are:
</p>
<ul>
<li><code>rgba</code>: RGB with alpha channel (24bit + 8bit = 32bit)</li>
<li><code>rgb</code>: RGB (24bit)</li>
<li><code>gray</code>: gray (8bit)</li>
<li><code>bi-level</code> (or <code>binary</code>): bi-level (1bit)</li>
</ul>
<p>
Please note that there is currently no dithering or error diffusion available for bi-level
bitmap output.
</p>
<p>
The default value for the <code>"transparent-page-background"</code> setting is
<code>"false"</code> which paints an opaque, white background for the whole image.
If you set this to <code>"true"</code>,
no such background will be painted and you will get a transparent image if
an alpha channel is available in the output format.
</p>
<p>
The default value for the <code>"background-color"</code> setting is <code>"white"</code>.
The color specifies in which color the page background is painted. It will only be
painted if <code>"transparent-page-background"</code> is not set to <code>"true"</code>.
All XSL-FO colors (including color functions) can be used.
</p>
<p>
The default value for the <code>"anti-aliasing"</code> setting is <code>"true"</code>.
You can set this value to <code>"false"</code> to disable anti-aliasing and
thus improve rendering speeds a bit at the loss of some image quality.
</p>
<p>
The default value for the <code>"rendering"</code> setting is <code>"true"</code>.
You can set this value to <code>"false"</code> to improve rendering speeds a bit
at the loss of some image quality. If this setting has an actual effect depends
on the JVM's Java2D backend.
</p>
</section>
<section id="tiff-configuration">
<title>TIFF-specific Configuration</title>
@@ -702,17 +1147,22 @@ out = proc.getOutputStream();]]></source>
actual codecs being available. Here is a list of possible values:
</p>
<ul>
<li>NONE (no compression)</li>
<li>PackBits (RLE, run-length encoding)</li>
<li>JPEG</li>
<li>Deflate</li>
<li>LZW</li>
<li>ZLib</li>
<li>CCITT T.4 (Fax Group 3)</li>
<li>CCITT T.6 (Fax Group 4)</li>
<li><code>NONE</code> (no compression)</li>
<li><code>PackBits</code> (RLE, run-length encoding)</li>
<li><code>JPEG</code></li>
<li><code>Deflate</code></li>
<li><code>LZW</code></li>
<li><code>ZLib</code></li>
<li><code>CCITT T.4</code> (Fax Group 3)</li>
<li><code>CCITT T.6</code> (Fax Group 4)</li>
</ul>
<p>
This setting may override any setting made using the <code>"color-mode"</code>. For example, if
<code>"CCITT T.6"</code> is selected, the color mode is automatically forced to <code>"bi-level"</code> because
this compression format only supports bi-level images.
</p>
<note>
If you want to use CCITT compression, please make sure you've got a J2SE 1.4 or later and
If you want to use CCITT compression, please make sure you've got
<a href="http://java.sun.com/products/java-media/jai/current.html">
Java Advanced Imaging Image I/O Tools
</a>
@@ -721,6 +1171,17 @@ out = proc.getOutputStream();]]></source>
Deflate and JPEG compression for writing.
</note>
</section>
<section id="bitmap-rendering-options">
<title>Runtime Rendering Options</title>
<p>
The IF-based bitmap output implementations support a rendering option with the key
"target-bitmap-size" (value: java.awt.Dimension) that allows to force the pages to
be proportionally fit into a bitmap of a given size. This can be used to produce
thumbnails or little preview images of the individual pages. An example:
</p>
<source><![CDATA[userAgent.getRenderingOptions().put(
"target-bitmap-size", new Dimension(320, 200));]]></source>
</section>
</section>
<section id="txt">
<title>TXT</title>
@@ -803,3 +1264,5 @@ out = proc.getOutputStream();]]></source>
</body>
</document>




src/documentation/content/xdocs/0.94/pdfa.xml → src/documentation/content/xdocs/1.0/pdfa.xml View File

@@ -28,9 +28,6 @@
<body>
<section id="overview">
<title>Overview</title>
<warning>
Support for PDF/A is available beginning with version 0.92.
</warning>
<p>
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
@@ -56,8 +53,9 @@
lack of a full license to get a detailed error protocol.
</p>
<p>
<strong>PDF/A-1a</strong> is not implemented, yet. This is mostly because of the requirement
for tagged PDF which is not available in FOP, yet.
<strong>PDF/A-1a</strong> is based on PDF-A-1b and adds accessibility features
(such as Tagged PDF). This format is available within the limitation described on
the <a href="accessibility.html">Accessibility page</a>.
</p>
</section>
<section id="command-line">
@@ -67,6 +65,9 @@
as a parameter. If there is a violation of one of the validation rules for
PDF/A, an error message is presented and the processing stops.
</p>
<p>
PDF/A-1a is enabled by specifying "-pdfprofile PDF/A-1a".
</p>
</section>
<section id="embedded">
<title>Usage (embedded)</title>
@@ -83,6 +84,9 @@ Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent);
If one of the validation rules of PDF/A is violated, an PDFConformanceException
(descendant of RuntimeException) is thrown.
</p>
<p>
For PDF/A-1a, just use the string "PDF/A-1a" instead of "PDF/A-1b".
</p>
</section>
<section id="rules">
<title>PDF/A in Action</title>
@@ -121,12 +125,17 @@ Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent);
embedded in clear text so non-PDF-aware applications can extract the XMP metadata.
</li>
</ul>
<note>
There are additional requirements if you want to enabled PDF/A-1a (Tagged PDF). This is
particularly the specification of the natural language and alternative descriptions for
images. Please refer to the <a href="accessibility.html">Accessibility page</a> for details.
</note>
</section>
<section id="profile-compatibility">
<title>PDF profile compatibility</title>
<p>
The PDF profiles "PDF/X-3:2003" and "PDF/A-1b" are compatible and can both be
activated at the same time.
The PDF profiles "PDF/X-3:2003" and "PDF/A-1b" (or "PDF/A-1a") are compatible and can
both be activated at the same time.
</p>
</section>
<section id="interoperability">

src/documentation/content/xdocs/0.94/pdfencryption.xml → src/documentation/content/xdocs/1.0/pdfencryption.xml View File

@@ -204,15 +204,13 @@ Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent);
</p>
<ol>
<li>
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.
Download the binary distribution for your JDK version.
</li>
<li>
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
<code>fop.sh</code>. If you have JDK 1.3 or earlier don't forget to
install the JCE as well.
<code>fop.sh</code>.
</li>
<li>
Open the <code>java.security</code> file and add<br/>

src/documentation/content/xdocs/0.94/pdfx.xml → src/documentation/content/xdocs/1.0/pdfx.xml View File

@@ -28,8 +28,8 @@
<section id="overview">
<title>Overview</title>
<warning>
Support for PDF/X was made available beginning with version 0.93.
This feature is new and may not be 100% complete, yet. Feedback is welcome.
Support for PDF/X is available beginning with version 0.93. This feature is new and
may not be 100% complete, yet. Feedback is welcome.
</warning>
<p>
PDF/X is a standard which faciliates prepress digital data exchange using PDF.

src/documentation/content/xdocs/0.94/running.xml → src/documentation/content/xdocs/1.0/running.xml View File

@@ -28,21 +28,24 @@
<title>System Requirements</title>
<p>The following software must be installed:</p>
<ul>
<li>Java 1.3.x or later Runtime Environment.</li>
<li>
Apache FOP. The <a href="../download.html">FOP distribution</a> includes all libraries that you will
need to run a basic FOP installation. These can be found in the [fop-root]/lib directory. These
libraries include the following:
Java 1.4.x or later Runtime Environment.
<ul>
<li>
A JAXP-compatible XML Parser (FOP comes with <a class="fork" href="ext:xerces">Apache Xerces-J</a>).
</li>
<li>
A JAXP-compatible XSLT Processor (FOP comes with <a class="fork" href="ext:xalan">Apache Xalan-J</a>).
Many JREs >=1.4 contain older JAXP implementations (which often contain bugs). It's
usually a good idea to replace them with a current implementation.
</li>
</ul>
</li>
<li>
Apache FOP. The <a href="../download.html">FOP distribution</a> includes all libraries that you will
need to run a basic FOP installation. These can be found in the [fop-root]/lib directory. These
libraries include the following:
<ul>
<li><a class="fork" href="ext:xmlgraphics.apache.org/commons">Apache XML Graphics Commons</a>, an shared library for Batik and FOP.</li>
<li><a class="fork" href="ext:batik">Apache Batik</a>, an SVG library.</li>
<li><a class="fork" href="ext:jakarta/commons/logging">Apache Jakarta Commons Logging</a>, a logger abstraction kit.</li>
<li><a class="fork" href="ext:jakarta/commons/io">Apache Jakarta Commons IO</a>, a library with I/O utilities.</li>
<li><a class="fork" href="ext:commons-logging">Apache Commons Logging</a>, a logger abstraction kit.</li>
<li><a class="fork" href="ext:commons-io">Apache Commons IO</a>, a library with I/O utilities.</li>
<li><a class="fork" href="ext:excalibur/framework">Apache Excalibur/Avalon Framework</a>, for XML configuration handling.</li>
</ul>
</li>
@@ -51,8 +54,7 @@
<ul>
<li>
Graphics libraries. Generally, FOP contains direct support for the most important
bitmap image formats (including PNG, TIFF, JPEG and GIF). If you're using JDK 1.3,
you may need additional packages to get GIF images to work. See
bitmap image formats (including PNG, JPEG and GIF). See
<a href="graphics.html">FOP: Graphics Formats</a> for details.
</li>
<li>
@@ -62,7 +64,7 @@
<p>In addition, the following system requirements apply:</p>
<ul>
<li>
If you will be using FOP to process SVG, you must do so in a graphical environment.
If you will be using FOP to process SVG, you must do so in a graphical environment.
See <a href="graphics.html#batik">FOP: Graphics (Batik)</a> for details.
</li>
</ul>
@@ -72,19 +74,19 @@
<section id="install-instruct">
<title>Instructions</title>
<p>
Basic FOP installation consists of first unzipping the <code>.gz</code> file that is the
distribution medium, then unarchiving the resulting <code>.tar</code> 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
Basic FOP installation consists of first unzipping the <code>.gz</code> file that is the
distribution medium, then unarchiving the resulting <code>.tar</code> 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.
</p>
</section>
<section id="install-problems">
<title>Problems</title>
<p>
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
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 <code>tar -xzf</code> instead.
</p>
</section>
@@ -94,30 +96,31 @@
<section id="fop-script">
<title>Using the fop script or batch file</title>
<p>
The usual and recommended practice for starting FOP from the command line is to run the
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).
These scripts 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
These scripts 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 <code>/Library/Java/Home</code>. <strong>Caveat:</strong>
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
<a href="http://developer.apple.com/java/faq">Java on Mac OSX FAQ</a> for information as
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
<a href="http://developer.apple.com/java/faq">Java on Mac OSX FAQ</a> for information as
it becomes available.
</p>
<source><![CDATA[
USAGE
Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl|-ps|-txt|-at [mime]|-print] <outfile>
[OPTIONS]
-d debug mode
-x dump configuration settings
-q quiet mode
[OPTIONS]
-version print FOP version and exit
-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
-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
-v run in verbose mode (currently simply print FOP version and continue)

-o [password] PDF file will be encrypted with option owner password
-u [password] PDF file will be encrypted with option user password
@@ -125,62 +128,73 @@ Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl
-nocopy PDF file will be encrypted without copy content permission
-noedit PDF file will be encrypted without edit content permission
-noannotations PDF file will be encrypted without edit annotation permission
-a enables accessibility features (Tagged PDF etc., default off)
-pdfprofile prof PDF file will be generated with the specified profile
(Examples for prof: PDF/A-1b or PDF/X-3:2003)

[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
-atin infile area tree input file
-xsl stylesheet xslt stylesheet
-conserve Enable memory-conservation policy (trades memory-consumption for disk I/O)
(Note: currently only influences whether the area tree is serialized.)

[INPUT]
infile xsl:fo input file (the same as the next)
(use '-' for infile to pipe input from stdin)
-fo infile xsl:fo input file
-xml infile xml input file, must be used together with -xsl
-atin infile area tree input file
-ifin infile intermediate format input file
-imagein infile image input file (piping through stdin not supported)
-xsl stylesheet xslt stylesheet

-param name value <value> to use for parameter <name> in xslt stylesheet
(repeat '-param name value' for each parameter)
[OUTPUT]

-catalog use catalog resolver for input XML and XSLT files
[OUTPUT]
outfile input will be rendered as PDF into outfile
(use '-' for outfile to pipe output to stdout)
-pdf outfile input will be rendered as PDF (outfile req'd)
-pdfa1b outfile input will be rendered as PDF/A-1b compliant PDF
(outfile req'd, same as "-pdf outfile -pdfprofile PDF/A-1b")
-awt input will be displayed on screen
-awt input will be displayed on screen
-rtf outfile input will be rendered as RTF (outfile req'd)
-pcl outfile input will be rendered as PCL (outfile req'd)
-ps outfile input will be rendered as PostScript (outfile req'd)
-pcl outfile input will be rendered as PCL (outfile req'd)
-ps outfile input will be rendered as PostScript (outfile req'd)
-afp outfile input will be rendered as AFP (outfile req'd)
-tiff outfile input will be rendered as TIFF (outfile req'd)
-png outfile input will be rendered as PNG (outfile req'd)
-txt outfile input will be rendered as plain text (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
-txt outfile input will be rendered as plain text (outfile req'd)
-at [mime] out representation of area tree as XML (outfile req'd)
specify optional mime output to allow the AT to be converted
to final format later
-if [mime] out representation of document in intermediate format XML (outfile req'd)
specify optional mime output to allow the IF to be converted
to final format later
-print input file will be rendered and sent to the printer
see options with "-print help"
-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)
-mif outfile input will be rendered as MIF (FrameMaker) (outfile req'd)
Experimental feature - requires additional fop-sandbox.jar.
-svg outfile input will be rendered as an SVG slides file (outfile req'd)
-svg outfile input will be rendered as an SVG slides file (outfile req'd)
Experimental feature - requires additional fop-sandbox.jar.

-foout outfile input will only be XSL transformed. The intermediate
XSL-FO file is saved and no rendering is performed.
-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]]></source>
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 -xml - -xsl foo.xsl -pdf -
fop foo.fo -mif foo.mif
fop foo.fo -rtf foo.rtf
fop foo.fo -print
fop foo.fo -awt]]></source>
<p>
PDF encryption is only available if FOP was compiled with encryption support
<strong>and</strong> if compatible encryption support is available at run time.
PDF encryption is only available if FOP was compiled with encryption support
<strong>and</strong> if compatible encryption support is available at run time.
Currently, only the JCE is supported. Check the <a href="pdfencryption.html">Details</a>.
</p>
</section>
@@ -192,8 +206,8 @@ Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl
org.apache.fop.cli.Main &lt;arguments></code>. The arguments
consist of the options and infile and outfile specifications
as shown above for the standard scripts. You may wish to review
the standard scripts to make sure that
you get your environment properly configured.
the standard scripts to make sure that
you get your environment properly configured.
</p>
</section>
<section id="jar-option">
@@ -214,7 +228,7 @@ Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl
directory in a single directory. If you use hyphenation, you
must also put <code>fop-hyph.jar</code> in that directory.</p>

<p>In both cases the arguments consist of the options and
<p>In both cases the arguments consist of the options and
infile and outfile specifications as shown above for the
standard scripts.</p>
</section>
@@ -222,65 +236,65 @@ Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl
<title>FOP's dynamical classpath construction</title>

<p>If FOP is started without a proper classpath, it tries to
add its dependencies dynamically. If the system property
<code>fop.home</code> contains the name of a directory, then
FOP uses that directory as the base directory for its
search. Otherwise the current working directory is the base
directory. If the base directory is called <code>build</code>,
then its parent directory becomes the base directory.</p>
add its dependencies dynamically. If the system property
<code>fop.home</code> contains the name of a directory, then
FOP uses that directory as the base directory for its
search. Otherwise the current working directory is the base
directory. If the base directory is called <code>build</code>,
then its parent directory becomes the base directory.</p>

<p>FOP expects to find <code>fop.jar</code> in the
<code>build</code> subdirectory of the base directory, and
adds it to the classpath. Subsequently FOP adds all
<code>jar</code> files in the lib directory to the
classpath. The lib directory is either the <code>lib</code>
subdirectory of the base directory, or, if that does not
exist, the base directory itself.</p>
<code>build</code> subdirectory of the base directory, and
adds it to the classpath. Subsequently FOP adds all
<code>jar</code> files in the lib directory to the
classpath. The lib directory is either the <code>lib</code>
subdirectory of the base directory, or, if that does not
exist, the base directory itself.</p>

<p>If the system property <code>fop.optional.lib</code>
contains the name of a directory, then all <code>jar</code>
files in that directory are also added to the classpath. See
the methods <code>getJARList</code> and
<code>checkDependencies</code> in
<code>org.apache.fop.cli.Main</code>.</p>
contains the name of a directory, then all <code>jar</code>
files in that directory are also added to the classpath. See
the methods <code>getJARList</code> and
<code>checkDependencies</code> in
<code>org.apache.fop.cli.Main</code>.</p>

</section>
</section>
<section id="check-input">
<title>Using Xalan to Check XSL-FO Input</title>
<p>
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
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
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
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
<a href="../resources.html#specs">Specifications</a> and
The FOP development team does not have resources to help with stylesheet issues,
although we have included links to some useful
<a href="../resources.html#specs">Specifications</a> and
<a href="../resources.html#articles">Books/Articles</a>.
If the problem is in the second process, FOP may have a bug or an unimplemented
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.
</p>
<note>The user is always responsible to provide correct XSL-FO code to FOP.</note>
<p>
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
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)
</p>
<note>
When asking for help on the FOP mailing lists, <em>never</em> 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
When asking for help on the FOP mailing lists, <em>never</em> 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.
</note>
<p>
The -foout option works the same way as if you would call the
The -foout option works the same way as if you would call the
<a href="http://xml.apache.org/xalan-j/commandline.html">Xalan command-line</a>:
</p>
<p>
@@ -302,39 +316,39 @@ Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl
</p>
<ul>
<li>
Increase memory available to the JVM. See
<a href="http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/java.html">the -Xmx option</a>
Increase memory available to the JVM. See
<a href="http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/java.html">the -Xmx option</a>
for more information.
<warning>
It is usually unwise to increase the memory allocated to the JVM beyond the amount of
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.
</warning>
</li>
<li>
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
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
(<a href="../faq.html#pagenum">"page N of TOTAL"</a>).
Forward references cause all subsequent pages to be held in memory until the reference
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
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
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).
</li>
<li>
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
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.
</li>
<li>
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
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.
</li>

src/documentation/content/xdocs/0.94/servlets.xml → src/documentation/content/xdocs/1.0/servlets.xml View File

@@ -161,7 +161,7 @@ public void init() throws ServletException {
<ul>
<li>
Instead of java.io.ByteArrayOutputStream consider using the ByteArrayOutputStream
implementation from the <a href="ext:jakarta/commons/io">Jakarta Commons IO project</a> which allocates less memory.
implementation from the <a href="ext:commons-io">Jakarta Commons IO project</a> which allocates less memory.
The full class name is: <code>org.apache.commons.io.output.ByteArrayOutputStream</code>
</li>
<li>

src/documentation/content/xdocs/0.94/upgrading.xml → src/documentation/content/xdocs/1.0/upgrading.xml View File

@@ -31,8 +31,10 @@
</p>
<ul>
<li>
More than half of the codebase has been rewritten over the last three years. With version 0.93 the code has reached <strong>production level</strong>, and
the tradition continues with version 0.94.
More than half of the codebase has been rewritten over the
last three years. With version 0.93 the code has reached
<strong>production level</strong>, and continues to improve with
version 0.94.
</li>
<li>
The API of FOP has changed considerably and is not
@@ -48,18 +50,17 @@
</li>
<li>
If you are using a configuration file for version 0.20.5, you have to rebuild it in the new format. The format
of the configuration files has changed since version 0.20.5. See <code>conf/fop.xconf</code> for
of the configuration files has changed since version 0.20.5. See conf/fop.xconf for
an example configuration file. A XML Schema file can be found under
<code>src/foschema/fop-configuration.xsd</code>.
src/foschema/fop-configuration.xsd.
</li>
<li>
If you are using font metrics files for version 0.20.5 or
0.92 or earlier, you have to regenerate them in the new
format. The new format is characterized by a version
attribute on the top-level font-metrics element, whose value
is 2.0. The absence of a version attribute will be
interpreted as version 1.0, and such metrics files will no
longer be parsed.
Beginning with version 0.94 you can skip the generation of
font metric files and remove the "font-metrics" attribute
in the font configuration. In the unlikely case that due to
a bug you still need to use font metrics files you will need
to regenerate the font metrics file if yours are from a FOP
version before 0.93.
</li>
<li>
<p>
@@ -69,7 +70,7 @@
</p>
<note label="An example">
While FOP 0.20.5 allowed you to have empty <code>fo:table-cell</code> elements, the new code
will complain about that (unless <a href="/0.94/running.html#fop-script">relaxed validation is enabled</a> via the <code>-r</code> switch via the command line) because the specification
will complain about that (unless relaxed validation is enabled) because the specification
demands at least one block-level element (<code>(%block;)+</code>, see
<a href="http://www.w3.org/TR/xsl/#fo_table-cell">XSL-FO 1.1, 6.7.10</a>)
inside an <code>fo:table-cell</code> element.
@@ -121,11 +122,6 @@
The <code>fox:outline</code> extension is not implemented in this version anymore.
It has been superseded by the new bookmark elements from XSL-FO 1.1.
</li>
<li>
The <code>fox:destination</code> extension is also not implemented in this version
although it may be added in the future. See also
<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=37157">Bug 37157</a>.
</li>
</ul>
</section>
</body>

+ 113
- 826
src/documentation/content/xdocs/compliance.ihtml
File diff suppressed because it is too large
View File


+ 24
- 12
src/documentation/content/xdocs/dev/release.xml View File

@@ -37,16 +37,26 @@ The purpose of documenting it here is to facilitate consistency, ensure that the
<li>Determine whether further testing is required.</li>
<li>Commit any outstanding changes</li>
<li>Create a branch called <code>branches/fop-v_vv</code></li>
<li>Edit release notes (<code>README</code> and <code>status.xml</code> in the root).</li>
<li>Update the <code>index.xml</code>, <code>site.xml</code> and <code>download.xml</code> for the new version.</li>
<li>Edit release notes (<code>README</code> and
<code>status.xml</code> in the root).</li>
<li>Add the release to <code>news-data.xml</code>;
remove links to release notes of older versions from this file.</li>
<li>Update the FAQ (<code>faq.xml</code>) to the new release.</li>
<li>Check and update the copyright year in NOTICE and build.xml.</li>
<li>Update the file <code>doap.rdf</code>, and the files
<code>index.xml</code>, <code>site.xml</code>,
<code>download.xml</code>, <code>fo.xml</code>,
<code>maillist.xml</code>, <code>quickstartguide.xml</code>,
<code>faq.xml</code> and <code>status.xml</code>
in directory <code>xdocs</code> for the new version.</li>
<li>Update the version numbers in the release column on the
compliance page (<code>compliance.xml</code>); update the compliance in the release column
to the current state (development column).</li>
<li>Update version number in <code>build.xml</code> (not to be merged back
into trunk).</li>
<li>Copy trunk documentation directory to a new directory with
the version number, and update any links and the .htaccess
file for redirections.</li>
the new version number, and update the .htaccess file for
redirections.</li>
<li>Copy <code>test/fotree/disabled-testcases.xml</code> and
<code>test/layoutengine/disabled-testcases.xml</code> to the
new version directory
@@ -54,17 +64,19 @@ The purpose of documenting it here is to facilitate consistency, ensure that the
<code>&lt;version>/layoutengine/disabled-testcases.xml</code>.
Copy <code>known-issues.xml</code> to the new version
directory. Copy <code>knownissues-overview.xml</code> from the
previous to the new version directory.</li>
current to the new version directory, and update the <code>xi:include</code>
links in it.</li>
<li>Update the tab names and directories in tabs.xml</li>
<li>Delete the previous version directory.</li>
<li>Build the dist files (<code>build[.sh] dist</code>)
and upload them to your web directory on
<code>people.apache.org</code></li>
<li>Ask on fop-dev to check the branch and the generated dist
files for errors.</li>
<li>Tag the source tree with the release ID. For example, if the release is 0.94:
<code>svn copy https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_94 https://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-0_94</code></li>
<li>Tag the source tree with the release ID. For example, if the release is 1.0:
<code>svn copy https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-1_0 https://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-1_0</code></li>
<li>Make a fresh checkout with the just created tag:
<code>svn co https://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-0_94</code></li>
<code>svn co https://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-1_0</code></li>
<li>Copy jimi and jai to lib/ (jimi-1.0.jar, jai_core.jar, jai_codec.jar)</li>
<li>Copy jce-jdk13-119.jar from <link href="http://www.bouncycastle.org/latest_releases.html">
from http://www.bouncycastle.org/latest_releases.html</link> to lib/</li>
@@ -74,15 +86,15 @@ The purpose of documenting it here is to facilitate consistency, ensure that the
<li>Alternatively, create a build-local.properties file that points to the above libs.</li>
<li>Run build[.sh] dist. Do this using Sun JDK 1.4.2_08 or later. A Forrest installation is needed.</li>
<li>Create signatures. Don't forget to upload your KEY:
<code>gpg -a -b --force-v3-sigs fop-0.94-src.tar.gz</code> etc.</li>
<code>gpg -a -b --force-v3-sigs fop-1.0-src.tar.gz</code> etc.</li>
<li>Upload the dist and signature files to your web directory
on people.apache.org (An account on minotaur is needed):
<code>scp fop-0.94*.tar.gz*
<code>scp fop-1.0*.tar.gz*
chrisg@people.apache.org:public_html/</code></li>
<li>Check permissions:
<code>chmod 664 ... ; chgrp xmlgraphics ...</code></li>
<li>Add MD5 sums: <code>md5 fop-0.94-src.tar.gz &gt;
fop-0.94-src.tar.gz.md5</code> etc.</li>
<li>Add MD5 sums: <code>md5 fop-1.0-src.tar.gz &gt;
fop-1.0-src.tar.gz.md5</code> etc.</li>
<li>Make a test download.</li>
<li>Start a vote for the release on
<code>general@xmlgraphics.a.o</code>. The message should point

+ 8
- 8
src/documentation/content/xdocs/download.xml View File

@@ -91,16 +91,16 @@
<tr>
<td>Repository URL</td>
<td>
<link href="http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-0_95/">
<code>http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-0_95/</code>
<link href="http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-1_0/">
<code>http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-1_0/</code>
</link>
</td>
</tr>
<tr>
<td>Web view</td>
<td>
<link href="http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-0_95/">
<code>http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-0_95/</code>
<link href="http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-1_0/">
<code>http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-1_0/</code>
</link>
</td>
</tr>
@@ -110,16 +110,16 @@
<tr>
<td>Repository URL</td>
<td>
<link href="http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-0_94/">
<code>http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-0_94/</code>
<link href="http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-0_95/">
<code>http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-0_95/</code>
</link>
</td>
</tr>
<tr>
<td>Web view</td>
<td>
<link href="http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-0_94/">
<code>http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-0_94/</code>
<link href="http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-0_95/">
<code>http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-0_95/</code>
</link>
</td>
</tr>

+ 1
- 1
src/documentation/content/xdocs/examples.xml View File

@@ -82,7 +82,7 @@
</p>
<p>
Developers will find the first steps to a test suite for all implemented
formatting objects and properties in xml-fop/test/xml/.
formatting objects and properties in test/xml in the source distribution.
</p>
</section>
<section>

+ 45
- 56
src/documentation/content/xdocs/faq.xml View File

@@ -136,14 +136,13 @@
<question>When is the next released planned?</question>
<answer>
<p>
When it's ready and the committers have enough time to go through
the time-consuming process of creating a release. We
released version 0.95 on August 6th, 2008, and intend to
release version 1.0 once we consider it "feature complete", major
work is still in progress regarding page flows with changing page width
(changing IPD, to be precise). If you
want to speed up the process, consider
<link href="dev/index.html#involved">contributing</link> to FOP.</p>
When it's ready and the committers have enough time to go
through the time-consuming process of creating a release. We
released version 1.0 in July 2010, and will release version
1.1 when we accumulated enough additions and bug fixes. If
you want to speed up the process, consider <link
href="dev/index.html#involved">contributing</link> to
FOP.</p>
</answer>
</faq>
<faq id="redesign">
@@ -198,10 +197,8 @@
<p>If you are running FOP from the command line:</p>
<ul>
<li>
Use the <code>fop.bat</code>, <code>fop</code> or <code>fop.sh</code> command file from the FOP
distribution. If you have a FOP version older than 0.20.5,
ensure the directory where FOP and these files have been
installed is the current working directory.
Use the command file <code>fop.bat</code>, <code>fop.cmd</code> or <code>fop.js</code> on MS Windows, or <code>fop</code> on Unix/Linux from the FOP
distribution.
</li>
<li>
If this doesn't help, check whether still all the jar files
@@ -213,7 +210,7 @@
If you run FOP embedded in your servlet, web application or
other Java application, check the classpath of the
application. Check the also the information pertaining to <link
href="0.95/servlets.html#servlet-engine">servlet engines</link>
href="1.0/servlets.html#servlet-engine">servlet engines</link>
for further hints.
</p>
<p>
@@ -243,7 +240,7 @@
<question>I get an OutOfMemoryException.</question>
<answer>
<p>
See <link href="0.95/running.html#memory">FOP Memory</link>.
See <link href="1.0/running.html#memory">FOP Memory</link>.
</p>
</answer>
</faq>
@@ -304,7 +301,7 @@
<p>
If you use XSLT, problems in your style sheet and in your
source XML also can produce a NullPointerException. <link
href="0.95/running.html#check-input">Run the transformation
href="1.0/running.html#check-input">Run the transformation
separately</link> to check for this, usually you'll get a
detailed error message from the XSLT processor.
</p>
@@ -382,7 +379,7 @@
</p>
<p>
Try also setting the <link
href="0.95/configuration.html#general-elements">font-base
href="1.0/configuration.html#general-elements">font-base
configuration</link>.
</p>
</answer>
@@ -443,7 +440,7 @@ public class DefaultErrorListener implements ErrorListener {
<p>
To avoid the warning you can simply delete the
old Font Cache file, which lives in ${base}\conf\font.cache (see <link
href="0.95/configuration.html#general-elements">font-base
href="1.0/configuration.html#general-elements">font-base
configuration</link>). Or you can disable Font Caching altogether using
the option "use-cache."
</p>
@@ -453,7 +450,7 @@ public class DefaultErrorListener implements ErrorListener {
<part id="part-output">
<title>Problems with FOP output</title>
<faq id="leader-expansion">
<question>Leaders don't work anymore in 0.94 or later. Instead of
<question>Leaders don't work in current FOP. Instead of
filling the line, only three dots or a short ruler is
output.</question>
<answer>
@@ -534,7 +531,7 @@ Check the following:</p>
<p>Other possibilities:</p>
<ul>
<li>The image format is not supported or not supported completely.
See <link href="0.95/graphics.html">FOP Graphics Formats</link> for a
See <link href="1.0/graphics.html">FOP Graphics Formats</link> for a
list of supported formats and related issues.</li>
<li>The graphic may be too large to fit into the intended space.</li>
<li>There may be something (static content) that is obscuring the
@@ -546,14 +543,14 @@ Check the following:</p>
<faq id="png-fails">
<question>My graphical images do not work properly.</question>
<answer>
<p>See <link href="0.95/graphics.html">FOP Graphics Formats</link> for a
<p>See <link href="1.0/graphics.html">FOP Graphics Formats</link> for a
list of supported graphics formats and related issues.</p>
</answer>
</faq>
<faq id="graphic-resolution">
<question>Why is my graphic rendered at a different resolution than it was created?</question>
<answer>
<p>See <link href="0.95/graphics.html#resolution">Graphics Resolution</link>.</p>
<p>See <link href="1.0/graphics.html#resolution">Graphics Resolution</link>.</p>
</answer>
</faq>
<faq id="keep-with">
@@ -561,16 +558,11 @@ Check the following:</p>
don't work.</question>
<answer>
<p>
These properties are not implemented on version 0.20.5 and earlier,
except on table rows. More recent FOP releases have extensive support for
these properties. The current release, FOP 0.95, still supports the
Current FOP releases have extensive support for
these properties. The current release, FOP 1.0, still supports the
values "always" and "never" only, no numerical values. There may be
a few places where keep-* still don't work, this should be very rare.
</p>
<p>
If you still have to use FOP 0.20.5, you have to nest stuff to be
kept together in a table.
</p>
<p>
The concept is called &#8220;blind table&#8221;. The table is used for
pure layout reasons and is not obvious in the output.
@@ -604,9 +596,7 @@ Check the following:</p>
<question>My tables are missing, or missing their content.</question>
<answer>
<p>
Check for <code>fo:table-body</code> around the rows. FOP up to 0.20.4 doesn't
raise an error if it is omitted, it just drops the content. More
recent releases will catch this problem.
Check for <code>fo:table-body</code> around the rows. Usually FOP will catch this problem.
</p>
<p>
Also, the <code>fo:table-with-caption</code> element is not implemented, tables
@@ -656,7 +646,7 @@ Check the following:</p>
</answer>
</faq>
<faq id="keep-together">
<question>FOP 0.95 and FOP 0.94 behave differently when <code>keep-together="always"</code>
<question>FOP behaves differently from earlier versions when <code>keep-together="always"</code>
is set on table cells</question>
<answer>
<p>Support for inline-level keeps has been added in FOP 0.95, and setting
@@ -712,7 +702,7 @@ Check the following:</p>
<answer>
<p>Make sure you have set the language and optionally the country attributes for an appropriate XSL-FO element (fo:page-sequence, fo:block or fo:character):</p>
<source><![CDATA[<fo:page-sequence language="fi">]]></source>
<p>See <link href="0.95/hyphenation.html#support">Hyphenation Support</link> for details and instructions on using hyphenation with FOP.</p>
<p>See <link href="1.0/hyphenation.html#support">Hyphenation Support</link> for details and instructions on using hyphenation with FOP.</p>
<p>Explicitly enable hyphenation for an appropriate XSL-FO element (fo:block, fo:character):</p>
<source><![CDATA[<fo:block hyphenate="true">]]></source>
</answer>
@@ -721,7 +711,6 @@ Check the following:</p>
<question>When I use margins, my content in a nested table or block-containers gets indented twice. Is this a bug?</question>
<answer>
<p>
(Applies to version 0.90 and later)
No, although you might easily think so. The problem has to do
with property inheritance of the start-indent and end-indent
properties to which the margin properties are mapped. Apache
@@ -747,7 +736,7 @@ Check the following:</p>
than Java2D. These can lead to different layout decisions when the same document is
rendered with different renderers. An alternative approach to fix this problem might be
available but it hasn't been tested, yet. See also the
<link href="0.95/output.html#general-fonts">notes on fonts in the various output formats</link>.
<link href="1.0/output.html#general-fonts">notes on fonts in the various output formats</link>.
</p>
</answer>
</faq>
@@ -758,7 +747,7 @@ Check the following:</p>
<question>How do I use FOP in a servlet?</question>
<answer>
<p>
See <link href="0.95/servlets.html">Using FOP in a Servlet</link>.
See <link href="1.0/servlets.html">Using FOP in a Servlet</link>.
</p>
</answer>
</faq>
@@ -767,7 +756,7 @@ Check the following:</p>
transformation?</question>
<answer>
<p>
See <link href="0.95/servlets.html#xslt">Using FOP in a Servlet with XSLT Transformation</link>.
See <link href="1.0/servlets.html#xslt">Using FOP in a Servlet with XSLT Transformation</link>.
</p>
</answer>
</faq>
@@ -775,7 +764,7 @@ Check the following:</p>
<question>How do I pass parameters to the XSLT transformation?</question>
<answer>
<p>
See <link href="0.95/servlets.html#xslt">Using FOP in a Servlet with XSLT Transformation</link>.
See <link href="1.0/servlets.html#xslt">Using FOP in a Servlet with XSLT Transformation</link>.
</p>
</answer>
</faq>
@@ -793,7 +782,7 @@ Check the following:</p>
<question>How do I set the baseDir property in a servlet environment?</question>
<answer>
<p>
See <link href="0.95/embedding.html#config-internal">Setting the Configuration Programmatically</link>.
See <link href="1.0/embedding.html#config-internal">Setting the Configuration Programmatically</link>.
</p>
</answer>
</faq>
@@ -801,7 +790,7 @@ Check the following:</p>
<question>How do I use a user configuration file from a servlet?</question>
<answer>
<p>
See <link href="0.95/embedding.html#config-external">Using a Configuration File in an Embedded App</link>.
See <link href="1.0/embedding.html#config-external">Using a Configuration File in an Embedded App</link>.
</p>
</answer>
</faq>
@@ -810,7 +799,7 @@ Check the following:</p>
get FOP working for various servlet engines?</question>
<answer>
<p>
See <link href="0.95/servlets.html#servlet-engine">Servlet Engines</link>.
See <link href="1.0/servlets.html#servlet-engine">Servlet Engines</link>.
</p>
</answer>
</faq>
@@ -818,7 +807,7 @@ Check the following:</p>
<question>Can FOP be used in multithreaded environments?</question>
<answer>
<p>
See <link href="0.95/embedding.html#multithreading">Multithreading FOP</link>.
See <link href="1.0/embedding.html#multithreading">Multithreading FOP</link>.
</p>
</answer>
</faq>
@@ -829,13 +818,13 @@ Check the following:</p>
<question>The rendering of SVG text in my PDF is of poor quality.
Can I control this?</question>
<answer>
<p>See <link href="0.95/graphics.html#svg-pdf-text">Placing SVG Text into PDF</link>.</p>
<p>See <link href="1.0/graphics.html#svg-pdf-text">Placing SVG Text into PDF</link>.</p>
</answer>
</faq>
<faq id="svg-headless">
<question>How do I use FOP with SVG on headless servers?</question>
<answer>
<p>See <link href="0.95/graphics.html#batik">FOP: Graphics (Batik)</link>.</p>
<p>See <link href="1.0/graphics.html#batik">FOP: Graphics (Batik)</link>.</p>
</answer>
</faq>
<faq id="svghangs">
@@ -898,14 +887,14 @@ Can I control this?</question>
<faq id="svg-scaling">
<question>Why is my SVG rendered at a size different from that specified in my fo:external-graphic element?</question>
<answer>
<p>See <link href="0.95/graphics.html#svg-scaling">SVG Scaling</link>.</p>
<p>See <link href="1.0/graphics.html#svg-scaling">SVG Scaling</link>.</p>
</answer>
</faq>
<faq id="svg-attribute-required">
<question>FOP fails with something like "The attribute "width" of the element &lt;rect&gt; is required". What's wrong?</question>
<answer>
<p>
This phenomenon occurs since FOP 0.92 beta. It surfaced due to a change in the handling of non-FO namespaces. It's not a
This phenomenon is not a
bug in FOP, but rather in the dependent packages: Apache Batik, Apache Xalan-J and SAXON. The bug in Apache Batik will be
fixed in the next release. In the latest release of Apache Xalan-J, the bug is already fixed. It only occurs in the Xalan
version bundled with Sun's JVM, because Sun uses a rather old version.
@@ -931,7 +920,7 @@ Can I control this?</question>
<question>How do I embed fonts in PDF?</question>
<answer>
<p>
See the <link href="0.95/fonts.html">Fonts</link> page for information
See the <link href="1.0/fonts.html">Fonts</link> page for information
about embedding fonts.
</p>
</answer>
@@ -950,7 +939,7 @@ Can I control this?</question>
set. For a variety of reasons, even those are not completely
guaranteed to work, for example you can't use the fi
ligature from the standard serif font. Check the <link
href="0.95/output.html#pdf-fonts">overview</link> for the default
href="1.0/output.html#pdf-fonts">overview</link> for the default
PDF fonts.
</p>
<p>
@@ -958,7 +947,7 @@ Can I control this?</question>
the desired character. Furthermore the font must be
available on the machine where the PDF is viewed or it must
have been embedded in the PDF file. See <link
href="0.95/fonts.html">embedding fonts</link>.
href="1.0/fonts.html">embedding fonts</link>.
</p>
<p>
For most symbols, it is better to select the symbol font
@@ -976,7 +965,7 @@ Can I control this?</question>
<faq id="pdf-postprocess">
<question>What tools are available for post-processing my PDF document?</question>
<answer>
<p>See <link href="0.95/output.html#pdf-postprocess">PDF Post-processing</link>.</p>
<p>See <link href="1.0/output.html#pdf-postprocess">PDF Post-processing</link>.</p>
</answer>
</faq>
<faq id="pdf-security">
@@ -984,8 +973,8 @@ Can I control this?</question>
to my PDF document?</question>
<answer>
<p>
See <link href="0.95/pdfencryption.html">PDF Encryption</link>.
See also <link href="0.95/output.html#pdf-postprocess">PDF Post-processing</link>.
See <link href="1.0/pdfencryption.html">PDF Encryption</link>.
See also <link href="1.0/output.html#pdf-postprocess">PDF Post-processing</link>.
</p>
</answer>
</faq>
@@ -993,13 +982,13 @@ Can I control this?</question>
<question>How do I add document properties (title, author, etc.) to my
PDF document?</question>
<answer>
<p>See <link href="0.95/metadata.html">Metadata</link>.</p>
<p>See <link href="1.0/metadata.html">Metadata</link>.</p>
</answer>
</faq>
<faq id="pdf-watermark">
<question>How do I add watermarks to my PDF document?</question>
<answer>
<p>See <link href="0.95/output.html#pdf-watermark">PDF Watermarks</link>.</p>
<p>See <link href="1.0/output.html#pdf-watermark">PDF Watermarks</link>.</p>
</answer>
</faq>
<faq id="pdf-print-contortion">
@@ -1018,7 +1007,7 @@ Can I control this?</question>
<question>How do I control the Acrobat bookmark display?</question>
<answer>
<p>
FOP versions 0.93 and later support the starting-state property of the XSL 1.1
FOP supports the starting-state property of the XSL 1.1
<link href="http://www.w3.org/TR/xsl11/#fo_bookmark">fo:bookmark</link>
element which can be used for this. The color, font-style and
font-weight properties on
@@ -1035,7 +1024,7 @@ Can I control this?</question>
<answer>
<p>
This is a problem of Internet Explorer requesting the content several
times. Please see the <link href="0.95/servlets.html#ie">notes on Internet Explorer</link>
times. Please see the <link href="1.0/servlets.html#ie">notes on Internet Explorer</link>
for more information.
</p>
</answer>

+ 1
- 1
src/documentation/content/xdocs/fo.xml View File

@@ -519,7 +519,7 @@ This applies similarly to the extent of the after region and the bottom margin o
<section id="external-resources">
<title>External Resources</title>
<p>Resources needed by an XSL-FO file that are external to it (graphics, for example), are defined in the XSL-FO standard as being of type "uri-specification". This is defined in the standard at <jump href="http://www.w3.org/TR/xsl11/#datatype">Section 5.11 Property Datatypes</jump>, which includes a link to the URI standard itself. Refer to the XSL-FO and URI standards themselves for more detailed instructions.</p>
<p>URIs may be either absolute or relative to a base URI. (See <link href="0.94/configuration.html">FOP: Configuration</link> for information on setting the base URI for a FOP session). Here is an example referencing an external-graphic that is relative to the base URI:</p>
<p>URIs may be either absolute or relative to a base URI. (See <link href="1.0/configuration.html">FOP: Configuration</link> for information on setting the base URI for a FOP session). Here is an example referencing an external-graphic that is relative to the base URI:</p>
<source><![CDATA[<fo:external-graphic src="url('images/logo.jpg')"/>]]></source>
<p>Here is an example referencing an external-graphic that is an absolute URI on a local filesystem:</p>
<source><![CDATA[fo:external-graphic src="url('file:d:///images/logo.jpg')"/>]]></source>

+ 3
- 3
src/documentation/content/xdocs/index.xml View File

@@ -29,13 +29,13 @@
<p>Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL
formatting objects (XSL-FO) and an output independent formatter. It is a Java
application that reads a formatting object (FO) tree and renders the resulting
pages to a specified output. <link href="0.95/output.html">Output formats</link>
pages to a specified output. <link href="1.0/output.html">Output formats</link>
currently supported include PDF, PS, PCL, AFP, XML (area tree representation),
Print, AWT and PNG, and to a lesser extent, RTF and TXT. The primary output target is PDF.
</p>
<figure width="480" height="260" src="images/document.jpg" alt="Render Diagram" />
<p>
A stable release of the latest version of FOP (<link href="0.95/">0.95</link>) is
A stable release of the latest version of FOP (<link href="1.0/">1.0</link>) is
available. It's the third
stable release after the large redesign effort and implements a large subset of the
<link href="http://www.w3.org/TR/xsl11/">XSL-FO Version 1.1 W3C
@@ -69,7 +69,7 @@ The most common method is to convert semantic XML to XSL-FO, using an XSLT trans
Portable Document Format Specification (Version 1.4) from Adobe Systems.
</p>

<p>Conformance to the XML 1.0 Recommendation, XSLT 1.0 Recommendation and the XML Namespaces Recommendation is
<p>Conformance to the XML 1.0 and 1.1 Recommendations, XSLT 1.0 and 2.0 Recommendations and the XML Namespaces Recommendation is
understood. Other relevant documents, such as the XPath and XLink Working Drafts, are referenced as necessary. The FOP
Project will attempt to use the latest version of evolving specifications.
</p>

+ 1
- 1
src/documentation/content/xdocs/maillist.xml View File

@@ -84,7 +84,7 @@ href="dev/index.html#mail-fop-dev">Development pages</link>.</note>
source, or other semantic XML? If so, the question is <em>almost certainly not
appropriate to this list</em>. In general, the only input documents that are
appropriate on this list are XSL-FO snippets. See <link
href="0.94/running.html#check-input">Running Xalan</link> for instructions about capturing the XSL-FO document that is actually submitted to FOP. If you haven't examined the XSL-FO document yourself, then you are not yet prepared to formulate a FOP-specific question.</li>
href="1.0/running.html#check-input">Running Xalan</link> for instructions about capturing the XSL-FO document that is actually submitted to FOP. If you haven't examined the XSL-FO document yourself, then you are not yet prepared to formulate a FOP-specific question.</li>
<li>If you are providing one or more XSL-FO snippets:
<ul>
<li>Have you reduced them to the shortest possible complete, <strong>self-contained</strong> document that demonstrates the problem? Please do so.</li>

+ 10
- 2
src/documentation/content/xdocs/news-data.xml View File

@@ -17,6 +17,15 @@
-->
<!-- $Id$ -->
<news>
<item date="2010-07-20" title="Apache FOP 1.0 Released">
<p>
The Apache FOP team is delighted to present you a production grade
release of the new FOP codebase. This release
contains many bug fixes and new features. See the <a
href="1.0/releaseNotes_1.0.html">Release Notes</a> for a list of
the most important changes.
</p>
</item>
<item date="2009-12-14" title="New committer">
<p>Welcome Pascal Sancho!</p>
</item>
@@ -47,8 +56,7 @@
<item date="2007-08-24" title="Apache FOP 0.94 Released">
<p>The Apache FOP team is pleased to present you the second production
grade release of the new FOP codebase. This release contains many bug
fixes and new features. See the <a
href="0.94/releaseNotes_0.94.html">Release Notes</a> for a list of
fixes and new features. See the Release Notes for a list of
the most important changes.</p>
</item>
<item date="2007-01-26" title="New Committer">

+ 9
- 9
src/documentation/content/xdocs/quickstartguide.xml View File

@@ -29,15 +29,15 @@
<p>The goal of this <strong>Quick Start Guide</strong> is to help novice users get Apache FOP up and running quickly. Typically, you'll need to:</p>
<ol>
<li><link href="download.html">Download FOP</link></li>
<li><link href="0.95/compiling.html">Build FOP</link> (you can skip this step if you download the binary distribution!)</li>
<li><link href="0.95/configuration.html">Configure FOP</link></li>
<li><link href="0.95/running.html">Run FOP</link></li>
<li><link href="1.0/compiling.html">Build FOP</link> (you can skip this step if you download the binary distribution!)</li>
<li><link href="1.0/configuration.html">Configure FOP</link></li>
<li><link href="1.0/running.html">Run FOP</link></li>
</ol>
<p>Here are some links to help you find out what FOP can do, as well as how and where to get help:</p>
<ul>
<li><link href="0.95/embedding.html">Calling FOP from a Java Application</link></li>
<li><link href="0.95/servlets.html">Using FOP in Servlets</link></li>
<li><link href="0.95/anttask.html">Using FOP in an 'Ant' Build Script</link></li>
<li><link href="1.0/embedding.html">Calling FOP from a Java Application</link></li>
<li><link href="1.0/servlets.html">Using FOP in Servlets</link></li>
<li><link href="1.0/anttask.html">Using FOP in an 'Ant' Build Script</link></li>
<li><link href="compliance.html" title="FOP Compliance">XSL-FO Compliance</link> (what FOP supports and what it doesn't)</li>
<li><link href="faq.html">FAQs</link></li>
<li><link href="gethelp.html">Getting Help</link></li>
@@ -45,7 +45,7 @@
</ul>
<p>
Once you've familiarized yourself with the basics, you can get more detailed information,
in the detailed FOP <link href="0.95/index.html">product documentation</link>.
in the detailed FOP <link href="1.0/index.html">product documentation</link>.
</p>
</section>
@@ -65,7 +65,7 @@
<li>
Get a command prompt in the &lt;fop-home&gt; directory and write:<br/>
Windows: <code>fop -fo examples/fo/basic/readme.fo -awt</code><br/>
Unix: <code>./fop.sh -fo examples/fo/basic/readme.fo -awt</code><br/>
Unix: <code>./fop -fo examples/fo/basic/readme.fo -awt</code><br/>
</li>
<li>
If all went well, this should open a window showing you a "readme"-style document.
@@ -112,7 +112,7 @@
Finally, let's put the previous two steps together: Go back to the command prompt and
enter the following command:<br/>
Windows: <code>fop -xml name.xml -xsl name2fo.xsl -pdf name.pdf</code><br/>
Unix: <code>./fop.sh -xml name.xml -xsl name2fo.xsl -pdf name.pdf</code><br/>
Unix: <code>./fop -xml name.xml -xsl name2fo.xsl -pdf name.pdf</code><br/>
</li>
<li>
You've produced your first PDF with Apache FOP! Please open <code>name.pdf</code>

+ 0
- 551
src/documentation/content/xdocs/relnotes.xml View File

@@ -1,551 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Release Notes</title>
<version>$Revision$</version>
</header>

<body>
<section>
<title>FOP 0.92 beta</title>
<p>
This is the third release after the big redesign effort. FOP 0.92 beta has now
stabilized the API. In addition it contains many bug fixes and new features.
</p>
<p>
We would like to encourage you to download the code and to play with it.
We're still in the process of stabilizing
the code. We welcome any feedback you might have and even more, any
other form of help to get the project forward.
</p>
<p>Caveats:</p>
<ul>
<li>
This release is still a beta release. If you intend to use this software in a production
environment, please perform careful testing.
</li>
<li>
The API has changed between 0.91beta this release.
Please consult the <a href="0.94/upgrading.html">"Upgrading"</a> page for details.
</li>
<li>
You may experience different behaviour compared to version 0.20.5.
Please consult the <a href="0.94/upgrading.html">"Upgrading"</a> page for details.
</li>
</ul>
<p>Known Issues:</p>
<ul>
<li>
PCL, MIF and SVG output support have not been restored, yet.
</li>
<li>
Java2D/AWT support contains some problems, for example with
block-containers.
</li>
<li>
Auto table layout is not implemented, yet.
</li>
<li>
The collapsing border model on tables is not implemented, yet. Please
use border-collapse="separate" for now.
</li>
<li>
Footnotes may overlap with text of the region-body in multi-column
documents.
</li>
<li>
Space resolution does not work between footnote regions.
</li>
<li>
There's a problem involving nested block-containers and
reference-orientation 180/-180 (<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=36391">Bugzilla #36391</a>)
</li>
<li>
block-containers with no height currently don't create a fence for
spaces as they should (they behave like a normal block).
</li>
<li>
Preserved linefeeds in fo:character are not handled correctly.
</li>
<li>
An empty block currently produces a fence for stacking constraints
which it shouldn't.
</li>
<li>
There are several small problems around white space handling.
</li>
<li>
Images currently don't shrink so they fit on a page when they are
too big and shrinking is allowed to happen.
</li>
<li>
Block-level content in fo:inlines may produce unwelcome results.
</li>
<li>
inline-container may not work as expected.
</li>
<li>
letter-spacing and word-spacing properties may not work as expected.
</li>
<li>
leaders with leader-pattern="use-content" may not work as expected.
</li>
<li>
keep-with-previous doesn't work inside tables and lists, yet.
</li>
<li>
White space on direct inline-level children of a marker is not
handled correctly.
</li>
<li>
If two consecutive pages don't have the same available width, the
content currently isn't properly fit into the available space on
the new page.
</li>
<li>
background-images on page-number-citations are not placed correctly.
</li>
<li>
Not all FO elements can be referenced by their "id", most notably:
table-body, table-header, table-footer and table-row.
</li>
<li>
The backgrounds of table-body, table-header, table-footer and
table-column are not painted, yet.
</li>
<li>
Border and padding conditionality are not supported on table-cells, yet.
</li>
<li>
Copy/Paste from PDF content in Acrobat Reader is not supported for
text using embedded TrueType fonts.
</li>
<li>
Column balancing in multi-column documents may not work as expected
(<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=36356">Bugzilla #36356</a>)
</li>
<li>
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 (<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=35656">Bugzilla #35656</a>).
</li>
<li>
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.
</li>
</ul>
</section>
<section>
<title>FOP 0.91 beta</title>
<p>
This is the second release after the big redesign effort. FOP 0.91 beta is mostly a bug
fix release but also contains some new features.
</p>
<p>
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.
</p>
<p>Caveats:</p>
<ul>
<li>
This release is an beta release. If you intend to use this software in a production
environment, please perform careful testing.
</li>
<li>
The API is not to be considered stable, yet. Please be prepared
for the API to be changed in a backwards-incompatible way.
</li>
<li>
You may experience different behaviour compared to version 0.20.5.
Please consult the <a href="0.94/upgrading.html">"Upgrading"</a> page indicated above for details.
</li>
</ul>
<p>Known Issues:</p>
<ul>
<li>
PCL, MIF and SVG output support have not been restored, yet.
</li>
<li>
Java2D/AWT support contains some problems, for example with
block-containers.
</li>
<li>
Support for kerning has not been restored, yet.
</li>
<li>
Auto table layout is not implemented, yet.
</li>
<li>
The collapsing border model on tables is not implemented, yet. Please
use border-collapse="separate" for now.
</li>
<li>
Footnotes may overlap with text of the region-body in multi-column
documents.
</li>
<li>
Space resolution does not work between footnote regions.
</li>
<li>
There's a problem involving nested block-containers and
reference-orientation 180/-180 (<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=36391">Bugzilla #36391</a>)
</li>
<li>
block-containers with no height currently don't create a fence for
spaces as they should (they behave like a normal block).
</li>
<li>
Preserved linefeeds in fo:character are not handled correctly.
</li>
<li>
Zero-width spaces are not handled correctly.
</li>
<li>
An empty block currently produces a fence for stacking constraints
which it shouldn't.
</li>
<li>
There are several small problems around white space handling.
</li>
<li>
Images currently don't shrink so they fit on a page when they are
too big and shrinking is allowed to happen.
</li>
<li>
Block-level content in fo:inlines may produce unwelcome results.
</li>
<li>
inline-container may not work as expected.
</li>
<li>
letter-spacing and word-spacing properties may not work as expected.
</li>
<li>
leaders with leader-pattern="use-content" may not work as expected.
</li>
<li>
keep-with-previous doesn't work inside tables and lists, yet.
</li>
<li>
White space on direct inline-level children of a marker is not
handled correctly.
</li>
<li>
If two consecutive pages don't have the same available width, the
content currently isn't properly fit into the available space on
the new page.
</li>
<li>
background-images on page-number-citations are not placed correctly.
</li>
<li>
Not all FO elements can be referenced by their "id", most notably:
table-body, table-header, table-footer and table-row.
</li>
<li>
The backgrounds of table-body, table-header, table-footer and
table-column are not painted, yet.
</li>
<li>
Border and padding conditionality are not supported on table-cells, yet.
</li>
<li>
Copy/Paste from PDF content in Acrobat Reader is not supported for
text using embedded TrueType fonts.
</li>
<li>
Column balancing in multi-column documents may not work as expected
(<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=36356">Bugzilla #36356</a>)
</li>
<li>
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 (<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=35656">Bugzilla #35656</a>).
</li>
<li>
Leaders with the "rule" pattern don't work for PostScript output.
</li>
<li>
break-after may in some cases cause subsequent content to be swallowed.
Please use break-before, if possible.
</li>
<li>
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.
</li>
</ul>
</section>
<section>
<title>FOP 0.90 alpha 1</title>
<p>
This is the first preview release after the big redesign effort.
</p>
<p>
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.
</p>
<p>Caveats:</p>
<ul>
<li>
This release is a (unstable) preview release and not intended for use in a
production environment. Use at your own risk!
</li>
<li>
The API is not to be considered stable, yet. Please be prepared
for the API to be changed in a backwards-incompatible way.
</li>
<li>
You may experience different behaviour compared to version 0.20.5.
Please consult the <a href="0.94/upgrading.html">"Upgrading"</a> page indicated above for details.
</li>
</ul>
<p>Known Issues:</p>
<ul>
<li>
PCL, MIF and SVG output support have not been restored, yet.
</li>
<li>
Java2D/AWT support contains some problems, for example with
block-containers.
</li>
<li>
Support for kerning has not been restored, yet.
</li>
<li>
Auto table layout is not implemented, yet.
</li>
<li>
The collapsing border model on tables is not implemented, yet. Please
use border-collapse="separate" for now.
</li>
<li>
Footnotes may overlap with text of the region-body in multi-column
documents.
</li>
<li>
Space resolution does not work between footnote regions.
</li>
<li>
There's a problem involving nested block-containers and
reference-orientation 180/-180 (<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=36391">Bugzilla #36391</a>)
</li>
<li>
block-containers with no height currently don't create a fence for
spaces as they should (they behave like a normal block).
</li>
<li>
Preserved linefeeds in fo:character are not handled correctly.
</li>
<li>
Zero-width spaces are not handled correctly.
</li>
<li>
An empty block currently produces a fence for stacking constraints
which it shouldn't.
</li>
<li>
There are several small problems around white space handling.
</li>
<li>
Images currently don't shrink so they fit on a page when they are
too big and shrinking is allowed to happen.
</li>
<li>
Block-level content in fo:inlines may produce unwelcome results.
</li>
<li>
inline-container may not work as expected.
</li>
<li>
letter-spacing and word-spacing properties may not work as expected.
</li>
<li>
leaders with leader-pattern="use-content" may not work as expected.
</li>
<li>
keep-with-previous doesn't work inside tables and lists, yet.
</li>
<li>
White space on direct inline-level children of a marker is not
handled correctly.
</li>
<li>
If two consecutive pages don't have the same available width, the
content currently isn't properly fit into the available space on
the new page.
</li>
<li>
background-images on page-number-citations are not placed correctly.
</li>
<li>
Not all FO elements can be referenced by their "id", most notably:
table-body, table-header, table-footer and table-row.
</li>
<li>
The backgrounds of table-body, table-header, table-footer and
table-column are not painted, yet.
</li>
<li>
Border and padding conditionality are not supported on table-cells, yet.
</li>
<li>
Copy/Paste from PDF content in Acrobat Reader is not supported for
text using embedded TrueType fonts.
</li>
<li>
Column balancing in multi-column documents may not work as expected
(<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=36356">Bugzilla #36356</a>)
</li>
<li>
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 (<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=35656">Bugzilla #35656</a>).
</li>
<li>
Leaders with the "rule" pattern don't work for PostScript output.
</li>
</ul>
</section>
<section>
<title>FOP 0.20.5</title>
<p>This was the last release in the 0.20.x series (aka maintenance branch).</p>
<p>Important changes since the last release (0.20.4):</p>
<ul>
<li>Some hyphenation patterns (cs, da, de, de_DR, el, en, en_US, fr, nl,
no, sk, tr) have been removed due to licensing reasons
(en_GB hyphenation has been renamed to en).
We're still working on this issue
(see <a href="http://wiki.apache.org/xmlgraphics-fop/FOPAudits/March2003">
Wiki</a> for details).
</li>
<li>Documentation is now built with <a href="http://xml.apache.org/forrest/">
Forrest</a> (version 0.4). You need to install Forrest if you want build the docs
yourself. (See
<a href="http://xml.apache.org/forrest/your-project.html">Using Forrest</a>)
</li>
<li>The following JARs have been updated:
Xerces to version 2.2.1, Xalan to version 2.4.1 and Batik to version 1.5beta4.
</li>
<li>FOP has been compiled with Jimi support, but Jimi is not included in the
FOP distribution. To use it, first download
<a href="http://java.sun.com/products/jimi/">Jimi</a>, then extract
the archive, then
copy JimiProClasses.zip to FOP's lib dir and rename it to jimi-1.0.jar.
</li>
<li>FOP has been compiled with JAI support, but JAI is not included in the
FOP distribution. To use it, simply install
<a href="http://java.sun.com/products/java-media/jai">JAI</a>.
</li>
<li>Links in PDF won't generate multiple link rectangles anymore. If this causes
a problem you can set the system property "links.merge" to "no".
</li>
<li>FOP has been compiled with cryptography support. See
<a href="0.94/pdfencryption.html">
PDF encryption</a> for details about installation and usage.
</li>
<li>The behaviour of leader has changed. See
<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=19341">bug #19341</a>,
<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=19465">bug #19465</a>
and <code>leader.fo</code> (examples).
</li>
<li>
For a more detailed list of changes, see the CHANGES file in the root of the
FOP distribution.
</li>
</ul>

</section>
<section>
<title>FOP 0.20.4</title>
<p>Important changes since 0.20.3:</p>
<ul>
<li>FOP should now work with any JAXP1.1 compliant parser/transformer.
It has been successfully tested with Xerces/Xalan, Saxon and JDK1.4
(which includes Crimson and Xalan).
</li>
<li>The following JARs have been updated:
Xerces to version 2.0.1, Xalan to version 2.3.1 and Batik to version 1.5beta2.
</li>
<li>FOP has been compiled with Jimi support this time
but you still have to download
<a href="http://java.sun.com/products/jimi/">Jimi</a>
and copy it to lib/ to get PNG support (no need to build FOP yourself though).
</li>
<li>Building FOP with JDK1.2 does not work. Running is ok except
support for additional truetype fonts in AWT Viewer.
</li>
<li>Logging has been changed from LogKit to Avalon's Logger Interface.
(see <a href="0.94/embedding.html">Embedding</a> for details).
</li>
<li>Building under JDK 1.4:
You need to add a method in
<code>src/org/apache/fop/svg/PDFGraphics2D.java</code>
(search for jdk1.4 and remove the comments)
</li>
<li>To decrease the size of the distributions, ant, xml-docs, design-docs
and the hyphenation sources have been removed from the binary distribution.
Javadocs have been removed from the source distribution (use
<code>build javadocs</code> to generate them).
</li>
<li>Documentaion generation is broken in the maintenance branch at the moment
(Stylebook needs xerces1). The docs for this release are generated from the trunk.
</li>
<li>
For a more detailed list of changes, see the CHANGES file in the root of the FOP distribution.
</li>
</ul>
</section>

<section>
<title>FOP 0.20.3</title>
<p>Important Information:</p>
<ul>
<li>This version supports the
<a href="http://www.w3.org/TR/2001/REC-xsl-20011015/">XSL-FO Version 1.0
W3C Recommendation</a> syntax. So don't forget to update your
Stylesheets:
<br/>Just rename the <code>master-name</code> property to <code>master-reference</code>
on <code>fo:page-sequence</code>, <code>fo:single-page-master-reference</code>,
<code>fo:repeatable-page-master-reference</code> and
<code>fo:conditional-page-master-reference</code>.</li>
<li>JDK 1.2 (or later) is required</li>
<li>Jimi has been removed for licensing reasons
<br/>If you need PNG support you have to download
<a href="http://java.sun.com/products/jimi/">Jimi</a>,
copy it to lib/ and build FOP yourself</li>
<li>Building under JDK 1.4:
<br/>You need to add a method in
<code>src/org/apache/fop/svg/PDFGraphics2D.java</code>
(search for jdk1.4 and remove the comments)
</li>
<li>
For a more detailed list of changes, see the CHANGES file in the root of the FOP distribution.
</li>
</ul>
</section>

</body>
</document>


+ 24
- 15
src/documentation/content/xdocs/resources.xml View File

@@ -37,24 +37,29 @@
<section id="specs-xslt">
<title>XSLT</title>
<ul>
<li><jump href="http://www.w3.org/TR/xslt">XSLT Recommendation</jump></li>
<li><jump href="http://www.w3.org/TR/xslt">XSLT 1.0 Recommendation</jump></li>
<li><jump href="http://www.w3.org/TR/xslt20">XSLT 2.0 Recommendation</jump></li>
</ul>
</section>
<section id="specs-xml">
<title>XML</title>
<ul>
<li><jump href="http://www.w3.org/TR/REC-xml">XML Recommendation</jump></li>
<li><jump href="http://www.w3.org/TR/xml">XML 1.0 </jump></li>
<li><jump href="http://www.w3.org/TR/xml11">XML 1.1 </jump></li>
<li><jump href="http://sax.sourceforge.net/">Simple API for XML (SAX)</jump></li>
<li><jump href="http://www.w3.org/TR/REC-DOM-Level-1">Document Object Model (DOM)</jump></li>
<li><jump href="http://www.w3.org/TR/REC-xml-names/">Namespaces in XML Recommendation</jump></li>
<li><jump href="http://www.w3.org/TR/DOM-Level-2-Core">Document Object Model (DOM) Level 2 Core Specification</jump></li>
<li><jump href="http://www.w3.org/TR/DOM-Level-3-Core">Document Object Model (DOM) Level 3 Core Specification</jump></li>
<li><jump href="http://www.w3.org/TR/xml-names/">Namespaces in XML 1.0 </jump></li>
<li><jump href="http://www.w3.org/TR/xml-names11/">Namespaces in XML 1.1</jump></li>
</ul>
</section>
<section id="specs-java">
<title>Java</title>
<ul>
<li><jump href="http://java.sun.com/j2se/1.3/docs/api/index.html">Java JDK 1.3 Documentation</jump></li>
<li><jump href="http://java.sun.com/j2se/1.4/docs/api/index.html">Java JDK 1.4 Documentation</jump></li>
<li><jump href="http://java.sun.com/j2se/1.5/docs/api/index.html">Java JDK 1.5 Documentation</jump></li>
<li><jump href="http://java.sun.com/j2se/1.4/docs/api/index.html">Java 2 Platform, Standard Edition, v 1.4.2 API Specification</jump></li>
<li><jump href="http://java.sun.com/j2se/1.5/docs/api/index.html">Java 2 Platform Standard Edition 5.0 API Specification </jump></li>
<li><jump href="http://java.sun.com/javase/6/docs/api/index.html">Java Platform, Standard Edition 6 API Specification</jump></li>
</ul>
</section>
<section id="specs-pdf">
@@ -83,13 +88,15 @@
<title>XSL-FO</title>
<ul>
<li>[online book] <jump href="http://www.ibiblio.org/xml/books/bible2/chapters/ch18.html">The XML Bible</jump>, by Elliotte Rusty Harold. Chapter 18 of XSL Formatting Objects</li>
<!--
<li>[online article] <jump href="http://www.sun.com/software/xml/developers/slides-dtd/">Using Formatting Objects with the Slides DTD</jump>, by Paul Sandoz.</li>
-->
<li>[online article] <jump href="http://www.xml.com/pub/a/2001/01/17/xsl-fo/index.html">Using XSL Formatting Objects</jump>, by J. David Eisenberg.</li>
<li>[online reference] <jump href="http://zvon.org/xxl/xslfoReference/Output/index.html">XSL FO reference</jump>, by Miloslav Nic.</li>
<li>[online reference] <jump href="http://www.dpawson.co.uk/xsl/sect3/index.html">Dave Pawson's XSL-FO FAQ</jump>.</li>
<li>[book] <jump href="http://www.oreilly.com/catalog/xslfo">XSL-FO</jump>, by Dave Pawson, O'Reilly &amp; Associates, 2002, ISBN 0-596-00355-2. See online version above.</li>
<li>[book] <jump href="http://www.phptr.com/browse/product.asp?product_id={CEA527AF-412D-49DA-8C1F-46E0A519B8D8}">Definitive XSL-FO</jump>, by G. Ken Holman, Prentice Hall PTR, 2003, ISBN 0-131-40374-5.</li>
<li>[book] <jump href="http://www.sams.com/catalog/product.asp?product_id={F7ADFA46-6AF1-497C-9163-0D6337F727B3}">XSL Formatting Objects Developer's Handbook</jump>, by Doug Lovell, Sams, 2002, ISBN 0-672-32281-1.</li>
<li>[book] <jump href="http://www.amazon.com/exec/obidos/ASIN/0131403745/ref=ase_cranesoftwrig-20">Definitive XSL-FO</jump>, by G. Ken Holman, Prentice Hall PTR, 2003, ISBN 0-131-40374-5.</li>
<li>[book] <jump href="http://www.amazon.com/XSL-Formatting-Objects-Developers-Handbook/dp/0672322811">XSL Formatting Objects Developer's Handbook</jump>, by Doug Lovell, Sams, 2002, ISBN 0-672-32281-1.</li>
<li>[book] <jump href="http://www.cranesoftwrights.com/training/index.htm#pfux">Practical Formatting Using XSLFO</jump>, Crane Softwrights Ltd., 2003, ISBN 1-894049-11-X.</li>
</ul>
</section>
@@ -97,12 +104,13 @@
<title>XSLT</title>
<ul>
<li>[online resource] <jump href="http://www.w3.org/Style/XSL/">Extensible Stylesheet Language Family (XSL)</jump>, W3C XSL Family page.</li>
<li>[book] <jump href="http://wrox.com/books/1861005067.htm">XSLT Programmer's Reference</jump>, by Michael H. Kay, Wrox Press, ISBN 1-861-00506-7.</li>
<li>[book] <jump href="http://www.amazon.com/XSLT-Programmers-Reference-2nd-Michael/dp/1861005067">XSLT Programmer's Reference</jump>, by Michael H. Kay, Wrox Press, ISBN 1-861-00506-7.</li>
<li>[book] <jump href="http://www.wrox.com/WileyCDA/WroxTitle/XSLT-2-0-and-XPath-2-0-Programmer-s-Reference-4th-Edition.productCd-0470192747.html">XSLT2 and XPath2 Programmer's Reference</jump>, by Michael H. Kay, Wrox Press, ISBN: 978-0-470-19274-0.</li>
<li>[book] <jump href="http://www.oreilly.com/catalog/xslt">XSLT</jump>, by Doug Tidwell, O'Reilly &amp; Associates, 2001, ISBN 0-596-00053-7.</li>
<li>[book] <jump href="http://www.oreilly.com/catalog/xsltckbk">XSLT Cookbook</jump>, by Sal Mangano, O'Reilly &amp; Associates, 2002, ISBN 0-596-00372-2.</li>
<li>[article] <jump href="http://www.dpawson.co.uk/xsl/index.html">Dave Pawson's XSL FAQ</jump>.</li>
<li>[book] <jump href="http://www.oreilly.com/catalog/xpathpointer">XPath and XPointer: Locating Content in XML Documents</jump>, by John E. Simpson, O'Reilly &amp; Associates, 2002, ISBN 0-596-00291-2.</li>
<li>[book] <jump href="http://www.wiley.com/cda/product/0,,0471416207,00.html">XSL Essentials</jump>, by Michael Fitzgerald, John Wiley &amp; Sons, 2001, ISBN 0-471-41620-7.</li>
<li>[book] <jump href="http://www.amazon.com/XSL-Essentials-Michael-Fitzgerald/dp/0471416207">XSL Essentials</jump>, by Michael Fitzgerald, John Wiley &amp; Sons, 2001, ISBN 0-471-41620-7.</li>
<li>[book] <jump href="http://www.oreilly.com/catalog/javaxslt">Java and XSLT</jump>, by Eric M. Burke, O'Reilly &amp; Associates, 2001, ISBN 0-596-00143-6.</li>
</ul>
</section>
@@ -110,7 +118,7 @@
<title>XML</title>
<ul>
<li>[online book] <jump href="http://www.ibiblio.org/xml/books/bible2">The XML Bible</jump>, by Elliotte Rusty Harold. See hardcopy version below.</li>
<li>[book] <jump href="http://www.wiley.com/cda/product/0,,0764547607,00.html">The XML Bible</jump>, by Elliotte Rusty Harold, John Wiley &amp; Sons, ISBN 0-764-54760-7. See online version above.</li>
<li>[book] <jump href="http://www.amazon.com/XML-Bible-Elliotte-Rusty-Harold/dp/0764547607">The XML Bible</jump>, by Elliotte Rusty Harold, John Wiley &amp; Sons, ISBN 0-764-54760-7. See online version above.</li>
<li>[online resource] A great number of additional XML-related books and articles can be found at the <jump href="http://xml.oreilly.com">O'Reilly XML Site</jump>.</li>
</ul>
</section>
@@ -204,10 +212,9 @@
<section id="products-pdf">
<title>PDF post-processors</title>
<ul>
<li>[software] <jump href="http://incubator.apache.org/pdfbox">Apache PDFBox</jump> (Incubating, Apache License V2.0)</li>
<li>[software] <jump href="http://pdfbox.apache.org">Apache PDFBox</jump> (Apache License V2.0)</li>
<li>[software] <jump href="http://www.lowagie.com/iText">iText</jump> (MPL and LGPL)</li>
<li>[software] <jump href="http://www.etymon.com/pjc">PJ Classic</jump> by Etymon (GPL)</li>
<li>[software] <jump href="http://www.etymon.com/pjx">PJ Professional</jump> by Etymon (commercial)</li>
<li>[software] <jump href="http://www.etymon.com/epub.html">PJX</jump> by Etymon (GPL)</li>
<li>[software] <jump href="http://www.accesspdf.com/pdftk/">pdftk</jump> the pdf toolkit</li>
</ul>
</section>
@@ -227,11 +234,13 @@
<title>Other products</title>
<ul>
<li>[software] <jump href="http://foray.sourceforge.net/">FOray</jump> a renderer for converting XML files to PDF via XSL Formatting Object elements (FOP fork)</li>
<!--
<li>[software] <jump href="http://defoe.sourceforge.net/folio">Folio</jump> a renderer for XML files containing Formatting Object elements (aka FOP Alt.Design)</li>
-->
<li>[software] <jump href="http://xmlroff.org/">xmlroff</jump> an open source XSL-FO implementation written in C (BSD-style license)</li>

<li>[commercial software developer] <jump href="http://antennahouse.com/product.htm">Antenna House</jump> - XSL Formatter, WordMLToFo, XML Editor...</li>
<li>[commercial software developer] <jump href="http://www.renderx.net/">RenderX</jump> XEP, EnMasse, Docbench...</li>
<li>[commercial software developer] <jump href="http://www.renderx.com/tools/index.html">RenderX</jump> XEP, EnMasse, Docbench...</li>

<li>[software] <jump href="http://html2fo.sourceforge.net/">html2fo</jump> is a converter from HTML to XSL-FO (GPL).</li>
<li>[software] <jump href="http://wh2fo.sourceforge.net/">wh2fo</jump> is a converter from Word HTML to XSL-FO (MPL).</li>

+ 16
- 15
src/documentation/content/xdocs/site.xml View File

@@ -56,14 +56,15 @@
<!--
END Home tab
-->
<!--
BEGIN Version 0.94 documentation tab
BEGIN Version 0.95 documentation tab
-->
<trunk label="FOP 0.94" href="0.94/" tab="previousversion">
<trunk label="FOP 0.95" href="0.95/" tab="previousversion">
<about label="About" href="index.html"/>
<release label="Release Notes" href="releaseNotes_0.94.html"/>
<changes label="Changes" href="changes_0.94.html"/>
<release label="Release Notes" href="releaseNotes_0.95.html"/>
<changes label="Changes (0.95)" href="changes_0.95.html"/>
<changes-beta label="Changes (0.95beta)" href="changes_0.95beta.html"/>
<knownissues label="Known Issues" href="knownissues_overview.html"/>
<upgrading label="Upgrading" href="upgrading.html"/>
@@ -86,21 +87,21 @@
<fonts label="Fonts" href="fonts.html"/>
<hyphenation label="Hyphenation" href="hyphenation.html"/>
<extensions label="Extensions" href="extensions.html"/>
<metadata label="Metadata" href="metadata.html"/>
</features>
</trunk>
<!--
END Version 0.94 documentation tab
END Version 0.95 documentation tab
-->
<!--
BEGIN Version 0.95 documentation tab
BEGIN Version 1.0 documentation tab
-->
<trunk label="FOP 0.95" href="0.95/" tab="stableversion">
<trunk label="FOP 1.0" href="1.0/" tab="stableversion">
<about label="About" href="index.html"/>
<release label="Release Notes" href="releaseNotes_0.95.html"/>
<changes label="Changes (0.95)" href="changes_0.95.html"/>
<changes-beta label="Changes (0.95beta)" href="changes_0.95beta.html"/>
<release label="Release Notes" href="releaseNotes_1.0.html"/>
<changes label="Changes (1.0)" href="changes_1.0.html"/>
<knownissues label="Known Issues" href="knownissues_overview.html"/>
<upgrading label="Upgrading" href="upgrading.html"/>
@@ -123,12 +124,14 @@
<fonts label="Fonts" href="fonts.html"/>
<hyphenation label="Hyphenation" href="hyphenation.html"/>
<extensions label="Extensions" href="extensions.html"/>
<events label="Events" href="events.html"/>
<metadata label="Metadata" href="metadata.html"/>
<accessibility label="Accessibility" href="accessibility.html"/>
</features>
</trunk>
<!--
END Version 0.95 documentation tab
END Version 1.0 documentation tab
-->

<!--
@@ -221,7 +224,7 @@
<deploy label="Deploy" href="dev/" tab="development">
<doc label="Doc Mgmt" href="doc.html"/>
<release label="Release" href="release.html"/>
<bugs label="Bugs" href="http://issues.apache.org/bugzilla/buglist.cgi?bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;email1=&amp;emailtype1=substring&amp;emailassigned_to1=1&amp;email2=&amp;emailtype2=substring&amp;emailreporter2=1&amp;bugidtype=include&amp;bug_id=&amp;changedin=&amp;votes=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;product=Fop&amp;short_desc=&amp;short_desc_type=allwordssubstr&amp;long_desc=&amp;long_desc_type=allwordssubstr&amp;bug_file_loc=&amp;bug_file_loc_type=allwordssubstr&amp;keywords=&amp;keywords_type=anywords&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;order=bugs.component"/>
<bugs label="Bugs" href="http://issues.apache.org/bugzilla/buglist.cgi?bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;email1=&amp;emailtype1=substring&amp;emailassigned_to1=1&amp;email2=&amp;emailtype2=substring&amp;emailreporter2=1&amp;bugidtype=include&amp;bug_id=&amp;changedin=&amp;votes=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;product=Fop&amp;short_desc=&amp;short_desc_type=allwordssubstr&amp;long_desc=&amp;long_desc_type=allwordssubstr&amp;bug_file_loc=&amp;bug_file_loc_type=allwordssubstr&amp;keywords=&amp;keywords_type=anywords&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;order=bug_severity%2Cpriority%20DESC"/>
</deploy>

<resources label="Resources" href="dev/" tab="development">
@@ -245,8 +248,6 @@
</xmlgraphics.apache.org>
<svn-repo href="http://svn.apache.org/repos/asf/xmlgraphics/fop/">
<trunk href="trunk/"/>
<stable href="tags/fop-0_94"/>
<maintenance href="branches/fop-0_20_2-maintain/"/>
</svn-repo>
<forrest.apache.org href="http://forrest.apache.org/"/>
<xml.apache.org href="http://xml.apache.org/">

+ 10
- 189
src/documentation/content/xdocs/status.xml View File

@@ -27,31 +27,27 @@
<body>
<section>
<title>Status</title>
<p>[last updated 4 March 2008]</p>
<figure width="585" height="175" src="images/track.png" alt="Planning and branches of FOP development"/>
<p>[last updated 5 July 2010]</p>
<p>
This is the development status of Apache FOP. Development on
the maintenance branch where FOP 0.20.5 came from has been
halted. The code base has been largely redesigned. The new
code base has reached release 0.95.
FOP version 0.95 was released on 5 August 2008. FOP version 1.0 was released in July 2010.
</p>
</section>
<section>
<title>Development Status</title>
<p>The FOP code base has been largely rewritten, to address
design issues for layout and performance. The new design makes
it better possible to be conformant to the spec and be able to
handle large documents.</p>
<p>The redesign of the code base has largely been completed. The
new code reached production quality with release 0.93. In the
course of 2008 or 2009 we hope to release version 1.0.</p>
<p>The FOP code base is gradually evolving, from version 0.90
released on 22 November 2005, to version 1.0 released in July
2010. Further releases in the 1.x series may be expected.</p>
<p>FOP releases before version 0.90 were based on a different
code base. The last release in that series was version 0.20.5,
released on 18 July 2003. This series is no longer maintained.</p>
<p>
If you're looking for a long-term road-map we have to disappoint you. This is Open
Source and we're mostly volunteers working in their free time. What we have
is an idea where we want to go. How fast we get there depends on the
available time, on how well our ideas work out while developing and on you!
There's a <a href="http://wiki.apache.org/xmlgraphics-fop/RoadMap">document in the Wiki</a>
where you can get a glimpse of what points we're currently focusing on.
where ideas for new developments may be registered and documented.
</p>
<section id="component-status">
<title>Status of the individual components</title>
@@ -131,180 +127,5 @@
</table>
</section>
</section>
<section>
<title>Maintenance Status</title>
<p>
The latest release of the maintenance branch is FOP 0.20.5, released on July 18th, 2003.
The maintenance branch has been frozen in 2004 so the team can concentrate on the new code
base.
</p>
</section>
<!--section id="stats">
<title>Statistics</title>
<table>
<tr>
<th>&#x00A0;</th>
<th>0.20.5</th>
<th>Development (aka trunk, redesign) as of August 1, 2003</th>
</tr>
<tr>
<td colspan="3">&#x00A0;</td>
</tr>
<tr>
<th colspan="3">Binaries</th>
</tr>
<tr>
<td>fop jar</td>
<td>1,485 kb</td>
<td>2,132 kb</td>
</tr>
<tr>
<td>hyphenation (in fop.jar)</td>
<td>348 kb</td>
<td>1,358 kb</td>
</tr>
<tr>
<td>ant jar</td>
<td>&#x00A0;</td>
<td>707 kb</td>
</tr>
<tr>
<td>avalon-framework jar</td>
<td>62 kb</td>
<td>72 kb</td>
</tr>
<tr>
<td>batik jar</td>
<td>2,063 kb</td>
<td>2,213 kb</td>
</tr>
<tr>
<td>commons-io-dev jar</td>
<td>&#x00A0;</td>
<td>71 kb</td>
</tr>
<tr>
<td>commons-lang jar</td>
<td>&#x00A0;</td>
<td>190 kb</td>
</tr>
<tr>
<td>servlet jar</td>
<td>&#x00A0;</td>
<td>39 kb</td>
</tr>
<tr>
<td>xalan jar</td>
<td>1,007 kb</td>
<td>1,007 kb</td>
</tr>
<tr>
<td>xerces jar</td>
<td>816 kb</td>
<td>816 kb</td>
</tr>
<tr>
<td>xml-apis jar</td>
<td>112 kb</td>
<td>112 kb</td>
</tr>
<tr>
<th colspan="3">Lines of Source Code, using "find . -iname "*.java" | xargs cat | wc -l"</th>
</tr>
<tr>
<td>org.apache.fop.fo.*</td>
<td>20,297</td>
<td>22,306</td>
</tr>
<tr>
<td>org.apache.fop.layout.*</td>
<td>9,444</td>
<td>4,238</td>
</tr>
<tr>
<td>org.apache.fop.layoutmgr.*</td>
<td>&#x00A0;</td>
<td>10,069</td>
</tr>
<tr>
<td>org.apache.fop.area.*</td>
<td>&#x00A0;</td>
<td>5,791</td>
</tr>
<tr>
<td>org.apache.fop.render.*</td>
<td>18,387</td>
<td>11,527</td>
</tr>
<tr>
<td>org.apache.fop.pdf.*</td>
<td>10,203</td>
<td>15,669</td>
</tr>
<tr>
<td>org.apache.fop.rtf.*</td>
<td>0</td>
<td>12,747</td>
</tr>
<tr>
<td>Other</td>
<td>29,821</td>
<td>32,543</td>
</tr>
<tr>
<td>Total</td>
<td>88,152</td>
<td>114,890</td>
</tr>
<tr>
<th colspan="3">Files, using "find . -iname "*.java" | wc -l"</th>
</tr>
<tr>
<td>org.apache.fop.fo.*</td>
<td>122</td>
<td>127</td>
</tr>
<tr>
<td>org.apache.fop.layout.*</td>
<td>49</td>
<td>24</td>
</tr>
<tr>
<td>org.apache.fop.layoutmgr.*</td>
<td>&#x00A0;</td>
<td>38</td>
</tr>
<tr>
<td>org.apache.fop.area.*</td>
<td>&#x00A0;</td>
<td>39</td>
</tr>
<tr>
<td>org.apache.fop.render.*</td>
<td>48</td>
<td>36</td>
</tr>
<tr>
<td>org.apache.fop.pdf.*</td>
<td>51</td>
<td>70</td>
</tr>
<tr>
<td>org.apache.fop.rtf.*</td>
<td>&#x00A0;</td>
<td>80</td>
</tr>
<tr>
<td>Other</td>
<td>129</td>
<td>140</td>
</tr>
<tr>
<td>Total</td>
<td>399</td>
<td>554</td>
</tr>
</table>
</section-->
</body>
</document>

+ 1
- 1
src/documentation/content/xdocs/tabs.xml View File

@@ -21,8 +21,8 @@

<tabs software="FOP" title="FOP" copyright="@year@ The Apache Software Foundation" xmlns:xlink="http://www.w3.org/1999/xlink">
<tab label="Home" dir=""/>
<tab label="Version 0.94" dir="0.94/"/>
<tab label="Version 0.95" dir="0.95/"/>
<tab label="Version 1.0" dir="1.0/"/>
<tab label="FOP Trunk" dir="trunk/"/>
<tab label="Development" dir="dev/"/>
</tabs>

+ 1
- 1
src/documentation/content/xdocs/trunk/fonts.xml View File

@@ -215,7 +215,7 @@
in this case can be found on the page about <a href="output.html">output formats</a>.
</p>
<p>
Prior to FOP version 0.94, it was always necessary to create an XML font metrics file
In earlier FOP versions, it was always necessary to create an XML font metrics file
if you wanted to add a custom font. This unconvenient step has been removed and in
addition to that, FOP supports auto-registration of fonts, i.e. FOP can find fonts
installed in your operating system or can scan user-specified directories for fonts.

+ 4
- 8
src/documentation/content/xdocs/trunk/graphics.xml View File

@@ -26,19 +26,15 @@
<section id="introduction">
<title>Introduction</title>
<p>
After the Apache FOP 0.94 release, the image handling subsystem has been rewritten in
order to improve the range of supported images and image subtypes, to lower the
overall memory consumption when handling images, to produce smaller output files and to
increase the performance in certain areas. Of course, this causes a few changes most of
which the user will probably not notice. The most important changes are:
Some noteworthy features of the image handling subsystem are:
</p>
<ul>
<li>
The image libraries Jimi and JAI are no longer supported. Instead, Apache FOP uses the
The image libraries Jimi and JAI are not supported. Instead, Apache FOP uses the
Image I/O API that was introduced with Java 1.4 for all bitmap codecs.
</li>
<li>
Some bitmap images are no longer converted to a standardized 24 bit RGB image but are
Some bitmap images are not converted to a standardized 24 bit RGB image but are
instead handled in their native format.
</li>
<li>
@@ -48,7 +44,7 @@
</ul>
<p>
The actual <a href="http://xmlgraphics.apache.org/commons/image-loader.html">image loading framework</a>
no longer resides in Apache FOP, but was instead placed in
does not reside in Apache FOP, but in
<a href="ext:xmlgraphics.apache.org/commons/">XML Graphics Commons</a>.
</p>
</section>

+ 2
- 0
src/documentation/skinconf.xml View File

@@ -378,6 +378,7 @@ which will be used to configure the chosen Forrest skin.
<height>125</height>
</credit>
-->
<!--
<credit box-location="alt2">
<name>ApacheCon US 2009</name>
<url>http://us.apachecon.com/</url>
@@ -385,6 +386,7 @@ which will be used to configure the chosen Forrest skin.
<width>125</width>
<height>125</height>
</credit>
-->
<credit role="pdf">
<name>PDF created by Apache FOP</name>

+ 0
- 1
src/java/org/apache/fop/afp/AFPPaintingState.java View File

@@ -26,7 +26,6 @@ import org.apache.commons.logging.LogFactory;

import org.apache.xmlgraphics.java2d.color.ColorConverter;
import org.apache.xmlgraphics.java2d.color.DefaultColorConverter;
import org.apache.xmlgraphics.java2d.color.GrayScaleColorConverter;

import org.apache.fop.afp.fonts.AFPPageFonts;
import org.apache.fop.util.AbstractPaintingState;

+ 61
- 0
src/java/org/apache/fop/afp/GrayScaleColorConverter.java View File

@@ -0,0 +1,61 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.afp;
import java.awt.Color;
import org.apache.xmlgraphics.java2d.color.ColorConverter;
import org.apache.fop.util.ColorUtil;
/**
* Converts to grayscale using the standard RED=30%, GREEN=59% and BLUE=11%
* weights (see http://en.wikipedia.org/wiki/Grayscale)
*/
final class GrayScaleColorConverter implements ColorConverter {
private static final int RED_WEIGHT = 77;
private static final int GREEN_WEIGTH = 150;
private static final int BLUE_WEIGHT = 28;
private static final GrayScaleColorConverter SINGLETON = new GrayScaleColorConverter();
private GrayScaleColorConverter() { }
/**
* static factory
*
* @return singleton instance of GrayScaleColorConverter
*/
public static GrayScaleColorConverter getInstance() {
return SINGLETON;
}
/**
* The color is converted to CMYK with just the K component {@inheritDoc}
*/
public Color convert(Color color) {
float kValue = (RED_WEIGHT * color.getRed() + GREEN_WEIGTH * color.getGreen() + BLUE_WEIGHT
* color.getBlue()) / 255.0f / 255.0f;
return ColorUtil.toCMYKGrayColor(kValue);
}
}

+ 10
- 2
src/java/org/apache/fop/events/LoggingEventListener.java View File

@@ -79,10 +79,18 @@ public class LoggingEventListener implements EventListener {
} else if (severity == EventSeverity.WARN) {
log.warn(msg);
} else if (severity == EventSeverity.ERROR) {
log.error(msg);
if (event.getParam("e") != null) {
log.error(msg, (Throwable)event.getParam("e"));
} else {
log.error(msg);
}
} else if (severity == EventSeverity.FATAL) {
if (!skipFatal) {
log.fatal(msg);
if (event.getParam("e") != null) {
log.fatal(msg, (Throwable)event.getParam("e"));
} else {
log.fatal(msg);
}
}
} else {
assert false;

+ 111
- 0
src/java/org/apache/fop/image/loader/batik/GenericFOPBridgeContext.java View File

@@ -0,0 +1,111 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/* $Id$ */

package org.apache.fop.image.loader.batik;

import java.awt.geom.AffineTransform;

import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.bridge.DocumentLoader;
import org.apache.batik.bridge.UserAgent;
import org.apache.batik.dom.svg.SVGOMDocument;

import org.apache.xmlgraphics.image.loader.ImageManager;
import org.apache.xmlgraphics.image.loader.ImageSessionContext;

import org.apache.fop.fonts.FontInfo;
import org.apache.fop.svg.AbstractFOPBridgeContext;
import org.apache.fop.svg.SVGUserAgent;

/**
* BridgeContext which registers the custom bridges for Java2D output.
*/
class GenericFOPBridgeContext extends AbstractFOPBridgeContext {

/**
* Constructs a new bridge context.
* @param userAgent the user agent
* @param documentLoader the Document Loader to use for referenced documents.
* @param fontInfo the font list for the text painter, may be null
* in which case text is painted as shapes
* @param imageManager an image manager
* @param imageSessionContext an image session context
* @param linkTransform AffineTransform to properly place links,
* may be null
*/
public GenericFOPBridgeContext(UserAgent userAgent, DocumentLoader documentLoader,
FontInfo fontInfo, ImageManager imageManager,
ImageSessionContext imageSessionContext,
AffineTransform linkTransform) {
super(userAgent, documentLoader, fontInfo,
imageManager, imageSessionContext, linkTransform);
}

/**
* Constructs a new bridge context.
* @param userAgent the user agent
* @param fontInfo the font list for the text painter, may be null
* in which case text is painted as shapes
* @param imageManager an image manager
* @param imageSessionContext an image session context
*/
public GenericFOPBridgeContext(UserAgent userAgent, FontInfo fontInfo,
ImageManager imageManager, ImageSessionContext imageSessionContext) {
super(userAgent, fontInfo, imageManager, imageSessionContext);
}

/**
* Constructs a new bridge context.
* @param userAgent the user agent
* @param fontInfo the font list for the text painter, may be null
* in which case text is painted as shapes
* @param imageManager an image manager
* @param imageSessionContext an image session context
* @param linkTransform AffineTransform to properly place links,
* may be null
*/
public GenericFOPBridgeContext(SVGUserAgent userAgent, FontInfo fontInfo,
ImageManager imageManager, ImageSessionContext imageSessionContext,
AffineTransform linkTransform) {
super(userAgent, fontInfo, imageManager, imageSessionContext, linkTransform);
}

/** {@inheritDoc} */
public void registerSVGBridges() {
super.registerSVGBridges();

//This makes Batik load images via FOP and the XGC image loading framework
putBridge(new GenericFOPImageElementBridge());
}

/** {@inheritDoc} */
public BridgeContext createBridgeContext(SVGOMDocument doc) {
return createBridgeContext();
}

/** {@inheritDoc} */
public BridgeContext createBridgeContext() {
return new GenericFOPBridgeContext(getUserAgent(), getDocumentLoader(),
fontInfo,
getImageManager(),
getImageSessionContext(),
linkTransform);
}

}

+ 46
- 0
src/java/org/apache/fop/image/loader/batik/GenericFOPImageElementBridge.java View File

@@ -0,0 +1,46 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/* $Id$ */

package org.apache.fop.image.loader.batik;

import org.apache.xmlgraphics.image.loader.ImageFlavor;

import org.apache.fop.svg.AbstractFOPImageElementBridge;

/**
* Image Element Bridge class for the SVG to Java2D converter, used to make Batik load images
* through FOP and XGC's image loading framework.
*/
class GenericFOPImageElementBridge extends AbstractFOPImageElementBridge {

/**
* Constructs a new bridge for the &lt;image&gt; element.
*/
public GenericFOPImageElementBridge() { }

private final ImageFlavor[] supportedFlavors = new ImageFlavor[]
{ImageFlavor.GRAPHICS2D,
BatikImageFlavors.SVG_DOM};

/** {@inheritDoc} */
protected ImageFlavor[] getSupportedFlavours() {
return supportedFlavors;
}

}

+ 24
- 2
src/java/org/apache/fop/image/loader/batik/ImageConverterSVG2G2D.java View File

@@ -37,7 +37,9 @@ import org.apache.xmlgraphics.image.loader.Image;
import org.apache.xmlgraphics.image.loader.ImageException;
import org.apache.xmlgraphics.image.loader.ImageFlavor;
import org.apache.xmlgraphics.image.loader.ImageInfo;
import org.apache.xmlgraphics.image.loader.ImageManager;
import org.apache.xmlgraphics.image.loader.ImageProcessingHints;
import org.apache.xmlgraphics.image.loader.ImageSessionContext;
import org.apache.xmlgraphics.image.loader.XMLNamespaceEnabledImageFlavor;
import org.apache.xmlgraphics.image.loader.impl.AbstractImageConverter;
import org.apache.xmlgraphics.image.loader.impl.ImageGraphics2D;
@@ -77,7 +79,16 @@ public class ImageConverterSVG2G2D extends AbstractImageConverter {
}
UserAgent ua = createBatikUserAgent(pxToMillimeter);
GVTBuilder builder = new GVTBuilder();
final BridgeContext ctx = new BridgeContext(ua);

final ImageManager imageManager = (ImageManager)hints.get(
ImageProcessingHints.IMAGE_MANAGER);
final ImageSessionContext sessionContext = (ImageSessionContext)hints.get(
ImageProcessingHints.IMAGE_SESSION_CONTEXT);

boolean useEnhancedBridgeContext = (imageManager != null && sessionContext != null);
final BridgeContext ctx = (useEnhancedBridgeContext
? new GenericFOPBridgeContext(ua, null, imageManager, sessionContext)
: new BridgeContext(ua));

Document doc = svg.getDocument();
//Cloning SVG DOM as Batik attaches non-thread-safe facilities (like the CSS engine)
@@ -117,9 +128,20 @@ public class ImageConverterSVG2G2D extends AbstractImageConverter {
/** {@inheritDoc} */
public void displayMessage(String message) {
//TODO Refine and pipe through to caller
log.debug(message);
log.info(message);
}

/** {@inheritDoc} */
public void displayError(Exception e) {
log.error("Error converting SVG to a Java2D graphic", e);
}

/** {@inheritDoc} */
public void displayError(String message) {
log.error(message);
}


};
}


+ 3
- 3
src/java/org/apache/fop/pdf/PDFName.java View File

@@ -54,11 +54,11 @@ public class PDFName extends PDFObject {
}
for (int i = 0, c = name.length(); i < c; i++) {
char ch = name.charAt(i);
if (ch >= 33 && ch <= 126) {
sb.append(ch);
} else {
if (ch < 33 || ch > 126 || ch == 0x2F) {
sb.append('#');
toHex(ch, sb);
} else {
sb.append(ch);
}
}
return sb.toString();

+ 250
- 0
src/java/org/apache/fop/util/ColorExt.java View File

@@ -0,0 +1,250 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/* $Id$ */

package org.apache.fop.util;

import java.awt.Color;
import java.awt.color.ColorSpace;
import java.util.Arrays;

/**
* Color helper class.
* <p>
* This class extends java.awt.Color class keeping track of the original color
* property values specified by the fo user in a rgb-icc call.
* @deprecated Replaced by {@link ColorWithFallback}
*/
public final class ColorExt extends Color {
//
private static final long serialVersionUID = 1L;

// Values of fop-rgb-icc arguments
private float rgbReplacementRed;
private float rgbReplacementGreen;
private float rgbReplacementBlue;

private String iccProfileName;
private String iccProfileSrc;
private ColorSpace colorSpace;

private float[] colorValues;

/*
* Helper for createFromFoRgbIcc
*/
private ColorExt(ColorSpace colorSpace, float[] colorValues, float opacity) {
super(colorSpace, colorValues, opacity);
}

/*
* Helper for createFromSvgIccColor
*/
private ColorExt(float red, float green, float blue, float opacity) {
super(red, green, blue, opacity);
}

/**
* Create ColorExt object backup up FO's rgb-icc color function
*
* @param redReplacement
* Red part of RGB replacement color that will be used when ICC
* profile can not be loaded
* @param greenReplacement
* Green part of RGB replacement color that will be used when ICC
* profile can not be loaded
* @param blueReplacement
* Blue part of RGB replacement color that will be used when ICC
* profile can not be loaded
* @param profileName
* Name of ICC profile
* @param profileSrc
* Source of ICC profile
* @param colorSpace
* ICC ColorSpace for the ICC profile
* @param iccValues
* color values
* @return the requested color object
*/
public static ColorExt createFromFoRgbIcc(float redReplacement,
float greenReplacement, float blueReplacement, String profileName,
String profileSrc, ColorSpace colorSpace, float[] iccValues) {
ColorExt ce = new ColorExt(colorSpace, iccValues, 1.0f);
ce.rgbReplacementRed = redReplacement;
ce.rgbReplacementGreen = greenReplacement;
ce.rgbReplacementBlue = blueReplacement;
ce.iccProfileName = profileName;
ce.iccProfileSrc = profileSrc;
ce.colorSpace = colorSpace;
ce.colorValues = iccValues;
return ce;
}

/**
* Create ColorExt object backing up SVG's icc-color function.
*
* @param red
* Red value resulting from the conversion from the user provided
* (icc) color values to the batik (rgb) color space
* @param green
* Green value resulting from the conversion from the user
* provided (icc) color values to the batik (rgb) color space
* @param blue
* Blue value resulting from the conversion from the user
* provided (icc) color values to the batik (rgb) color space
* @param opacity
* Opacity
* @param profileName
* ICC profile name
* @param profileHref
* the URI to the color profile
* @param profileCS
* ICC ColorSpace profile
* @param colorValues
* ICC color values
* @return the requested color object
*/
public static ColorExt createFromSvgIccColor(float red, float green,
float blue, float opacity, String profileName, String profileHref,
ColorSpace profileCS, float[] colorValues) {
//TODO this method is not referenced by FOP, can it be deleted?
ColorExt ce = new ColorExt(red, green, blue, opacity);
ce.rgbReplacementRed = -1;
ce.rgbReplacementGreen = -1;
ce.rgbReplacementBlue = -1;
ce.iccProfileName = profileName;
ce.iccProfileSrc = profileHref;
ce.colorSpace = profileCS;
ce.colorValues = colorValues;
return ce;

}

/** {@inheritDoc} */
public int hashCode() {
//implementation from the superclass should be good enough for our purposes
return super.hashCode();
}

/** {@inheritDoc} */
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
ColorExt other = (ColorExt)obj;
//TODO maybe use super.getColorComponents() instead
if (!Arrays.equals(colorValues, other.colorValues)) {
return false;
}
if (iccProfileName == null) {
if (other.iccProfileName != null) {
return false;
}
} else if (!iccProfileName.equals(other.iccProfileName)) {
return false;
}
if (iccProfileSrc == null) {
if (other.iccProfileSrc != null) {
return false;
}
} else if (!iccProfileSrc.equals(other.iccProfileSrc)) {
return false;
}
if (Float.floatToIntBits(rgbReplacementBlue)
!= Float.floatToIntBits(other.rgbReplacementBlue)) {
return false;
}
if (Float.floatToIntBits(rgbReplacementGreen)
!= Float.floatToIntBits(other.rgbReplacementGreen)) {
return false;
}
if (Float.floatToIntBits(rgbReplacementRed)
!= Float.floatToIntBits(other.rgbReplacementRed)) {
return false;
}
return true;
}

/**
* Get ICC profile name
*
* @return ICC profile name
*/
public String getIccProfileName() {
return this.iccProfileName;
}

/**
* Get ICC profile source
*
* @return ICC profile source
*/
public String getIccProfileSrc() {
return this.iccProfileSrc;
}

/**
* @return the original ColorSpace
*/
public ColorSpace getOrigColorSpace() {
//TODO this method is probably unnecessary due to super.cs and getColorSpace()
return this.colorSpace;
}

/**
* Returns the original color values.
* @return the original color values
*/
public float[] getOriginalColorComponents() {
//TODO this method is probably unnecessary due to super.fvalue and getColorComponents()
float[] copy = new float[this.colorValues.length];
System.arraycopy(this.colorValues, 0, copy, 0, copy.length);
return copy;
}

/**
* Create string representation of fop-rgb-icc function call to map this
* ColorExt settings
* @return the string representing the internal fop-rgb-icc() function call
*/
public String toFunctionCall() {
StringBuffer sb = new StringBuffer(40);
sb.append("fop-rgb-icc(");
sb.append(this.rgbReplacementRed + ",");
sb.append(this.rgbReplacementGreen + ",");
sb.append(this.rgbReplacementBlue + ",");
sb.append(this.iccProfileName + ",");
if (this.iccProfileSrc != null) {
sb.append("\"" + this.iccProfileSrc + "\"");
}
float[] colorComponents = this.getColorComponents(null);
for (int ix = 0; ix < colorComponents.length; ix++) {
sb.append(",");
sb.append(colorComponents[ix]);
}
sb.append(")");
return sb.toString();
}

}

+ 9
- 1
status.xml View File

@@ -61,6 +61,8 @@
<action context="Renderers" dev="JM" type="add" fixes-bug="49403" due-to="Patrick Jaromin">
Initial work on spot colors (aka named colors) for PDF output.
</action>
</release>
<release version="1.0" date="July 2010">
<action context="Renderers" dev="JM" type="fix">
AFP Output: Fixed positioning of Java2D-based images (when GOCA is enabled).
</action>
@@ -91,6 +93,8 @@
<action context="Renderers" dev="JM" type="add" fixes-bug="48567" due-to="Peter Hancock">
Initial support for CID-keyed double-byte fonts (Type 0) in AFP output.
</action>
<action context="API" dev="SP" type="add">Added a command-line option '-catalog' to use a catalog resolver for the XML and XSLT files</action>
<action context="Layout" dev="SP" type="add">Implement internal character classes if the hyphenation pattern file does not contain them</action>
<action context="Layout" dev="VH" type="fix" fixes-bug="46486">
Bugfix: having a special page-master for the last page caused loss of content when normal
blocks were mixed with blocks spanning all columns.
@@ -138,7 +142,7 @@
<action context="Renderers" dev="JM,VH" type="add" fixes-bug="46705" due-to="Jost Klopfstein">
Added basic accessibility and Tagged PDF support.
</action>
<action context="Code" dev="JM" type="add">
<action context="Renderers" dev="JM" type="add">
Added support for encoding CMYK bitmap images (IOCA FS45) and TIFF images as embedded objects.
</action>
<action context="Code" dev="AC" type="add">
@@ -547,6 +551,10 @@
Added support for addressing all glyphs available in a Type 1 font, not just the ones
in the font's primary encoding.
</action>
<action context="Code" dev="JM" type="add" importance="high">
Added an event handling framework which allows to get better feedback from within FOP
with the ability to customize problem management.
</action>
</release>
<release version="0.95" date="05 August 2008">
<notes>

+ 58
- 0
test/java/org/apache/fop/threading/AvalonAdapter.java View File

@@ -0,0 +1,58 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/* $Id$ */

package org.apache.fop.threading;

import org.apache.avalon.framework.logger.Logger;

import org.apache.fop.events.Event;
import org.apache.fop.events.EventFormatter;
import org.apache.fop.events.EventListener;
import org.apache.fop.events.model.EventSeverity;

/**
* Redirects events to an Avalon logger.
*/
class AvalonAdapter implements EventListener {

private final Logger logger;
private String filename;

public AvalonAdapter(Logger logger, String filename) {
this.logger = logger;
this.filename = filename;
}

public void processEvent(Event event) {
String msg = EventFormatter.format(event);
EventSeverity severity = event.getSeverity();
if (severity == EventSeverity.INFO) {
//logger.info(filename + ": " + msg);
} else if (severity == EventSeverity.WARN) {
//logger.warn(filename + ": " + msg);
} else if (severity == EventSeverity.ERROR) {
logger.error(filename + ": " + msg);
} else if (severity == EventSeverity.FATAL) {
logger.fatalError(filename + ": " + msg);
} else {
assert false;
}
}

}

+ 15
- 13
test/java/org/apache/fop/threading/FOPTestbed.java View File

@@ -56,7 +56,7 @@ public class FOPTestbed extends AbstractLogEnabled
private int threads;
private File outputDir;
private Configuration fopCfg;
private FOProcessor foprocessor;
private Processor foprocessor;
private boolean writeToDevNull;

private int counter = 0;
@@ -74,7 +74,7 @@ public class FOPTestbed extends AbstractLogEnabled
for (int i = 0; i < entries.length; i++) {
this.taskList.add(new TaskDef(entries[i]));
}
this.fopCfg = configuration.getChild("foprocessor");
this.fopCfg = configuration.getChild("processor");
}

/** {@inheritDoc} */
@@ -177,11 +177,11 @@ public class FOPTestbed extends AbstractLogEnabled
* Creates a new FOProcessor.
* @return the newly created instance
*/
public FOProcessor createFOProcessor() {
public Processor createFOProcessor() {
try {
Class clazz = Class.forName(this.fopCfg.getAttribute("class",
"org.apache.fop.threading.FOProcessorImpl"));
FOProcessor fop = (FOProcessor)clazz.newInstance();
Processor fop = (Processor)clazz.newInstance();
ContainerUtil.enableLogging(fop, getLogger());
ContainerUtil.configure(fop, this.fopCfg);
ContainerUtil.initialize(fop);
@@ -206,13 +206,15 @@ public class FOPTestbed extends AbstractLogEnabled
this.fo = cfg.getAttribute("fo", null);
if (this.fo == null) {
this.xml = cfg.getAttribute("xml");
this.xslt = cfg.getAttribute("xslt");
TransformerFactory factory = TransformerFactory.newInstance();
Source xsltSource = new StreamSource(new File(xslt));
try {
this.templates = factory.newTemplates(xsltSource);
} catch (TransformerConfigurationException tce) {
throw new ConfigurationException("Invalid XSLT", tce);
this.xslt = cfg.getAttribute("xslt", null);
if (this.xslt != null) {
TransformerFactory factory = TransformerFactory.newInstance();
Source xsltSource = new StreamSource(new File(xslt));
try {
this.templates = factory.newTemplates(xsltSource);
} catch (TransformerConfigurationException tce) {
throw new ConfigurationException("Invalid XSLT", tce);
}
}
}
}
@@ -249,9 +251,9 @@ public class FOPTestbed extends AbstractLogEnabled

private TaskDef def;
private int num;
private FOProcessor fop;
private Processor fop;

public Task(TaskDef def, int num, FOProcessor fop) {
public Task(TaskDef def, int num, Processor fop) {
this.def = def;
this.num = num;
this.fop = fop;

+ 4
- 33
test/java/org/apache/fop/threading/FOProcessorImpl.java View File

@@ -43,16 +43,12 @@ import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.events.Event;
import org.apache.fop.events.EventFormatter;
import org.apache.fop.events.EventListener;
import org.apache.fop.events.model.EventSeverity;

/**
* Default implementation of the FOProcessor interface using FOP.
* Default implementation of the {@link Processor} interface using FOP.
*/
public class FOProcessorImpl extends AbstractLogEnabled
implements FOProcessor, Configurable, Initializable {
implements Processor, Configurable, Initializable {

private FopFactory fopFactory = FopFactory.newInstance();
private TransformerFactory factory = TransformerFactory.newInstance();
@@ -83,7 +79,8 @@ public class FOProcessorImpl extends AbstractLogEnabled
try {
URL url = new URL(src.getSystemId());
String filename = FilenameUtils.getName(url.getPath());
foUserAgent.getEventBroadcaster().addEventListener(new AvalonAdapter(filename));
foUserAgent.getEventBroadcaster().addEventListener(
new AvalonAdapter(getLogger(), filename));
} catch (MalformedURLException mfue) {
throw new RuntimeException(mfue);
}
@@ -107,30 +104,4 @@ public class FOProcessorImpl extends AbstractLogEnabled
public String getTargetFileExtension() {
return this.fileExtension;
}

private class AvalonAdapter implements EventListener {

private String filename;

public AvalonAdapter(String filename) {
this.filename = filename;
}

public void processEvent(Event event) {
String msg = EventFormatter.format(event);
EventSeverity severity = event.getSeverity();
if (severity == EventSeverity.INFO) {
//getLogger().info(filename + ": " + msg);
} else if (severity == EventSeverity.WARN) {
//getLogger().warn(filename + ": " + msg);
} else if (severity == EventSeverity.ERROR) {
getLogger().error(filename + ": " + msg);
} else if (severity == EventSeverity.FATAL) {
getLogger().fatalError(filename + ": " + msg);
} else {
assert false;
}
}

}
}

+ 124
- 0
test/java/org/apache/fop/threading/IFProcessorImpl.java View File

@@ -0,0 +1,124 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/* $Id$ */

package org.apache.fop.threading;

import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;

import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.Templates;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.stream.StreamResult;

import org.xml.sax.ContentHandler;

import org.apache.avalon.framework.activity.Initializable;
import org.apache.avalon.framework.configuration.Configurable;
import org.apache.avalon.framework.configuration.Configuration;
import org.apache.avalon.framework.configuration.ConfigurationException;
import org.apache.avalon.framework.logger.AbstractLogEnabled;
import org.apache.commons.io.FilenameUtils;

import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.MimeConstants;
import org.apache.fop.render.intermediate.IFDocumentHandler;
import org.apache.fop.render.intermediate.IFException;
import org.apache.fop.render.intermediate.IFParser;
import org.apache.fop.render.intermediate.IFUtil;

/**
* Implementation of the {@link Processor} interface that renders IF XML to a final output format.
*/
public class IFProcessorImpl extends AbstractLogEnabled
implements Processor, Configurable, Initializable {

private FopFactory fopFactory = FopFactory.newInstance();
private TransformerFactory factory = TransformerFactory.newInstance();
private String userconfig;
private String mime;
private String fileExtension;

/** {@inheritDoc} */
public void configure(Configuration configuration) throws ConfigurationException {
this.userconfig = configuration.getChild("userconfig").getValue(null);
this.mime = configuration.getChild("mime").getValue(MimeConstants.MIME_PDF);
this.fileExtension = configuration.getChild("extension").getValue(".pdf");
}

/** {@inheritDoc} */
public void initialize() throws Exception {
if (this.userconfig != null) {
getLogger().debug("Setting user config: " + userconfig);
fopFactory.setUserConfig(this.userconfig);
}
}

/** {@inheritDoc}
* @throws IFException */
public void process(Source src, Templates templates, OutputStream out)
throws org.apache.fop.apps.FOPException, java.io.IOException, IFException {
FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
foUserAgent.setBaseURL(src.getSystemId());
try {
URL url = new URL(src.getSystemId());
String filename = FilenameUtils.getName(url.getPath());
foUserAgent.getEventBroadcaster().addEventListener(
new AvalonAdapter(getLogger(), filename));
} catch (MalformedURLException mfue) {
throw new RuntimeException(mfue);
}

//Setup target handler
IFDocumentHandler targetHandler = fopFactory.getRendererFactory().createDocumentHandler(
foUserAgent, mime);

//Setup fonts
IFUtil.setupFonts(targetHandler);
targetHandler.setResult(new StreamResult(out));

try {
Transformer transformer;
if (templates == null) {
transformer = factory.newTransformer();
} else {
transformer = templates.newTransformer();
}
IFParser parser = new IFParser();
ContentHandler contentHandler = parser.getContentHandler(targetHandler, foUserAgent);
Result res = new SAXResult(contentHandler);
transformer.transform(src, res);
} catch (TransformerException e) {
throw new FOPException(e);
}
}

/** {@inheritDoc} */
public String getTargetFileExtension() {
return this.fileExtension;
}

}

test/java/org/apache/fop/threading/FOProcessor.java → test/java/org/apache/fop/threading/Processor.java View File

@@ -25,9 +25,9 @@ import javax.xml.transform.Source;
import javax.xml.transform.Templates;

/**
* Represents an FO processor.
* Represents a processor.
*/
public interface FOProcessor {
public interface Processor {

/**
* Process a file.

+ 2
- 2
test/java/org/apache/fop/threading/sample.cfg.xml View File

@@ -2,13 +2,13 @@
<config prompt="false">
<threads>2</threads>
<output-dir>C:/Dev/FOP/temp/out</output-dir>
<foprocessor class="org.apache.fop.threading.FOProcessorImpl">
<processor class="org.apache.fop.threading.FOProcessorImpl">
<!--
<userconfig>C:/Dev/FOP/temp/userconfig.xml</userconfig>
-->
<mime>application/pdf</mime>
<extension>.pdf</extension>
</foprocessor>
</processor>
<tasks repeat="2">
<task fo="C:/Dev/FOP/temp/helloworld.fo"/>
<task xml="C:/Dev/FOP/temp/page-x-of-y.xml" xslt="C:/Dev/FOP/temp/page-x-of-y.xsl"/>

Loading…
Cancel
Save