Required if a fileset is used to specify the files to render; optional for fofile. (Can alternatively specify the full path in the fofile value.)
-
-
-
force
-
Recreate target files, even if they are newer than their corresponding
- source files. Note: This attribute is available in post-0.20.5
- versions (0.20.x nightly build and 1.0dev) only; target files are
- always generated (i.e., force=true) in 0.20.5 release.
-
-
No, default is false
-
-
-
basedir
-
Base directory to resolve relative references (e.g., graphics files) within the
- FO document.
-
-
No, for single FO File entry, default is to use the location
- of that FO file.
-
-
-
-
relativebase
-
For fileset usage only. A value of true specifies using the location
- of each .fo file as the base directory for resolving relative file references located
- within that .fo file. A value of false specifies using the value of
- basedir for all files within the fileset, or just the current working directory
- if basedir is not specified.
-
-
No, default is false.
-
-
-
-
userconfig
-
User configuration file (same as the FOP "-c" command line option).
-
No
-
-
-
messagelevel
-
Logging level
- Possible values: error, warn, info, verbose, debug. Currently doesn't work in FOP Trunk!!!
-
No, defaults to verbose
-
-
-
logFiles
-
Controls whether the names of the files that are processed are logged
- (true) or not (false). Currently doesn't work in FOP Trunk!!!
-
No, default is true
-
-
-
-
Parameters specified as nested elements
-
-
Attribute
-
Description
-
Required
-
-
-
fileset
-
FileSets
- are used to specify multiple XSL-FO files to be rendered.
-
Yes, if no fofile attribute is supplied
-
-
-
-
- Examples
-
- The following example converts a single XSL-FO file to a PDF document:
-
-
-
- ]]>
-
- This example converts all XSL-FO files within an entire directory to PostScript:
-
-
-
-
-
-
-
-
-
diff --git a/src/documentation/content/xdocs/0.95/compiling.xml b/src/documentation/content/xdocs/0.95/compiling.xml
deleted file mode 100644
index cf7b950ca..000000000
--- a/src/documentation/content/xdocs/0.95/compiling.xml
+++ /dev/null
@@ -1,140 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Building from Source Code
- $Revision$
-
-
-
- Do You Need To Build?
-
- Apache⢠FOP distributions are either pre-compiled binary or source.
- If you are using a binary distribution, it is already built and there is no need to build it again.
- See the Download Instructions for information about whether a
- binary or source distribution is best for your needs.
-
-
- If you got the source code from a repository snapshot or via Subversion you will need to build FOP
- in any case.
-
-
-
- Set Up Your Environment
-
- JDK
-
- Building FOP requires a minimum Java Development Kit (JDK/SDK) of 1.4
- (A Java Runtime Environment is not sufficient).
-
-
-
- CLASSPATH
-
- There is generally no need to setup a classpath. All libraries needed to compile FOP are included
- in the source distribution and are referenced by the build script.
- You will only need to adjust the classpath if you build FOP in some other way. See the build
- script build.xml for details.
-
-
-
- JAVA_HOME
-
- The build script uses Apache Ant, a popular
- Java-based build tool, which usually requires that the environment variable JAVA_HOME point to
- your local JDK root directory. This is true even if you use JDK 1.4 or above, which normally
- does not need this setting.
-
-
-
- Apache Ant
-
- Apache Ant (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
- instructions to install Ant in the Ant manual on the web.
-
-
-
-
- Run the Build Script
-
- Change to the FOP root directory and build FOP by executing the build script (build.xml)
- using the "ant" command.
-
-
- The "ant" command is only available on your system if you've properly
- installed Apache Ant and added Ant's location to the PATH
- environment variable.
-
-
- The file build.xml in the FOP root directory is the blueprint that Ant uses for the build. It
- contains information for numerous build targets, many of which are building blocks to more
- useful target, and others which are primarily used by the FOP developers.
- You may benefit from looking through this file to learn more about the various build targets.
- To obtain a complete list of useful build targets:
-
-
-
The most useful targets are:
-
-
- package: Generates the JAR files (default). This is the normal build that
- produces a jar file usable for running FOP.
-
-
- clean : Cleans the build directory. This is useful for making sure that
- any build errors are cleaned up before starting a new build. It should not ordinarily be
- needed, but may be helpful if you are having problems with the build process itself.
-
-
- javadocs: Creates the FOP API documentation.
- A minimum JDK version of 1.4.2 is required for generating the javadocs.
-
-
-
To run the build:
-
-
For example to do a normal build for the "all" target (which is the default):
-
-
OR
-
-
To clean the build directory first:
-
-
- If you want to shorten the build time you can just call the "package" target which
- doesn't perform any automated tests during the build.
-
-
-
- Troubleshooting
-
If you have problems building FOP, please try the following:
-
-
Run the build with the target of "clean", then rerun the build.
-
Delete the build directory completely, then rerun the build.
-
- Make sure you do not have a non-FOP version of xerces.jar, xalan.jar, batik.jar,
- or another dependency product somewhere in your CLASSPATH.
-
-
- If the build still fails, see the Getting Help
- page for further help.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/configuration.xml b/src/documentation/content/xdocs/0.95/configuration.xml
deleted file mode 100644
index 981f079eb..000000000
--- a/src/documentation/content/xdocs/0.95/configuration.xml
+++ /dev/null
@@ -1,393 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Configuration
- $Revision$
-
-
-
-
- Configuration File Basics
-
- The FOP configuration file is an XML file containing a variety of settings that are useful
- for controlling FOP's behavior, and for helping it find resources that you wish it to use.
-
-
- The easiest way to get started using a FOP configuration file is to copy the sample found
- at {fop-dir}/conf/fop.xconf to a location of your choice, and then to
- edit it according to your needs.
- It contains templates for the various configuration options, most of which are commented
- out. Remove the comments and change the settings for entries that you wish to use.
- Be sure to follow any instructions, including comments which specify the value range.
- Also, since the configuration file is XML, be sure to keep it well-formed.
-
-
- Making Configuration Available to FOP
-
After creating your configuration file, you must tell FOP how to find it:
-
-
- If running FOP from the command-line, see the "-c" command-line option in
- Running FOP.
-
-
-
-
- Summary of the General Configuration Options
-
-
-
Element
-
Data Type (for the value)
-
Description
-
Default Value
-
-
-
base
-
URL or directory
-
Specifies the base URL based on which relative URL will be resolved.
-
current directory
-
-
-
font-base
-
URL or directory
-
Specifies the base URL based on which relative font URLs will be resolved.
-
-
base URL/directory (above)
-
-
-
hyphenation-base
-
URL or directory
-
Specifies the base URL based on which relative URLs to hyphenation pattern
- files will be resolved. If not specified, support for user-supplied hyphenation
- patterns remains disabled.
-
-
disabled
-
-
-
source-resolution
-
Integer, dpi
-
- Resolution in dpi (dots per inch) which is used internally to determine the pixel
- size for SVG images and bitmap images without resolution information.
-
-
72 dpi
-
-
-
target-resolution
-
Integer, dpi
-
- Resolution in dpi (dots per inch) used to specify the output resolution for bitmap
- images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps
- generated by Apache Batik for filter effects and such.
-
-
72 dpi
-
-
-
strict-configuration
-
Boolean (true, false)
-
- Setting this option to 'true' will cause FOP to strictly verify the contents of the
- FOP configuration file to ensure that defined resources (such as fonts and base
- URLs/directories) are valid and available to FOP. Any errors found will cause FOP to
- immediately raise an exception.
-
false
-
-
-
strict-validation
-
Boolean (true, false)
-
- Setting this option to 'false' causes FOP to be more forgiving about XSL-FO validity,
- for example, you're allowed to specify a border on a region-body which is supported
- by some FO implementations but is non-standard. Note that such a border would
- currently have no effect in Apache FOP.
-
true
-
-
-
break-indent-inheritance
-
Boolean (true, false)
-
- Setting this option to 'true' causes FOP to use an alternative rule set to determine
- text indents specified through margins, start-indent and end-indent. Many commercial
- FO implementations have chosen to break the XSL specification in this aspect. This
- option tries to mimic their behaviour. Please note that Apache FOP may still not
- behave exactly like those implementations either because FOP has not fully matched
- the desired behaviour and because the behaviour among the commercial implementations
- varies. The default for this option (i.e. false) is to behave exactly like the
- specification describes.
-
false
-
-
-
default-page-settings
-
n/a
-
- Specifies the default width and height of a page if "auto" is specified
- for either or both values. Use "height" and "width" attributes on the
- default-page-settings element to specify the two values.
-
"height" 11 inches, "width" 8.26 inches
-
-
-
use-cache
-
boolean (true, false)
-
All fonts information that has been gathered as a result of "directory"
- or "auto-detect" font configurations will be cached for future rendering runs.
- This setting should improve performance on systems where
- fonts have been configured using the "directory" or "auto-detect" tag mechanisms.
- By default this option is switched on.
-
true
-
-
-
cache-file
-
String
-
This options specifies the file/directory path of the fop cache file.
- This option can also be specified on the command-line using the -cache option.
- This file is currently only used to cache font triplet information for future reference.
-
${base}/conf/fop.cache
-
-
-
renderers
-
(see text below)
-
Contains the configuration for each renderer. See below.
-
N/A
-
-
-
- This is an excerpt from the example configuration file coming with FOP:
-
-
-
-
- Renderer configuration
-
- Each Renderer has its own configuration section which is identified by the
- MIME type the Renderer is written for, ex. "application/pdf" for the PDF Renderer.
-
-
- The configuration for the PDF Renderer could look like this:
-
-
-
- The details on the font configuration can be found on the separate Fonts page.
- Note especially the section entitled Register Fonts with FOP.
-
-
- Special Settings for the PDF Renderer
-
- The configuration element for the PDF renderer contains two elements. One is for the font configuration
- (please follow the link above) and one is for the "filter list". The filter list controls how the
- individual objects in a PDF file are encoded. By default, all objects get "flate" encoded (i.e. simply
- compressed with the same algorithm that is also used in ZIP files). Most users don't need to change that
- setting. For debugging purposes, it may be desired not to compress the internal objects at all so the
- generated PDF commands can be read. In that case, you can simply use the following filter list. The
- second filter list (type="image") ensures that all images still get compressed but also ASCII-85 encoded
- so the produced PDF file is still easily readable in a text editor.
-
-
-
- Another (optional) setting specific to the PDF Renderer is an output color profile, an ICC
- color profile which indicates the target color space the PDF file is generated for. This
- setting is mainly used in conjunction with the PDF/X feature.
- An example:
-
-
-
- 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:
-
-
-
-
- Special Settings for the PostScript Renderer
-
- Besides the normal font configuration (the same "fonts" element as for the PDF renderer) the PostScript
- renderer has an additional setting to force landscape pages to be rotated to fit on a page inserted into
- the printer in portrait mode. Set the value to "true" to activate this feature. The default is "false".
- Example:
-
-
-
-
- Special Settings for the PCL Renderer
-
- Non-standard fonts for the PCL renderer are made available through the Java2D subsystem which means that
- you don't have to do any custom font configuration in this case but you have to use the font names
- offered by Java.
-
-
- Additionally, there are certain settings that control how the renderer handles various elements.
-
-
-
- The default value for the "rendering" setting is "speed" which causes borders
- to be painted as plain rectangles. In this mode, no special borders (dotted,
- dashed etc.) are available. If you want support for all border modes, set the
- value to "quality" as indicated above. This will cause the borders to be painted
- as bitmaps.
-
-
- The default value for the "text-rendering" setting is "auto" which paints the
- base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D.
- If the mix of painting methods results in unwelcome output, you can set this
- to "bitmap" which causes all text to be rendered as bitmaps.
-
-
-
-
-
- When it does not work
-
-
FOP searches the configuration file for the information it
-expects, at the position it expects. When that information is not
-present, FOP will not complain, it will just continue. When there is
-other information in the file, FOP will not complain, it will just
-ignore it. That means that when your configuration information is in
-the file but in a different XML element, or in a different XML path,
-than FOP expects, it will be silently ignored.
-
-
Check the following possibilities:
-
-
-
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?
-
-
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 schema element:
-
-
-
-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.
-
-
Run FOP in debug mode (command line option
--d). This makes FOP report which configuration
-information it finds. Check if FOP finds what you expect.
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/embedding.xml b/src/documentation/content/xdocs/0.95/embedding.xml
deleted file mode 100644
index a7c7ccaf8..000000000
--- a/src/documentation/content/xdocs/0.95/embedding.xml
+++ /dev/null
@@ -1,688 +0,0 @@
-
-
-
-
-
-
-
- Apache⢠FOP: Embedding
- How to Embed Apache⢠FOP in a Java application
- $Revision$
-
-
-
-
- Overview
-
- Review Running Apache⢠FOP for important information that applies
- to embedded applications as well as command-line use, such as options and performance.
-
-
- To embed Apache⢠FOP in your application, first create a new
- org.apache.fop.apps.FopFactory instance. This object can be used to launch multiple
- rendering runs. For each run, create a new org.apache.fop.apps.Fop instance through
- one of the factory methods of FopFactory. In the method call you specify which output
- format (i.e. Renderer) to use and, if the selected renderer requires an OutputStream,
- which OutputStream to use for the results of the rendering. You can customize FOP's
- behaviour in a rendering run by supplying your own FOUserAgent instance. The
- FOUserAgent can, for example, be used to set your own Renderer instance (details
- below). Finally, you retrieve a SAX DefaultHandler instance from the Fop object and
- use that as the SAXResult of your transformation.
-
-
- We recently changed FOP's outer API to what we consider the final API. This might require
- some changes in your application. The main reasons for these changes were performance
- improvements due to better reuse of reusable objects and reduced use of static variables
- for added flexibility in complex environments.
-
-
-
- Basic Usage Pattern
-
- Apache FOP relies heavily on JAXP. It uses SAX events exclusively to receive the XSL-FO
- input document. It is therefore a good idea that you know a few things about JAXP (which
- is a good skill anyway). Let's look at the basic usage pattern for FOP...
-
-
Here is the basic pattern to render an XSL-FO file to PDF:
-
-
-
- Let's discuss these 5 steps in detail:
-
-
-
- Step 1: You create a new FopFactory instance. The FopFactory instance holds
- references to configuration information and cached data. It's important to reuse this
- instance if you plan to render multiple documents during a JVM's lifetime.
-
-
- Step 2: You set up an OutputStream that the generated document
- will be written to. It's a good idea to buffer the OutputStream as demonstrated
- to improve performance.
-
-
- Step 3: You create a new Fop instance through one of the factory
- methods on the FopFactory. You tell the FopFactory what your desired output format
- is. This is done by using the MIME type of the desired output format (ex. "application/pdf").
- You can use one of the MimeConstants.* constants. The second parameter is the
- OutputStream you've setup up in step 2.
-
-
- Step 4 We recommend that you use JAXP Transformers even
- if you don't do XSLT transformations to generate the XSL-FO file. This way
- you can always use the same basic pattern. The example here sets up an
- "identity transformer" which just passes the input (Source) unchanged to the
- output (Result). You don't have to work with a SAXParser if you don't do any
- XSLT transformations.
-
-
- Step 5: Here you set up the input and output for the XSLT
- transformation. The Source object is set up to load the "myfile.fo" file.
- The Result is set up so the output of the XSLT transformation is sent to FOP.
- The FO file is sent to FOP in the form of SAX events which is the most efficient
- way. Please always avoid saving intermediate results to a file or a memory buffer
- because that affects performance negatively.
-
-
- Step 6: Finally, we start the XSLT transformation by starting
- the JAXP Transformer. As soon as the JAXP Transformer starts to send its output
- to FOP, FOP itself starts its processing in the background. When the
- transform() method returns FOP will also have finished converting
- the FO file to a PDF file and you can close the OutputStream.
-
- It's a good idea to enclose the whole conversion in a try..finally statement. If
- you close the OutputStream in the finally section, this will make sure that the
- OutputStream is properly closed even if an exception occurs during the conversion.
-
-
-
-
- If you're not totally familiar with JAXP Transformers, please have a look at the
- Embedding examples below. The section contains examples
- for all sorts of use cases. If you look at all of them in turn you should be able
- to see the patterns in use and the flexibility this approach offers without adding
- too much complexity.
-
-
- This may look complicated at first, but it's really just the combination of an
- XSL transformation and a FOP run. It's also easy to comment out the FOP part
- for debugging purposes, for example when you're tracking down a bug in your
- stylesheet. You can easily write the XSL-FO output from the XSL transformation
- to a file to check if that part generates the expected output. An example for that
- can be found in the Embedding examples (See "ExampleXML2FO").
-
-
- Logging
-
- Logging is now a little different than it was in FOP 0.20.5. We've switched from
- Avalon Logging to Jakarta Commons Logging.
- While with Avalon Logging the loggers were directly given to FOP, FOP now retrieves
- its logger(s) through a statically available LogFactory. This is similar to the
- general pattern that you use when you work with Apache Log4J directly, for example.
- We call this "static logging" (Commons Logging, Log4J) as opposed to "instance logging"
- (Avalon Logging). This has a consequence: You can't give FOP a logger for each
- processing run anymore. The log output of multiple, simultaneously running FOP instances
- is sent to the same logger.
-
-
- We know this may be an issue in multi-threaded server environments if you'd like to
- know what's going on in every single FOP processing run. We're planning to add an
- additional feedback facility to FOP which can be used to obtain all sorts of specific
- feedback (validation messages, layout problems etc.). "Static logging" is mainly
- interesting for a developer working on FOP and for advanced users who are debugging
- FOP. We don't consider the logging output to be useful to normal FOP users. Please
- have some patience until we can add this feature or jump in and help us build it. We've
- set up a Wiki page
- which documents what we're going to build.
-
-
- By default, Jakarta Commons Logging uses
- JDK logging (available in JDKs 1.4 or higher) as its backend. You can configure Commons
- Logging to use an alternative backend, for example Log4J. Please consult the
- documentation for Jakarta Commons Logging on
- how to configure alternative backends.
-
-
-
-
- Processing XSL-FO
-
- Once the Fop instance is set up, call getDefaultHandler() to obtain a SAX
- DefaultHandler instance to which you can send the SAX events making up the XSL-FO
- document you'd like to render. FOP processing starts as soon as the DefaultHandler's
- startDocument() method is called. Processing stops again when the
- DefaultHandler's endDocument() method is called. Please refer to the basic
- usage pattern shown above to render a simple XSL-FO document.
-
-
-
-
- Processing XSL-FO generated from XML+XSLT
-
- If you want to process XSL-FO generated from XML using XSLT we recommend
- again using standard JAXP to do the XSLT part and piping the generated SAX
- events directly through to FOP. The only thing you'd change to do that
- on the basic usage pattern above is to set up the Transformer differently:
-
-
-
-
-
- Input Sources
-
- The input XSL-FO document is always received by FOP as a SAX stream (see the
- Parsing Design Document for the rationale).
-
-
- However, you may not always have your input document available as a SAX stream.
- But with JAXP it's easy to convert different input sources to a SAX stream so you
- can pipe it into FOP. That sounds more difficult than it is. You simply have
- to set up the right Source instance as input for the JAXP transformation.
- A few examples:
-
-
-
- URL:Source src = new StreamSource("http://localhost:8080/testfile.xml");
-
-
- File:Source src = new StreamSource(new File("C:/Temp/myinputfile.xml"));
-
-
- String:Source src = new StreamSource(new StringReader(myString)); // myString is a String
-
-
- InputStream:Source src = new StreamSource(new MyInputStream(something));
-
-
- Byte Array:Source src = new StreamSource(new ByteArrayInputStream(myBuffer)); // myBuffer is a byte[] here
-
-
- DOM:Source src = new DOMSource(myDocument); // myDocument is a Document or a Node
-
-
- Java Objects: Please have a look at the Embedding examples which contain an example for this.
-
-
-
- There are a variety of upstream data manipulations possible.
- For example, you may have a DOM and an XSL stylesheet; or you may want to
- set variables in the stylesheet. Interface documentation and some cookbook
- solutions to these situations are provided in
- Xalan Basic Usage Patterns.
-
-
-
- Configuring Apache FOP Programmatically
-
- Apache FOP provides two levels on which you can customize FOP's
- behaviour: the FopFactory and the user agent.
-
-
- Customizing the FopFactory
-
- The FopFactory holds configuration data and references to objects which are reusable over
- multiple rendering runs. It's important to instantiate it only once (except in special
- environments) and reuse it every time to create new FOUserAgent and Fop instances.
-
-
- You can set all sorts of things on the FopFactory:
-
-
-
-
- The font base URL to use when resolving relative URLs for fonts. Example:
-
-
-
-
-
- The hyphenation base URL to use when resolving relative URLs for
- hyphenation patterns. Example:
-
-
-
-
-
- Disable strict validation. When disabled FOP is less strict about the rules
- established by the XSL-FO specification. Example:
-
-
-
-
-
- Enable an alternative set of rules for text indents that tries to mimic the behaviour of many commercial
- FO implementations, that chose to break the specification in this respect. The default of this option is
- 'false', which causes Apache FOP to behave exactly as described in the specification. To enable the
- alternative behaviour, call:
-
-
-
-
-
- Set the source resolution for the document. This is used internally to determine the pixel
- size for SVG images and bitmap images without resolution information. Default: 72 dpi. Example:
-
-
-
-
-
- Manually add an ElementMapping instance. If you want to supply a special FOP extension
- you can give the instance to the FOUserAgent. Normally, the FOP extensions can be automatically detected
- (see the documentation on extension for more info). Example:
-
-
-
-
-
- Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add
- custom URI resolution functionality to FOP. For example, you can use
- Apache XML Commons Resolver to make use of XCatalogs. Example:
-
-
-
- Both the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FopFactory
- is primarily used to resolve URIs on factory-level (hyphenation patterns, for example) and it is always used
- if no other URIResolver (for example on the FOUserAgent) resolved the URI first.
-
-
-
-
-
- Customizing the User Agent
-
- The user agent is the entity that allows you to interact with a single rendering run, i.e. the processing of a single
- document. If you wish to customize the user agent's behaviour, the first step is to create your own instance
- of FOUserAgent using the appropriate factory method on FopFactory and pass that
- to the factory method that will create a new Fop instance:
-
-
-
- You can do all sorts of things on the user agent:
-
-
-
-
- The base URL to use when resolving relative URLs. Example:
-
-
-
-
-
- Set the producer of the document. This is metadata information that can be used for certain output formats such as PDF. The default producer is "Apache FOP". Example:
-
-
-
-
-
- Set the creating user of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Set the author of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Override the creation date and time of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Set the title of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Set the keywords of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Set the target resolution for the document. This is used to
- specify the output resolution for bitmap images generated by bitmap renderers
- (such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter
- effects and such. Default: 72 dpi. Example:
-
-
-
-
-
- Set your own Renderer instance. If you want to supply your own renderer or
- configure a Renderer in a special way you can give the instance to the FOUserAgent. Normally,
- the Renderer instance is created by FOP. Example:
-
-
-
-
-
- Set your own FOEventHandler instance. If you want to supply your own FOEventHandler or
- configure an FOEventHandler subclass in a special way you can give the instance to the FOUserAgent. Normally,
- the FOEventHandler instance is created by FOP. Example:
-
-
-
-
-
- Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add
- custom URI resolution functionality to FOP. For example, you can use
- Apache XML Commons Resolver to make use of XCatalogs. Example:
-
-
-
- Both the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FOUserAgent is
- used for resolving URIs which are document-related. If it's not set or cannot resolve a URI, the URIResolver
- from the FopFactory is used.
-
-
-
-
- You should not reuse an FOUserAgent instance between FOP rendering runs although you can. Especially
- in multi-threaded environment, this is a bad idea.
-
-
-
-
- Using a Configuration File
-
- Instead of setting the parameters manually in code as shown above you can also set
- many values from an XML configuration file:
-
-
-
- The layout of the configuration file is described on the Configuration page.
-
-
-
- Hints
-
- Object reuse
-
- Fop instances shouldn't (and can't) be reused. Please recreate
- Fop and FOUserAgent instances for each rendering run using the FopFactory.
- This is a cheap operation as all reusable information is held in the
- FopFactory. That's why it's so important to reuse the FopFactory instance.
-
-
-
- AWT issues
-
- If your XSL-FO files contain SVG then Apache Batik will be used. When Batik is
- initialised it uses certain classes in java.awt that
- intialise the Java AWT classes. This means that a daemon thread
- is created by the JVM and on Unix it will need to connect to a
- DISPLAY.
-
-
- The thread means that the Java application may not automatically quit
- when finished, you will need to call System.exit(). These
- issues should be fixed in the JDK 1.4.
-
-
- If you run into trouble running FOP on a head-less server, please see the
- notes on Batik.
-
-
-
- Getting information on the rendering process
-
- To get the number of pages that were rendered by FOP you can call
- Fop.getResults(). This returns a FormattingResults object
- where you can look up the number of pages produced. It also gives you the
- page-sequences that were produced along with their id attribute and their
- numbers of pages. This is particularly useful if you render multiple
- documents (each enclosed by a page-sequence) and have to know the number of
- pages of each document.
-
-
-
-
- Improving performance
-
- There are several options to consider:
-
-
-
- Whenever possible, try to use SAX to couple the individual components involved
- (parser, XSL transformer, SQL datasource etc.).
-
-
- Depending on the target OutputStream (in case of a FileOutputStream, but not
- for a ByteArrayOutputStream, for example) it may improve performance considerably
- if you buffer the OutputStream using a BufferedOutputStream:
- out = new java.io.BufferedOutputStream(out);
-
- Make sure you properly close the OutputStream when FOP is finished.
-
-
- Cache the stylesheet. If you use the same stylesheet multiple times
- you can set up a JAXP Templates object and reuse it each time you do
- the XSL transformation. (More information can be found
- here.)
-
-
- Use an XSLT compiler like XSLTC
- that comes with Xalan-J.
-
-
- Fine-tune your stylesheet to make the XSLT process more efficient and to create XSL-FO that can
- be processed by FOP more efficiently. Less is more: Try to make use of property inheritance where possible.
-
-
-
-
- Multithreading FOP
-
- Apache FOP may currently not be completely thread safe.
- The code has not been fully tested for multi-threading issues, yet.
- If you encounter any suspicious behaviour, please notify us.
-
-
- There is also a known issue with fonts being jumbled between threads when using
- the Java2D/AWT renderer (which is used by the -awt and -print output options).
- In general, you cannot safely run multiple threads through the AWT renderer.
-
-
-
- Examples
-
- The directory "{fop-dir}/examples/embedding" contains several working examples.
-
-
- ExampleFO2PDF.java
-
This
-
- example
-demonstrates the basic usage pattern to transform an XSL-FO
-file to PDF using FOP.
-
-
-
-
- ExampleXML2FO.java
-
This
-
- example
-has nothing to do with FOP. It is there to show you how an XML
-file can be converted to XSL-FO using XSLT. The JAXP API is used to do the
-transformation. Make sure you've got a JAXP-compliant XSLT processor in your
-classpath (ex. Xalan).
-
-
-
-
- ExampleXML2PDF.java
-
This
-
- example
-demonstrates how you can convert an arbitrary XML file to PDF
-using XSLT and XSL-FO/FOP. It is a combination of the first two examples
-above. The example uses JAXP to transform the XML file to XSL-FO and FOP to
-transform the XSL-FO to PDF.
-
-
-
-The output (XSL-FO) from the XSL transformation is piped through to FOP using
-SAX events. This is the most efficient way to do this because the
-intermediate result doesn't have to be saved somewhere. Often, novice users
-save the intermediate result in a file, a byte array or a DOM tree. We
-strongly discourage you to do this if it isn't absolutely necessary. The
-performance is significantly higher with SAX.
-
-
-
- ExampleObj2XML.java
-
This
-
- example
-is a preparatory example for the next one. It's an example that
-shows how an arbitrary Java object can be converted to XML. It's an often
-needed task to do this. Often people create a DOM tree from a Java object and
-use that. This is pretty straightforward. The example here, however, shows how
-to do this using SAX, which will probably be faster and not even more
-complicated once you know how this works.
-
-
-
-For this example we've created two classes: ProjectTeam and ProjectMember
-(found in xml-fop/examples/embedding/java/embedding/model). They represent
-the same data structure found in
-xml-fop/examples/embedding/xml/xml/projectteam.xml. We want to serialize to XML a
-project team with several members which exist as Java objects.
-Therefore we created the two classes: ProjectTeamInputSource and
-ProjectTeamXMLReader (in the same place as ProjectTeam above).
-
-
-The XMLReader implementation (regard it as a special kind of XML parser) is
-responsible for creating SAX events from the Java object. The InputSource
-class is only used to hold the ProjectTeam object to be used.
-
-
-Have a look at the source of ExampleObj2XML.java to find out how this is
-used. For more detailed information see other resources on JAXP (ex.
-An older JAXP tutorial).
-
-
-
- ExampleObj2PDF.java
-
This
-
- example
-combines the previous and the third to demonstrate
-how you can transform a Java object to a PDF directly in one smooth run
-by generating SAX events from the Java object that get fed to an XSL
-transformation. The result of the transformation is then converted to PDF
-using FOP as before.
-
-
-
-
- ExampleDOM2PDF.java
-
This
-
- example
-has FOP use a DOMSource instead of a StreamSource in order to
-use a DOM tree as input for an XSL transformation.
-
This
-
- example
-shows the usage of the PDF Transcoder, a sub-application within FOP.
-It is used to generate a PDF document from an SVG file.
-
-
-
- Final notes
-
-These examples should give you an idea of what's possible. It should be easy
-to adjust these examples to your needs. Also, if you have other examples that you
-think should be added here, please let us know via either the fop-users or fop-dev
-mailing lists. Finally, for more help please send your questions to the fop-users
-mailing list.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/extensions.xml b/src/documentation/content/xdocs/0.95/extensions.xml
deleted file mode 100644
index e477ecc61..000000000
--- a/src/documentation/content/xdocs/0.95/extensions.xml
+++ /dev/null
@@ -1,233 +0,0 @@
-
-
-
-
-
-
- Standard Apache⢠FOP Extensions
- $Revision$
-
-
-
- By "extension", we mean any data that can be placed in the input XML document that
- is not addressed by the XSL-FO standard.
- By having a mechanism for supporting extensions, FOP is able to add features that
- are not covered in the specification.
-
-
- The extensions documented here are included with FOP, and are automatically available
- to you. If you wish to add an extension of your own to FOP, please see the
- Developers' Extension Page.
-
- All extensions require the correct use of an appropriate namespace in your input document.
-
- SVG
-
- By convention, FO extensions in FOP use the "fox" namespace prefix.
- To use any of the FO extensions, add a namespace entry for
- http://xmlgraphics.apache.org/fop/extensions to the root element:
-
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.
-
-
- It is possible that in some future release of FOP, all elements with
-"id" attributes will generate named-destinations, which will eliminate the need for
-fox:destination.
-
-
- Table Continuation Label
-
This extension element hasn't been reimplemented for the redesigned code, yet.
-
-
-
- fox:orphan-content-limit and fox:widow-content-limit
-
- The two proprietary extension properties, fox:orphan-content-limit and
- fox:widow-content-limit, are used to improve the layout of list-blocks and tables.
- If you have a table with many entries, you don't want a single row to be left over
- on a page. You will want to make sure that at least two or three lines are kept
- together. The properties take an absolute length which specifies the area at the
- beginning (fox:widow-content-limit) or at the end (fox:orphan-content-limit) of a
- table or list-block. The properties are inherited and only have an effect on fo:table
- and fo:list-block. An example: fox:widow-content-limit="3 * 1.2em" would make sure
- the you'll have at least three lines (assuming line-height="1.2") together on a table
- or list-block.
-
-
-
- fox:external-document
-
- This feature is incomplete. Support for multi-page documents will be added shortly.
- At the moment, only single-page images will work. And this will not work with RTF output.
-
-
- This is a proprietary extension element which allows to add whole images as pages to
- an FO document. For example, if you have a scanned document or a fax as multi-page TIFF
- file, you can append or insert this document using the fox:external-document
- element. Each page of the external document will create one full page in the target
- format.
-
-
- The fox:external-document element is structurally a peer to
- fo:page-sequence, so wherever you can put an fo:page-sequence
- you could also place a fox:external-document.
- Therefore, the specified contents for fo:root change to:
-
- The fox:external-document extension formatting object is used to specify
- how to create a (sub-)sequence of pages within a document. The content of these pages
- comes from the individual subimages/pages of an image or paged document (for example:
- multi-page TIFF in the form of faxes or scanned documents, or PDF files). The
- formatting object creates the necessary areas to display one image per page.
-
-
- In terms of page numbers, the behaviour is the same as for
- fo:page-sequence. The placement of the image inside the page is similar
- to that of fo:external-graphic or fo:instream-foreign-object,
- i.e. the viewport (and therefore the page size) is defined by either the intrinsic
- size of the image or by the size properties that apply to this formatting object.
-
-
Content: EMPTY
-
The following properties apply to this formatting object:
pages: <page-set> (see below) (not implemented, yet)
-
reference-orientation
-
scaling
-
scaling-method
-
src
-
text-align
-
width
-
-
- Datatype "page-set": Value: auto | <integer-range>,
- Default: "auto" which means all pages/subimages of the document.
- <integer-range> allows values such as "7" or "1-3"
-
-
- fox:external-document is not suitable for concatenating FO documents.
- For this, XInclude is recommended.
-
-
-
-
- Free-form Transformation for fo:block-container
-
- For fo:block-container elements whose absolute-position set to
- "absolute" or "fixed" you can use the extension attribute fox:transform
- to apply a free-form transformation to the whole block-container. The content of the
- fox:transform attribute is the same as for
- SVG's transform attribute.
- The transformation specified here is performed in addition to other implicit
- transformations of the block-container (resulting from top, left and other properties)
- and after them.
-
-
- Examples: fox:transform="rotate(45)" would rotate the block-container
- by 45 degrees clock-wise around its upper-left corner.
- fox:transform="translate(10000,0)" would move the block-container to the
- right by 10 points (=10000 millipoints, FOP uses millipoints internally!).
-
-
- This extension attribute doesn't work for all output formats! It's currently only
- supported for PDF, PS and Java2D-based renderers.
-
-
-
- Color functions
-
- XSL-FO supports specifying color using the rgb(), rgb-icc() and system-color() functions.
- Apache FOP provides additional color functions for special use cases. Please note that
- using these functions compromises the interoperability of an FO document.
-
-
- cmyk()
-
color cmyk(numeric, numeric, numeric, numeric)
-
- This function will construct a color in device-specific CMYK color space. The numbers
- must be between 0.0 and 1.0. For output formats that don't support device-specific
- color space the CMYK value is converted to an sRGB value.
-
The following table summarizes the font capabilities of the various FOP renderers:
-
-
-
Renderer
-
Base-14
-
AWT/OS
-
Custom
-
Custom Embedding
-
-
-
PDF
-
yes
-
no
-
yes
-
yes
-
-
-
PostScript
-
yes
-
no
-
yes
-
yes
-
-
-
PCL
-
yes (modified)
-
yes (painted as bitmaps)
-
yes (painted as bitmaps)
-
no
-
-
-
AFP
-
no
-
no
-
yes
-
yes
-
-
-
Java2D/AWT/Bitmap
-
if available from OS
-
yes
-
yes
-
n/a (display only)
-
-
-
Print
-
if available from OS
-
yes
-
yes
-
controlled by OS printer driver
-
-
-
RTF
-
n/a (font metrics not needed)
-
n/a
-
n/a
-
n/a
-
-
-
TXT
-
yes (used for layout but not for output)
-
no
-
yes (used for layout but not for output)
-
no
-
-
-
-
-
XML
-
yes
-
no
-
yes
-
n/a
-
-
-
-
- Base-14 Fonts
-
- The Adobe PostScript and PDF Specification specify a set of 14 fonts that must be
- available to every PostScript interpreter and PDF reader:
- Helvetica (normal, bold, italic, bold italic),
- Times (normal, bold, italic, bold italic),
- Courier (normal, bold, italic, bold italic),
- Symbol and ZapfDingbats.
-
-
- Please note that recent versions of Adobe Acrobat Reader replace
- "Helvetica" with "Arial" and "Times" with "Times New Roman" internally.
- GhostScript replaces "Helvetica" with "Nimbus Sans L" and "Times" with
- "Nimbus Roman No9 L". Other document viewers may do similar font
- substitutions. If you need to make sure that there are no such
- substitutions, you need to specify an explicit font and embed it in
- the target document.
-
-
-
- Missing Fonts
-
- 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).
-
-
-
- Java2D/AWT/Operating System Fonts
-
- The Java2D family of renderers (Java2D, AWT, Print, TIFF, PNG), use the
- Java AWT subsystem for font metric information. Through operating system
- registration, the AWT subsystem knows what fonts are available on the system,
- and the font metrics for each one.
-
-
- When working with one of these output formats and you're missing a font, just
- install it in your operating system and they should be available for these
- renderers. Please note that this is not true for other output formats such as
- PDF or PostScript.
-
-
-
-
- Custom Fonts
-
- Support for custom fonts is highly output format dependent (see above table).
- This section shows how to add Type 1 and TrueType fonts to the PDF, PostScript and
- Java2D-based renderers. Other renderers (like AFP) support other font formats. Details
- in this case can be found on the page about output formats.
-
-
- Prior to FOP version 0.94, 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 is still necessary
- if you want to use a TrueType Collection (*.ttc). Direct support for TrueType
- collections may be added later. Furthermore, the XML font metrics files are still
- required if you don't want to embed, but only reference a font.
-
-
- Basic information about fonts can be found at:
-
- 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.
-
-
-
- Review the documentation for FOP Configuration
- for instructions on making the FOP configuration available to FOP when it runs.
- Otherwise, FOP has no way of finding your custom font information. It is currently
- not possible to easily configure fonts from Java code.
-
-
-
-
- Advanced font configuration
-
- The instructions found above should be sufficient for most users. Below are some
- additional instructions in case the basic font configuration doesn't lead to
- the desired results.
-
-
- Type 1 Font Metrics
-
FOP includes PFMReader, which reads the PFM file that normally comes with a Type 1 font, and generates an appropriate font metrics file for it.
- To use it, run the class org.apache.fop.fonts.apps.PFMReader:
-
Windows:
-
-
Unix:
-
-
PFMReader [options]:
-
-
-fn <fontname> By default, FOP uses the fontname from the
- .pfm file when embedding the font. Use the "-fn" option to override this name with one you have
- chosen. This may be useful in some cases to ensure that applications using the output document
- (Acrobat Reader for example) use the embedded font instead of a local font with the same
- name.
-
- The classpath in the above example has been simplified for readability.
- You will have to adjust the classpath to the names of the actual JAR files in the lib directory.
- xml-apis.jar, xercesImpl.jar, xalan.jar and serializer.jar are not necessary for JDK version 1.4 or later.
- The tool will construct some values (FontBBox, StemV and ItalicAngle) based on assumptions and calculations which are only an approximation to the real values.
- FontBBox and Italic Angle can be found in the human-readable part of the PFB file or in the AFM file.
- The PFMReader tool does not yet interpret PFB or AFM files, so if you want to be correct, you may have to adjust the values in the XML file manually.
- The constructed values however appear to have no visible influence.
-
-
- TrueType Font Metrics
-
FOP includes TTFReader, which reads the TTF file and generates an appropriate font metrics file for it.
- Use it in a similar manner to PFMReader.
- For example, to create such a metrics file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:
-
-
TTFReader [options]:
-
-
-d <DEBUG | INFO > Sets the debug level (default is
- INFO).
-
-fn <fontname> Same as for PFMReader.
-
-ttcname <fontname> If you're reading data from a
- TrueType Collection (.ttc file) you must specify which font from the collection you will read
- metrics from.
- If you read from a .ttc file without this option, the fontnames will be listed for you.
-
-enc ansi Creates a WinAnsi-encoded font metrics file.
- Without this option, a CID-keyed font metrics file is created.
- The table below summarizes the differences between these two encoding options as currently
- used within FOP.
- Please note that this information only applies to TrueType fonts and TrueType collections:
-
-
-
-
Issue
-
WinAnsi
-
CID-keyed
-
-
-
Usable Character Set
-
Limited to WinAnsi character set, which is roughly equivalent to iso-8889-1.
-
Limited only by the characters in the font itself.
-
-
-
Embedding the Font
-
Optional.
-
Mandatory. Not embedding the font produces invalid PDF documents.
-
-
-
- You may experience failures with certain TrueType fonts, especially if they don't contain
- the so-called Unicode "cmap" table. TTFReader can currently not deal with font like this.
-
-
-
- TrueType Collections Font Metrics
-
TrueType collections (.ttc files) contain more than one font.
- To create metrics files for these fonts, you must specify which font in the collection should be generated, by using the "-ttcname" option with the TTFReader.
-
To get a list of the fonts in a collection, just start the TTFReader as if it were a normal TrueType file (without the -ttcname option).
- It will display all of the font names and exit with an Exception.
-
Here is an example of generating a metrics file for a .ttc file:
-
-
-
- Register Fonts with FOP
-
You must tell FOP how to find and use the font metrics files by registering them in the FOP Configuration. Add entries for your custom fonts, regardless of font type, to the configuration file in a manner similar to the following:
-
-
-
- URLs are used to access the font metric and font files.
- Relative URLs are resolved relative to the font-base property (or base) if available.
- See FOP: Configuration for more information.
-
-
The "metrics-url" attribute is generally not necessary except if you run into problems with certain fonts.
-
Either an "embed-url" or a "metrics-url" must be specified for font tag configurations.
-
The font "kerning" attribute is optional. Default is "true".
-
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.
-
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.
-
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.
-
The fonts "auto-detect" tag can be used to automatically register fonts that are found to be installed on the native operating system.
-
Fonts registered with "font" tag configurations override fonts found by means of "directory" tag definitions.
-
Fonts found as a result of a "directory" tag configuration override fonts found as a result of the "auto-detect" tag being specified.
-
- If relative URLs are specified, they are evaluated relative to the value of the
- "font-base" setting. If there is no "font-base" setting, the fonts are evaluated
- relative to the base directory.
-
-
-
-
-
- Auto-Detect and auto-embedd feature
-
When the "auto-detect" flag is set in the configuration, FOP will automatically search for fonts in the default paths for your operating system.
-
FOP will also auto-detect fonts which are available in the classpath, if they are described as "application/x-font" in the MANIFEST.MF file. For example, if your .jar file contains font/myfont.ttf:
-
-
This feature allows you to create JAR files containing fonts. The JAR files can be added to fop by providem them in the classpath, e.g. copying them into the lib/ directory.
-
-
- Embedding
- The PostScript renderer does not yet support TrueType fonts, but can embed Type 1 fonts.
- The font is simply embedded into the PDF file, it is not converted.
-
Font embedding is enabled in the userconfig.xml file and controlled by the embed-url attribute.
- If you don't specify the embed-url attribute the font will not be embedded, but will only be referenced.
-
- Omitting the embed-url attribute for CID-encoded TrueType fonts will currently produce invalid
- PDF files! If you create the XML font metric file using the "-enc ansi" option, you can omit
- the embed-url attribute for TrueType fonts but you're restricted to the WinAnsi character set.
-
-
When FOP embeds a font, it adds a prefix to the fontname to ensure that the name will not match the fontname of an installed font.
- This is helpful with older versions of Acrobat Reader that preferred installed fonts over embedded fonts.
-
When embedding PostScript fonts, the entire font is always embedded.
-
When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a subset of the
- original font, containing only the glyphs used, is embedded in the output document.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/fotree/disabled-testcases.xml b/src/documentation/content/xdocs/0.95/fotree/disabled-testcases.xml
deleted file mode 100644
index f6f78dcf7..000000000
--- a/src/documentation/content/xdocs/0.95/fotree/disabled-testcases.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
- Markers and core function evaluation
- from-table-column_marker.fo
- The code currently evaluates this function according to the column in which the
- marker appears in the source document, rather than the column it is retrieved in.
-
-
diff --git a/src/documentation/content/xdocs/0.95/graphics.xml b/src/documentation/content/xdocs/0.95/graphics.xml
deleted file mode 100644
index b82912ba6..000000000
--- a/src/documentation/content/xdocs/0.95/graphics.xml
+++ /dev/null
@@ -1,567 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Graphics Formats
- $Revision$
-
-
-
- Introduction
-
- 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:
-
-
-
- The image libraries Jimi and JAI are no longer supported. Instead, Apache FOP uses the
- Image I/O API that was introduced with Java 1.4 for all bitmap codecs.
-
-
- Some bitmap images are no longer converted to a standardized 24 bit RGB image but are
- instead handled in their native format.
-
-
- A plug-in mechanism offers a possibility to add support for new formats without changing
- the FOP's source code.
-
- The table below summarizes the theoretical support for graphical formats
- within FOP. In other words, within the constraints of the limitations listed here,
- these formats should work. However, many of them have not been tested,
- and there may be limitations that have not yet been discovered or documented.
- The packages needed to support some formats are not included in the FOP distribution
- and must be installed separately. Follow the links in the "Support Through" columns
- for more details.
-
"(X)" means restricted support. Please see the details below.
-
- [1]: Requires the presence of JAI Image I/O Tools
- (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.
-
-
-
- JAI Image I/O Tools is not the same as the
- JAI library! The
- former simply exposes JAI's codecs using the Image I/O API but does not include all
- the image manipulation functionality.
-
-
- Map of supported image formats by output format
-
- 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:
-
- XML Graphics Commons supports a number
- of graphic file formats natively as basic functionality: all bitmap formats for which
- there are Image I/O codecs available (JPEG, PNG, GIF, TIFF, etc.), EPS and EMF.
-
-
-
- FOP Native
-
- FOP has no native image plug-ins for the image loading framework of its own but currently
- hosts the Batik-dependent SVG and WMF plug-ins until they can be moved to
- Apache Batik.
-
-
-
- Apache Batik
-
- Apache Batik will later receive the
- SVG and WMF plug-ins for the image loading framework that are currently hosted inside
- FOP.
-
-
- Current FOP distributions include a distribution of the
- Apache Batik.
- Because Batik's API changes frequently, it is highly recommended that you use the
- version that ships with FOP, at least when running FOP.
-
- Batik must be run in a graphical environment.
-
- Batik must be run in a graphical environment.
- It uses AWT classes for rendering SVG, which in turn require an X server on Unixish
- systems. If you run a server without X, or if you can't connect to the X server due to
- security restrictions or policies (a so-called "headless" environment), SVG rendering
- will fail.
-
-
Here are some workarounds:
-
-
- Start Java with the -Djava.awt.headless=true command line option.
-
-
- Install an X server which provides an in-memory framebuffer without actually using a
- screen device or any display hardware. One example is Xvfb.
-
-
- Install a toolkit which emulates AWT without the need for an underlying X server. One
- example is the PJA toolkit, which is free
- and comes with detailed installation instructions.
-
-
-
-
- Image I/O
-
- The image loading framework in XML Graphics Commons
- provides a wrapper to load images through the
- JDK's Image I/O API (JSR 015).
- Image I/O allows to dynamically add additional image codecs. An example of such an
- add-on library are the
- JAI Image I/O Tools
- available from Sun.
-
-
-
-
- Details on image formats
-
- BMP
-
- BMP images are supported through an Image I/O codec. There may be limitations of the
- codec which are outside the control of Apache FOP.
-
-
-
- EMF
-
- Windows Enhanced Metafiles (EMF) are only supported in RTF output where they are
- embedded without decoding.
-
-
-
- EPS
-
Apache FOP allows to use EPS files when generating PostScript output only.
-
- Other output targets can't be supported at the moment because
- FOP lacks a PostScript interpreter. Furthermore, FOP is currently not able
- to parse the preview bitmaps sometimes contained in EPS files.
-
-
-
- GIF
-
- GIF images are supported through an Image I/O codec. Transparency is supported but
- not guaranteed to work with every output format.
-
-
-
- JPEG
-
- FOP native support (i.e. the handling of undecoded images) of JPEG does not include all
- variants, especially those containing unusual color lookup tables and color profiles.
- If you have trouble with a JPEG image in FOP, try opening it with an image processing
- program (such as Photoshop or Gimp) and then saving it. Specifying 24-bit color output
- may also help. For the PDF and PostScript renderers most JPEG images can be passed
- through without decompression. User reports indicate that grayscale, RGB, and
- CMYK color spaces are all rendered properly. However, for other output formats, the
- JPEG images have to be decompressed. Tests have shown that there are some limitation
- in some Image I/O codecs concerning images in the CMYK color space. Work-arounds are
- in place but may not always work as expected.
-
-
-
- PNG
-
- PNG images are supported through an Image I/O codec. Transparency is supported but
- not guaranteed to work with every output format.
-
-
-
- SVG
-
- Introduction
-
FOP uses Apache Batik for SVG support.
- This format can be handled as an fo:instream-foreign-object or in a separate
- file referenced with fo:external-graphic.
-
- Batik's SVG Rasterizer utility may also be used to convert standalone SVG
- documents into PDF. For more information please see the
- SVG Rasterizer documentation
- on the Batik site.
-
-
-
- Placing SVG Graphics into PDF
-
- The SVG is rendered into PDF by using PDF commands to draw and fill
- lines and curves. This means that the graphical objects created with
- this remain as vector graphics. The same applies to PostScript output.
- For other output formats the SVG graphic may be converted to a bitmap
- image.
-
-
- There are a number of SVG things that cannot be converted directly into
- PDF. Parts of the graphic such as effects, patterns and images are inserted
- into the PDF as a raster graphic. The resolution of these raster images can
- be controlled through the "target resolution" setting in the
- configuration.
-
- Currently transparency is limited in PDF so many SVG images that
- contain effects or graphics with transparent areas may not be displayed
- correctly.
-
-
-
- Placing SVG Text into PDF and PostScript
-
If possible, Batik will use normal PDF or PostScript text when inserting text. It does
- this by checking if the text can be drawn normally and the font is
- supported. This example svg text.svg /
- text.pdf
- shows how various types and effects with text are handled.
- Note that tspan and outlined text are not yet implemented.
-
- Otherwise, text is converted and drawn as a set of shapes by Batik, using the
- stroking text painter. This means that a typical character will
- have about 10 curves (each curve consists of at least 20 characters).
- This can make the output files large and when it is viewed the
- viewer may not normally draw those fine curves very well (In Adobe Acrobat, turning on
- "Smooth Line Art" in the preferences will fix this). Copy/paste functionality
- will not be supported in this case.
- If the text is inserted into the output file using the inbuilt text commands
- it will use a single character.
-
-
- Note that because SVG text can be rendered as either text or a vector graphic, you
- may need to consider settings in your viewer for both. The Acrobat viewer has both
- "smooth line art" and "smooth text" settings that may need to be set for SVG images
- to be displayed nicely on your screen (see Edit / Preferences / Display).
- This setting will not affect the printing of your document, which should be OK in
- any case, but will only affect the quality of the screen display.
-
-
- Scaling
-
- Currently, SVG images are rendered with the dimensions specified in the SVG
- file, within the viewport specified in the fo:external-graphic element.
- For everything to work properly, the two should be equal. The SVG standard leaves
- this issue as an implementation detail. Additional scaling options are available
- through XSL-FO means.
-
-
- If you use pixels to specify the size of an SVG graphic the "source resolution" setting
- in the configuration will be used to determine the
- size of a pixel. The use of pixels to specify sizes is discouraged as they may
- be interpreted differently in different environments.
-
-
-
- Known Problems
-
-
- Soft mask transparency is combined with white so that it looks better
- on PDF 1.3 viewers but this causes the soft mask to be slightly lighter
- or darker on PDF 1.4 viewers.
-
-
- There is some problem with a gradient inside a pattern which may cause a PDF
- error when viewed in Acrobat 5.
-
-
- Text is not always handled correctly, it may select the wrong font
- especially if characters have multiple fonts in the font list.
-
-
- Uniform transparency for images and other SVG elements that are converted
- into a raster graphic are not drawn properly in PDF. The image is opaque.
-
-
-
-
-
- TIFF
-
- FOP can embed TIFF images without decompression into PDF, PostScript and AFP if they
- have either CCITT T.4, CCITT T.6, or JPEG compression. Otherwise, a TIFF-capable
- Image I/O codec is necessary for decoding the image.
-
-
- There may be some limitation concerning images in the CMYK color space.
-
-
-
- WMF
-
- Windows Metafiles (WMF) are supported through classes in
- Apache Batik. At the moment, support
- for this format is experimental and may not always work as expected.
-
-
-
-
- Graphics Resolution
-
- Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution
- values. FOP tries to use this resolution information whenever possible to determine
- the image's intrinsic size. This size is used during the layout process when it is not
- superseded by an explicit size on fo:external-graphic (content-width and content-height
- properties).
-
-
- Please note that not all images contain resolution information. If it's not available
- the source resolution set on the FopFactory (or through the user configuration XML) is used.
- The default here is 72 dpi.
-
-
- Bitmap images are generally embedded into the output format at their original resolution
- (as is). No resampling of the image is performed. Explicit resampling is on our wishlist,
- but hasn't been implemented, yet. Bitmaps included in SVG graphics may be resampled to
- the resolution specified in the "target resolution" setting in the
- configuration if SVG filters are applied. This can be
- used as a work-around to resample images in FO documents.
-
-
-
- Page selection for multi-page formats
-
- 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:
- <uri>#page=<nr>
- (for example: http://localhost/images/myimage.tiff#page=3)
-
-
-
- Image caching
-
- FOP caches images between runs. There is one cache per FopFactory instance. The URI is
- used as a key to identify images which means that when a particular URI appears again,
- the image is taken from the cache. If you have a servlet that generates a different
- image each time it is called with the same URI you need to use a constantly
- changing dummy parameter on the URI to avoid caching.
-
-
- The image cache has been improved considerably in the redesigned code. Therefore,
- resetting the image cache should be a thing of the past. If you
- still experience OutOfMemoryErrors, please notify us.
-
-
- If all else fails, the image cache can be cleared like this:
- fopFactory.getImageManager().getCache().clearCache();
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/hyphenation.xml b/src/documentation/content/xdocs/0.95/hyphenation.xml
deleted file mode 100644
index 1d1c63d82..000000000
--- a/src/documentation/content/xdocs/0.95/hyphenation.xml
+++ /dev/null
@@ -1,237 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Hyphenation
- $Revision$
-
-
-
- Hyphenation Support
-
- Introduction
-
Apache⢠FOP uses Liang's hyphenation algorithm, well known from TeX. It needs
- language specific pattern and other data for operation.
- If you have made improvements to an existing FOP hyphenation pattern,
- or if you have created one from scratch, please consider contributing these
- to OFFO so that they can benefit other FOP users as well.
- Please inquire on the FOP User
- mailing list.
-
-
- License Issues
-
Many of the hyphenation files distributed with TeX and its offspring are
- licenced under the LaTeX
- Project Public License (LPPL), which prevents them from being
- distributed with Apache software. The LPPL puts restrictions on file names
- in redistributed derived works which we feel can't guarantee. Some
- hyphenation pattern files have other or additional restrictions, for
- example against use for commercial purposes.
-
Although Apache FOP cannot redistribute hyphenation pattern files that do
- not conform with its license scheme, that does not necessarily prevent users
- from using such hyphenation patterns with FOP. However, it does place on
- the user the responsibility for determining whether the user can rightly use
- such hyphenation patterns under the hyphenation pattern license.
- The user is responsible to settle license issues for hyphenation
- pattern files that are obtained from non-Apache sources.
-
-
- Sources of Custom Hyphenation Pattern Files
-
The most important source of hyphenation pattern files is the
- CTAN TeX
- Archive.
-
-
- Installing Custom Hyphenation Patterns
-
To install a custom hyphenation pattern for use with FOP:
-
-
Convert the TeX hyphenation pattern file to the FOP format. The FOP
- format is an xml file conforming to the DTD found at
- {fop-dir}/hyph/hyphenation.dtd.
-
Name this new file following this schema:
- languageCode_countryCode.xml. The country code is
- optional, and should be used only if needed. For example:
-
-
en_US.xml would be the file name for American
- English hyphenation patterns.
-
it.xml would be the file name for Italian
- hyphenation patterns.
-
- The language and country codes must match the XSL-FO input, which
- follows ISO
- 639 (languages) and ISO
- 3166 (countries). NOTE: The ISO 639/ISO 3166 convention is that
- language names are written in lower case, while country codes are written
- in upper case. FOP does not check whether the language and country specified
- in the FO source are actually from the current standard, but it relies
- on it being two letter strings in a few places. So you can make up your
- own codes for custom hyphenation patterns, but they should be two
- letter strings too (patches for proper handling extensions are welcome)
-
There are basically three ways to make the FOP-compatible hyphenation pattern
- file(s) accessible to FOP:
-
-
Download the precompiled JAR from OFFO
- and place it either in the {fop-dir}/lib directory, or
- in a directory of your choice (and append the full path to the JAR to
- the environment variable FOP_HYPHENATION_PATH).
-
Download the desired FOP-compatible hyphenation pattern file(s) from
- OFFO,
- and/or take your self created hyphenation pattern file(s),
-
-
place them in the directory {fop-dir}/hyph,
-
or place them in a directory of your choice and set the Ant variable
- user.hyph.dir to point to that directory (in
- build-local.properties),
-
- and run Ant with build target
- jar-hyphenation. This will create a JAR containing the
- compiled patterns in {fop-dir}/build that will be added to the
- classpath on the next run.
- (When FOP is built from scratch, and there are pattern source file(s)
- present in the directory pointed to by the
- user.hyph.dir variable, this JAR will automatically
- be created from the supplied pattern(s)).
-
Put the pattern source file(s) into a directory of your choice and
- configure FOP to look for custom patterns in this directory, by setting the
- <hyphenation-base>
- configuration option.
-
-
-
-
- Either of these three options will ensure hyphenation is working when using
- FOP from the command-line. If FOP is being embedded, remember to add the location(s)
- of the hyphenation JAR(s) to the CLASSPATH (option 1 and 2) or to set the
- <hyphenation-dir>
- configuration option programmatically (option 3).
-
-
-
-
- Hyphenation Patterns
-
If you would like to build your own hyphenation pattern files, or modify
- existing ones, this section will help you understand how to do so. Even
- when creating a pattern file from scratch, it may be beneficial to start
- with an existing file and modify it. See
- OFFO's Hyphenation page for examples.
- Here is a brief explanation of the contents of FOP's hyphenation patterns:
- The remaining content of this section should be considered "draft"
- quality. It was drafted from theoretical literature, and has not been
- tested against actual FOP behavior. It may contain errors or omissions.
- Do not rely on these instructions without testing everything stated here.
- If you use these instructions, please provide feedback on the
- FOP User mailing list, either
- confirming their accuracy, or raising specific problems that we can
- address.
-
-
The root of the pattern file is the <hyphenation-info> element.
-
<hyphen-char>: its attribute "value" contains the character signalling
- a hyphen in the <exceptions> section. It has nothing to do with the
- hyphenation character used in FOP, use the XSLFO hyphenation-character
- property for defining the hyphenation character there. At some points
- a dash U+002D is hardwired in the code, so you'd better use this too
- (patches to rectify the situation are welcome). There is no default,
- if you declare exceptions with hyphenations, you must declare the
- hyphen-char too.
-
<hyphen-min> contains two attributes:
-
-
before: the minimum number of characters in a word allowed to exist
- on a line immediately preceding a hyphenated word-break.
-
after: the minimum number of characters in a word allowed to exist
- on a line immediately after a hyphenated word-break.
-
- This element is unused and not even read. It should be considered a
- documentation for parameters used during pattern generation.
-
-
<classes> contains whitespace-separated character sets. The members
- of each set should be treated as equivalent for purposes of hyphenation,
- usually upper and lower case of the same character. The first character
- of the set is the canonical character, the patterns and exceptions
- should only contain these canonical representation characters (except
- digits for weight, the period (.) as word delimiter in the patterns and
- the hyphen char in exceptions, of course).
-
<exceptions> contains whitespace-separated words, each of which
- has either explicit hyphen characters to denote acceptable breakage
- points, or no hyphen characters, to indicate that this word should
- never be hyphenated, or contain explicit <hyp> elements for specifying
- changes of spelling due to hyphenation (like backen -> bak-ken or
- Stoffarbe -> Stoff-farbe in the old german spelling). Exceptions override
- the patterns described below. Explicit <hyp> declarations don't work
- yet (patches welcome). Exceptions are generally a bit brittle, test
- carefully.
-
<patterns> includes whitespace-separated patterns, which are what
- drive most hyphenation decisions. The characters in these patterns are
- explained as follows:
-
-
non-numeric characters represent characters in a sub-word to be
- evaluated
-
the period character (.) represents a word boundary, i.e. either
- the beginning or ending of a word
-
numeric characters represent a scoring system for indicating the
- acceptability of a hyphen in this location. Odd numbers represent an
- acceptable location for a hyphen, with higher values overriding lower
- inhibiting values. Even numbers indicate an unacceptable location, with
- higher values overriding lower values indicating an acceptable position.
- A value of zero (inhibiting) is implied when there is no number present.
- Generally patterns are constructed so that valuse greater than 4 are rare.
- Due to a bug currently patterns with values of 8 and greater don't
- have an effect, so don't wonder.
-
- Here are some examples from the English patterns file:
-
-
Knuth (The TeXBook, Appendix H) uses the example hach4, which indicates that it is extremely undesirable to place a hyphen after the substring "hach", for example in the word "toothach-es".
-
.leg5e indicates that "leg-e", when it occurs at the beginning of a word, is a very good place to place a hyphen, if one is needed. Words like "leg-end" and "leg-er-de-main" fit this pattern.
-
- Note that the algorithm that uses this data searches for each of the word's substrings in the patterns, and chooses the highest value found for letter combination.
-
-
-
If you want to convert a TeX hyphenation pattern file, you have to undo
- the TeX encoding for non-ASCII text. FOP uses Unicode, and the patterns
- must be proper Unicode too. You should be aware of the XML encoding issues,
- preferably use a good Unicode editor.
-
Note that FOP does not do Unicode character normalization. If you use
- combining chars for accents and other character decorations, you must
- declare character classes for them, and use the same sequence of base character
- and combining marks in the XSLFO source, otherwise the pattern wouldn't match.
- Fortunately, Unicode provides precomposed characters for all important cases
- in common languages, until now nobody run seriously into this issue. Some dead
- languages and dialects, especially ancient ones, may pose a real problem
- though.
-
If you want to generate your own patterns, an open-source utility called
- patgen is available on many Unix/Linux distributions and every TeX
- distribution which can be used to assist in
- creating pattern files from dictionaries. Pattern creation for languages like
- english or german is an art. If you can, read Frank Liang's original paper
- "Word Hy-phen-a-tion by Com-pu-ter" (yes, with hyphens). It is not available
- online. The original patgen.web source, included in the TeX source distributions,
- contains valuable comments, unfortunately technical details obscure often the
- high level issues. Another important source is
- The
- TeX Book, appendix H (either read the TeX source, or run it through
- TeX to typeset it). Secondary articles, for example the works by Petr Sojka,
- may also give some much needed insight into problems arising in automated
- hyphenation.
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/index.xml b/src/documentation/content/xdocs/0.95/index.xml
deleted file mode 100644
index 49d07332c..000000000
--- a/src/documentation/content/xdocs/0.95/index.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP Version 0.95
- $Revision$
-
-
-
- Introduction
-
- 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.
-
-
- This sixth release contains many bug fix release and new features compared
- to 0.94. To see what has changed since the last release, please visit the
- Changes Page and the
- Release Notes.
-
-
-
- Upgrading from an earlier version
-
- If you're upgrading to this version from an earlier version of FOP, please read the
- information contained on the Upgrading page!
-
-
-
- Download
-
- To download this version, please visit the download page.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/intermediate.xml b/src/documentation/content/xdocs/0.95/intermediate.xml
deleted file mode 100644
index e46190276..000000000
--- a/src/documentation/content/xdocs/0.95/intermediate.xml
+++ /dev/null
@@ -1,146 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Intermediate Format
- $Revision$
-
-
-
- Please note that the intermediate format is an advanced feature and can be ignored by most
- users of Apache⢠FOP.
-
-
- Introduction
-
- The intermediate format (IF) is a proprietary XML format that represents the area tree
- generated by the layout engine. The area tree is conceptually defined in the
- XSL-FO specification in chapter 1.1.2.
- The IF can be generated through the area tree XML Renderer (the XMLRenderer).
-
-
- The intermediate format can be used to generate intermediate documents that are modified
- before they are finally rendered to their ultimate output format. Modifications include
- adjusting and changing trait values, adding or modifying area objects, inserting prefabricated
- pages, overlays, imposition (n-up, rotation, scaling etc.). Multiple IF files can be combined
- to a single output file.
-
-
-
- Usage of the Intermediate Format
-
- As already mentioned, the IF is generated by using the XMLRenderer (MIME type:
- application/X-fop-areatree). So, you basically set the right MIME type for
- the output format and process your FO files as if you would create a PDF file. However, there
- is an important detail to consider: The various Renderers don't all use the same font sources.
- To be able to create the right area tree for the ultimate output file, you need to create
- the IF file using the right font setup. This is achieved by telling the XMLRenderer to mimic
- another renderer. This is done by calling the XMLRenderer's mimicRenderer() method with an
- instance of the ultimate target renderer as the single parameter. This has a consequence: An
- IF file rendered with the Java2DRenderer may not look as expected when it was actually generated
- for the PDF renderer. For renderers that use the same font setup, this restriction does not
- apply (PDF and PS, for example). Generating the intermediate format file is the first step.
-
-
- The second step is to reparse the IF file using the AreaTreeParser which is
- found in the org.apache.fop.area package. The pages retrieved from the IF file are added to an
- AreaTreeModel instance from where they are normally rendered using one of the available Renderer
- implementations. You can find examples for the IF processing in the
- examples/embedding
- directory in the FOP distribution
-
-
- The basic pattern to parse the IF format looks like this:
-
-
-
- This example simply reads an IF file and renders it to a PDF file. Please note, that in normal
- FOP operation you're shielded from having to instantiate the FontInfo object yourself. This
- is normally a task of the AreaTreeHandler which is not present in this scenario. The same
- applies to the AreaTreeModel instance, in this case an instance of a subclass called
- RenderPagesModel. RenderPagesModel is ideal in this case as it has very little overhead
- processing the individual pages. An important line in the example is the call to
- endDocument() on the AreaTreeModel. This lets the Renderer know that the processing
- is now finished.
-
-
- The intermediate format can also be used from the command-line
- by using the "-atin" parameter for specifying the area tree XML as input file. You can also
- specify a "mimic renderer" by inserting a MIME type between "-at" and the output file.
-
-
- Concatenating Documents
-
- This initial example is obviously not very useful. It would be faster to create the PDF file
- directly. As the ExampleConcat.java
- example shows you can easily parse multiple IF files in a row and add the parsed pages to the
- same AreaTreeModel instance which essentially concatenates all the input document to one single
- output document.
-
-
-
- Modifying Documents
-
- One of the most important use cases for the intermediate format is obviously modifying the area
- tree XML before finally rendering it to the target format. You can easily use XSLT to process
- the IF file according to your needs. Please note, that we will currently not formally describe
- the intermediate format. You need to have a good understanding its structure so you don't
- create any non-parseable files. We may add an XML Schema and more detailed documentation at a
- later time. You're invited to help us with that.
-
-
-
- Advanced Use
-
- The generation of the intermediate format as well as it parsing process has been designed to allow
- for maximum flexibility and optimization. Please note that you can call setTransformerHandler() on
- XMLRenderer to give the XMLRenderer your own TransformerHandler instance in case you would like to
- do custom serialization (to a W3C DOM, for example) and/or to directly modify the area tree using
- XSLT. The AreaTreeParser on the other side allows you to retrieve a ContentHandler instance where
- you can manually send SAX events to to start the parsing process (see getContentHandler()).
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/known-issues.xml b/src/documentation/content/xdocs/0.95/known-issues.xml
deleted file mode 100644
index 6e28e3fb7..000000000
--- a/src/documentation/content/xdocs/0.95/known-issues.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
- MIF and SVG output support have not been restored, yet.
-
-
- Auto table layout is not implemented, yet.
-
-
- Footnotes may overlap with text of the region-body in multi-column
- documents.
-
-
- Space resolution does not work between footnote regions.
-
-
- There's a problem involving nested block-containers and
- reference-orientation 180/-180 (Bugzilla #36391)
-
-
- block-containers with no height currently don't create a fence for
- spaces as they should (they behave like a normal block).
-
-
- Preserved linefeeds in fo:character are not handled correctly.
-
-
- An empty block currently produces a fence for stacking constraints
- which it shouldn't.
-
-
- There are several small problems around white space handling.
-
-
- leaders with leader-pattern="use-content" may not work as expected.
-
-
- 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.
-
-
- background-images on page-number-citations are not placed correctly.
-
-
- Not all FO elements can be referenced by their "id", most notably:
- table-body, table-header, table-footer and table-row.
-
-
- Column balancing in multi-column documents may not work as expected
- (Bugzilla #36356)
-
-
diff --git a/src/documentation/content/xdocs/0.95/knownissues_overview.xml b/src/documentation/content/xdocs/0.95/knownissues_overview.xml
deleted file mode 100644
index 53d65a2ca..000000000
--- a/src/documentation/content/xdocs/0.95/knownissues_overview.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Known Issues
- $Revision$
-
-
-
- Known issues
-
- This page lists currently known issues in the current release.
-
-
-
- For additional information on known issues in Apache⢠FOP, please have a look at the following pages, too:
-
- Apache FOP has an extensive automated testing infrastructure. Parts of this infrastructure are several
- sets of test cases. When a test case is listed in disabled-testcases.xml it is disabled in the JUnit
- tests during the normal build process. This indicates a problem in the current codebase. When a bug is
- fixed or a missing feature is added the entry for the relevant test case(s) are removed.
-
-
- FO Tree
-
- This section lists disabled test cases in the test suite for the FO tree tests, at the time
- of the release.
-
-
-
-
- Layout Engine
-
- This section lists disabled test cases in the test suite for the layout engine tests, at the
- time of the release.
-
-
-
-
- Other known issues
-
This section lists other known issues.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/layoutengine/disabled-testcases.xml b/src/documentation/content/xdocs/0.95/layoutengine/disabled-testcases.xml
deleted file mode 100644
index b4de16ef4..000000000
--- a/src/documentation/content/xdocs/0.95/layoutengine/disabled-testcases.xml
+++ /dev/null
@@ -1,260 +0,0 @@
-
-
-
-
-
-
-
- External link around an SVG not properly sized
- basic-link_external-destination_2.xml
- The bpd trait of the inlineparent area for the basic-link
- is not sized correctly if it wraps an image that is higher than the
- nominal line.
-
-
- Auto-height block-containers produce fences
- block-container_space-before_space-after_3.xml
- Block-containers with no height currently don't
- create a fence for spaces as they should (they behave like a
- normal block).
-
-
- font-stretch NYI
- block_font-stretch.xml
- Font-stretch is not implemented, yet.
-
-
- Hyphenation with preserved linefeeds
- block_hyphenation_linefeed_preserve.xml
- When hyphenation is enabled and linefeeds are preserved,
- the text is output multiple times.
-
-
- linefeed-treatment
- block_linefeed-treatment.xml
- Preserved linefeeds in a fo:character are not handled
- correctly.
-
-
- white-space-treatment
- block_white-space-treatment_3.xml
- White space handling incorrectly stops at fo:inline
- boundaries when it comes to formatter generated line breaks.
-
-
- Empty blocks produce fences
- block_space-before_space-after_8.xml
- An empty block currently produces a fence for
- stacking constraints which it shouldn't.
-
-
- block white-space nbsp 2
- block_white-space_nbsp_2.xml
- The nbsp given as an fo:character is not adjustable and therefore
- the justification does not work in this case.
-
-
- block word-spacing
- block_word-spacing.xml
- Word-spacing may not work as expected.
-
-
- block word-spacing text-align justify
- block_word-spacing_text-align_justify.xml
- Word-spacing may not work as expected.
-
-
- external-graphic don't shrink
- external-graphic_oversized.xml
- Images currently don't shrink so they fit on a page
- when they are too big and shrinking is allowed to
- happen (min/opt/max).
-
-
- Test case with HTTP URL
- external-graphic_src_uri.xml
- Doesn't work behind a proxy which requires
- authorization.
-
-
- Space Resolution in foot note area
- footnote_space-resolution.xml
- Space resolution does not work between footnote
- regions.
-
-
- Footnotes swallowed in lists
- footnote_in_list.xml
- 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.
- http://issues.apache.org/bugzilla/show_bug.cgi?id=37579
-
-
- Footnotes swallowed in tables
- footnote_in_table.xml
- 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.
- http://issues.apache.org/bugzilla/show_bug.cgi?id=37579
-
-
- NPE for table inside an inline
- inline_block_nested_3.xml
- Placing a table as a child of an fo:inline produces a
- NullPointerException.
-
-
- inline-container is not implemented, yet.
- inline-container_block_nested.xml
- inline-container is not implemented, yet. Content of an
- inline-container will get swallowed. The test case contains no checks.
-
-
- inline-container is not implemented, yet.
- inline-container_border_padding.xml
- inline-container is not implemented, yet. Content of an
- inline-container will get swallowed.
-
-
- inline letter-spacing
- inline_letter-spacing.xml
- Letter-spacing may not work as
- expected within fo:inline.
-
-
- inline word-spacing
- inline_word-spacing.xml
- Word-spacing may not work as expected within
- fo:inline.
-
-
- inline word-spacing text-align justify
- inline_word-spacing_text-align_justify.xml
-
-
-
- leader-alignment NYI
- leader-alignment.xml
- Leader-alignment is not yet
- implemented.
-
-
- leader-pattern="use-content": Problem with line height
- leader_leader-pattern_use-content_bug.xml
- Line height is not correctly calculated for
- use-content leaders whose height is larger than the rest of the
- line.
- http://www.nabble.com/leaders-with-leader-pattern%3D%22use-content%22-t546244.html
-
-
- keep-with-previous doesn't work in lists
- list-block_keep-with-previous.xml
- Keep-with-previous doesn't work inside tables and
- lists, yet.
-
-
- keep-with-previous doesn't work in lists
- list-item_block_keep-with-previous.xml
- Keep-with-previous doesn't work inside tables and
- lists, yet.
-
-
- Page breaking doesn't deal with IPD changes
- page-breaking_4.xml
- Page breaking currently doesn't support changing available IPD
- between pages of a single page-sequence. Element list generation has to be reset to
- redetermine line breaks in this case.
-
-
- Overflow handing is incomplete
- page-breaking_6.xml
- Line breaking is not 100% correct when there's too little space.
- Overflows are not detected and warned.
-
-
- Indefinite page height handling is imcomplete
- page-height_indefinite_simple.xml
- A RuntimeException is thrown for a page of indefinite height. Lots of warnings.
-
-
- page-number-citation: Problem with background-image
- page-number-citation_background-image.xml
- Background-images on page-number-citations are not
- placed correctly.
-
-
- page-number-citation-last: FOs spanning multiple pages are not properly handled.
- page-number-citation-last_basic.xml
- Resolution of forward references does not wait until an FO is fully finished when an FO spans multiple pages.
-
-
- IDs are not working on all FO elements
- page-number-citation_complex_1.xml
- The "id" attributes are not properly handled for all block-level FO elements.
-
-
- IDs are not working on all FO elements
- page-number-citation_complex_2.xml
- The "id" attributes are not properly handled for all inline-level FO elements.
-
-
- Footnotes in multi-column documents
- region-body_column-count_footnote.xml
- Footnotes may overlap with text of the region-body in
- multi-column documents.
-
-
- Column Balancing problems
- region-body_column-count_balance_4col.xml
- Situation in a 4-column document where the column balancing doesn't work and even causes some
- content to disappear.
-
-
- Column Balancing problems
- region-body_column-count_bug36356.xml
- Column balancing doesn't work as expected.
-
-
- table-cell empty area with marker.xml
- table-cell_empty_area_with_marker.xml
- A table-cell producing an empty area does currently not add any markers to a page.
- See TODO entry in AreaAdditionUtil.
-
-
- Border conditionality on table
- table_border-width_conditionality.xml
- The code should be ok, but the test case uses shorthands and therefore
- is probably not expressing the indended outcome according to the spec. The test
- case should be revisited.
-
-
- fo:wrapper around block-level content (with id)
- wrapper_block_id.xml
- "id" attributes on fo:wrapper around block-level content don't get
- added to the area tree.
-
-
- Soft hyphen with normal hyphenation enabled
- block_shy_linebreaking_hyph.xml
- A soft hyphen should be a preferred as break compared to a
- normal hyphenation point but is not.
-
-
diff --git a/src/documentation/content/xdocs/0.95/metadata.xml b/src/documentation/content/xdocs/0.95/metadata.xml
deleted file mode 100644
index 5d4185533..000000000
--- a/src/documentation/content/xdocs/0.95/metadata.xml
+++ /dev/null
@@ -1,243 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Metadata
-
-
-
- Overview
-
- 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
- XMP (eXtensible Metadata Platform, specified by Adobe).
- 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.
-
-
-
- Embedding XMP in an XSL-FO document
-
- 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.
-
-
- Document-level metadata can be specified in the fo:declarations element.
- XMP specification recommends to use x:xmpmeta, rdf:RDF, and
- rdf:Description elements as shown in example below. Both
- x:xmpmeta and rdf:RDF elements are recognized as the top-level
- element introducing an XMP fragment (as per the XMP specification).
-
-
- Example
-
-
- fo:declarationsmust be declared after
- fo:layout-master-set and before the first page-sequence.
-
-
-
-
- Implementation in Apache FOP
-
- Currently, XMP support is only available for PDF output.
-
-
- 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.
-
-
- 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.
-
-
- The mapping between the Info and the Metadata object used by Apache FOP comes from
- the PDF/A-1 specification.
- For convenience, here's the mapping table:
-
-
-
-
Document information dictionary
-
XMP
-
-
-
Entry
-
PDF type
-
Property
-
XMP type
-
Category
-
-
-
Title
-
text string
-
dc:title
-
Text
-
External
-
-
-
Author
-
text string
-
dc:creator
-
seq Text
-
External
-
-
-
Subject
-
text string
-
dc:description["x-default"]
-
Text
-
External
-
-
-
Keywords
-
text string
-
pdf:Keywords
-
Text
-
External
-
-
-
Creator
-
text string
-
xmp:CreatorTool
-
Text
-
External
-
-
-
Producer
-
text string
-
pdf:Producer
-
Text
-
Internal
-
-
-
CreationDate
-
date
-
xmp:CreationDate
-
Date
-
Internal
-
-
-
ModDate
-
date
-
xmp:ModifyDate
-
Date
-
Internal
-
-
-
- "Internal" in the Category column means that the user should not set this value.
- It is set by the application.
-
-
- The "Subject" used to be mapped to dc:subject in the initial publication of
- PDF/A-1 (ISO 19005-1). In the
- Technical Corrigendum 1
- this was changed to map to dc:description["x-default"].
-
-
- Namespaces
-
- Metadata is made of property sets where each property set uses a different namespace URI.
-
-
- 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:
-
-
-
-
Set/Schema
-
Namespace Prefix
-
Namespace URI
-
-
-
Dublin Core
-
dc
-
http://purl.org/dc/elements/1.1/
-
-
-
XMP Basic
-
xmp
-
http://ns.adobe.com/xap/1.0/
-
-
-
Adobe PDF Schema
-
pdf
-
http://ns.adobe.com/pdf/1.3/
-
-
-
- Please refer to the XMP Specification
- for information on other metadata namespaces.
-
-
- 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.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/output.xml b/src/documentation/content/xdocs/0.95/output.xml
deleted file mode 100644
index 16130e8e6..000000000
--- a/src/documentation/content/xdocs/0.95/output.xml
+++ /dev/null
@@ -1,914 +0,0 @@
-
-
-
-
-
-
-
- Apache⢠FOP Output Formats
- $Revision$
-
-
-
-
-
-
-
-
- Apache⢠FOP supports multiple output formats by using a different renderer for each format.
- The renderers do not all have the same set of capabilities, sometimes because of
- the output format itself, sometimes because some renderers get more development
- attention than others.
-
-
- General Information
-
- Fonts
-
- Most FOP renderers use a FOP-specific system for font registration.
- However, the Java2D/AWT and print renderers use the Java AWT package, which gets its
- font information from the operating system registration.
- This can result in several differences, including actually using different fonts,
- and having different font metrics for the same font.
- The net effect is that the layout of a given FO document can be quite different between
- renderers that do not use the same font information.
-
-
- 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.
-
-
- 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
- intermediate format. 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):
-
-
-
- Produce an IF file: fop -fo myfile.fo -at application/pdf myfile.at.xml
- 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.
-
-
Render to a PDF file: fop -atin myfile.at.xml -pdf myfile.pdf
-
Render to a Java2D-based renderer:
-
-
fop -atin myfile.at.xml -print
-
fop -atin myfile.at.xml -awt
-
fop -atin myfile.at.xml -tiff myfile.tiff
-
-
-
-
-
- Output to a Printer or Other Device
-
- The most obvious way to print your document is to use the FOP
- print renderer, which uses the Java2D API (AWT).
- However, you can also send output from the Postscript renderer directly to a Postscript
- device, or output from the PCL renderer directly to a PCL device.
-
-
- Here are Windows command-line examples for Postscript and PCL:
-
-
-
-
- Here is some Java code to accomplish the task in UNIX:
-
-
-
- Set the output MIME type to "application/x-pcl" (MimeConstants.MIME_PCL) and
- it happily sends the PCL to the UNIX printer queue.
-
-
-
-
- PDF
-
- PDF is the best supported output format. It is also the most accurate
- with text and layout. This creates a PDF document that is streamed out
- as each page is rendered. This means that the internal page index
- information is stored near the end of the document.
- The PDF version supported is 1.4. PDF versions are forwards/backwards
- compatible.
-
-
- Note that FOP does not currently support "tagged PDF" or PDF/A-1a.
- Support for PDF/A-1b and PDF/X has recently been added, however.
-
-
- Fonts
-
- PDF has a set of fonts that are always available to all PDF viewers;
- to quote from the PDF Specification:
-
- "PDF prescribes a set of 14 standard fonts that can be used without prior
- definition.
- These include four faces each of three Latin text typefaces (Courier,
- Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf
- Dingbats). These fonts, or suitable substitute fonts with the same metrics, are
- guaranteed to be available in all PDF viewer applications."
-
-
-
- Post-processing
-
- FOP does not currently support several desirable PDF features: 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.
-
-
- Another popular post-processing tool is iText,
- which has tools for adding security features, document properties, watermarks, and many
- other features to PDF files.
-
-
- Caveat: iText may swallow PDF bookmarks. But
- Jens Stavnstrup tells us
- that this doesn't happen if you use iText's PDFStamper.
-
-
- Here is some sample code that uses iText to encrypt a FOP-generated PDF. (Note that FOP now
- supports PDF encryption. However the principles for using
- iText for other PDF features are similar.)
-
-
-
- Check the iText tutorial and documentation for setting access flags, password,
- encryption strength and other parameters.
-
-
-
- Watermarks
-
- In addition to the PDF Post-processing options, consider the following workarounds:
-
-
-
- Use a background image for the body region.
-
-
- (submitted by Trevor Campbell) Place an image in a
- region that overlaps the flowing text. For example, make
- region-before large enough to contain your image. Then include a
- block (if necessary, use an absolutely positioned block-container)
- containing the watermark image in the static-content for the
- region-before. Note that the image will be drawn on top of the
- normal content.
-
-
-
-
-
- PostScript
-
- The PostScript renderer has been brought up to a similar quality as the
- PDF renderer, but may still be missing certain features. It provides good
- support for most text and layout.
- Images and SVG are not fully supported, yet. Currently, the PostScript
- renderer generates PostScript Level 3 with most DSC comments. Actually,
- the only Level 3 features used are the FlateDecode and DCTDecode
- filter (the latter is used for 1:1 embedding of JPEG images), everything
- else is Level 2.
-
-
- Configuration
-
- The PostScript renderer configuration currently allows the following settings:
-
-
-
- The default value for the "auto-rotate-landscape" setting is "false". Setting it
- to "true" will automatically rotate landscape pages and will mark them as landscape.
-
-
- The default value for the "language-level" setting is "3". This setting specifies
- the PostScript language level which should be used by FOP. Set this to "2"
- only if you don't have a Level 3 capable interpreter.
-
-
- The default value for the "optimize-resources" setting is "false". Setting it
- to "true" will produce the PostScript file in two steps. A temporary file will be
- written first which will then be processed to add only the fonts which were really
- used and images are added to the stream only once as PostScript forms. This will
- reduce file size but can potentially increase the memory needed in the interpreter
- to process.
-
-
- 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.
-
-
- 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.
-
-
-
- Limitations
-
-
Images and SVG may not be displayed correctly. SVG support is far from being complete. No image transparency is available.
-
Only Type 1 fonts are supported.
-
Multibyte characters are not supported.
-
PPD support is still missing.
-
-
-
-
- PCL
-
- This format is for the Hewlett-Packard PCL printers and other printers
- supporting PCL. It should produce output as close to identical as possible
- to the printed output of the PDFRenderer within the limitations of the
- renderer, and output device.
-
-
- The output created by the PCLRenderer is generic PCL 5, HP GL/2 and PJL.
- This should allow any device fully supporting PCL 5 to be able to
- print the output generated by the PCLRenderer. PJL is used to control the
- print job and switch to the PCL language. PCL 5 is used for text, raster
- graphics and rectangular fill graphics. HP GL/2 is used for more complex
- painting operations. Certain painting operations are done off-screen and
- rendered to PCL as bitmaps because of limitations in PCL 5.
-
- Text or graphics outside the left or top of the printable area are not
- rendered properly. This is a limitation of PCL, not FOP. In general,
- things that should print to the left of the printable area are shifted
- to the right so that they start at the left edge of the printable area.
-
-
- The Helvetica and Times fonts are not well supported among PCL printers
- so Helvetica is mapped to Arial and Times is mapped to Times New. This
- is done in the PCLRenderer, no changes are required in the FO's. The
- metrics and appearance for Helvetica/Arial and Times/Times New are
- nearly identical, so this has not been a problem so far.
-
-
For the non-symbol fonts, the ISO 8859-1 symbol set is used (PCL set "0N").
-
- All fonts available to the Java2D subsystem are usable. The texts are
- painted as bitmap much like the Windows PCL drivers do.
-
-
Multibyte characters are not supported.
-
- At the moment, only monochrome output is supported. PCL5c color extensions
- will only be implemented on demand. Color and grayscale images are converted
- to monochrome bitmaps (1-bit). Dithering only occurs if the JAI image library
- is available.
-
-
- Images are scaled up to the next resolution level supported by PCL (75,
- 100, 150, 200, 300, 600 dpi). For color and grayscale images an even
- higher PCL resolution is selected to give the dithering algorithm a chance
- to improve the bitmap quality.
-
-
- Currently, there's no support for clipping and image transparency, largely
- because PCL 5 has certain limitations.
-
-
-
-
- Configuration
-
- The PCL renderer configuration currently allows the following settings:
-
-
-
- The default value for the "rendering" setting is "speed" which causes borders
- to be painted as plain rectangles. In this mode, no special borders (dotted,
- dashed etc.) are available. If you want support for all border modes, set the
- value to "quality" as indicated above. This will cause the borders to be painted
- as bitmaps.
-
-
- The default value for the "text-rendering" setting is "auto" which paints the
- base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D.
- If the mix of painting methods results in unwelcome output, you can set this
- to "bitmap" which causes all text to be rendered as bitmaps.
-
-
- 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".
-
-
- 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
- supported PCL resolution. Currently, only 300 and 600 dpi are supported which
- should be enough for most use cases. Note that this setting directly affects
- the size of the output file and the print quality.
-
-
-
- Extensions
-
The PCL Renderer supports some PCL specific extensions which can be embedded
- into the input FO document. To use the extensions the appropriate namespace must
- be declared in the fo:root element like this:
-
-
- Page Source (Tray selection)
-
- The page-source extension attribute on fo:simple-page-master allows to
- select the paper tray the sheet for a particular simple-page-master is
- to be taken from. Example:
-
-
-
- Note: the tray number is a positive integer and the value depends on
- the target printer. Not all PCL printers support the same paper trays.
- Usually,
- "1" is the default tray,
- "2" is the manual paper feed,
- "3" is the manual envelope feed,
- "4" is the "lower" tray and
- "7" is "auto-select".
- Consult the technical reference for your printer for all available values.
-
-
-
-
-
- AFP
- The AFP Renderer is a new addition (27-Apr-2006) to the sandbox and as such not yet fully tested or feature complete.
-
- 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).
-
- Clipping of text and graphics is not supported.
-
-
- Only IBM outline and raster fonts and to a limited extend the original fonts built into FOP are supported.
- Support for TrueType fonts may be added later.
-
-
-
-
- Configuration
-
- Fonts
-
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
- looks like:
-
-
There are 3 font configuration variants supported:
-
-
IBM Raster fonts
-
IBM Outline fonts
-
FOP built-in Base14 fonts
-
-
A typical raster font configuration looks like:
-
-
An outline font configuration is simpler as the individual font size entries are not required.
- However, the characterset definition is now required within the afp-font element.
-
-
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
- giving the name of the matching Base14 font. In this case the AFP Renderer will take the
- font metrics from the built-in font.
-
-
-
- Output Resolution
-
By default the AFP Renderer creates output with a resolution of 240 dpi.
- This can be overridden by the <renderer-resolution/> configuration element. Example:
-
-
-
- Images
-
By default the AFP Renderer converts all images to 8 bit grey level.
- This can be overridden by the <images> configuration element. Example:
-
-
This will put images as RGB images into the AFP output stream. The default setting is:
-
-
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.
-
-
-
- Extensions
-
The AFP Renderer supports some AFP specific extensions which can be embedded into the input
- fo document. To use the extensions the appropriate namespace must be declared in the fo:root element like this:
-
-
- Page Overlay Extension
-
The include-page-overlay extension element allows to define on a per simple-page-master basis a page overlay resource. Example:
-
-
The mandatory name attribute must refer to an 8 character (space padded) resource name that
- must be known in the AFP processing environment.
-
-
- Page Segment Extension
-
The include-page-segment extension element allows to define resource substitution for fo:external-graphics elements.
- Example:
-
-
The include-page-segment extension element can only occur within a simple-page-master.
- Multiple include-page-segment extension elements within a simple-page-master are allowed.
- The mandatory name attribute must refer to an 8 character
- (space padded) resource name that must be known in the AFP processing environment.
- The value of the mandatory src attribute is compared against the value of the src attribute in
- 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.
-
-
-
- Tag Logical Element Extension
-
The tag-logical-element extension element allows to injects TLEs into the AFP output stream. Example:
-
-
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.
-
-
-
- No Operation Extension
-
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:
-
-
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.
-
-
-
-
-
- RTF
-
- JFOR, an open source XSL-FO to RTF converter has been integrated into Apache FOP.
- This will create an RTF (rich text format) document that will
- attempt to contain as much information from the 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.
-
-
- The RTF output follows Microsoft's RTF specifications
- and produces best results on Microsoft Word.
-
- 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.
-
- These are some known restrictions compared to other supported output formats (not a complete list):
-
-
-
- Not supported/implemented:
-
-
break-before/after (supported by the RTF library but not tied into the RTFHandler)
-
fo:page-number-citation-last
-
keeps (supported by the RTF library but not tied into the RTFHandler)
-
region-start/end (RTF limitation)
-
multiple columns
-
-
-
Only a single page-master is supported
-
Not all variations of fo:leader are supported (RTF limitation)
-
percentages are not supported everywhere
-
-
-
- XML (Area Tree XML)
-
- This is primarily for testing and verification. The XML created is simply
- a representation of the internal area tree put into XML. We use that to verify
- the functionality of FOP's layout engine.
-
-
- The other use case of the Area Tree XML is as FOP's "intermediate format". More information
- on that can be found on the page dedicated to the Intermediate Format.
-
-
-
- Java2D/AWT
-
- The Java2DRenderer provides the basic functionality for all
- Java2D-based output formats (AWT viewer, direct print, PNG, TIFF).
-
-
- The AWT viewer shows a window with the pages displayed inside a
- Java graphic. It displays one page at a time.
- The fonts used for the formatting and viewing depend on the fonts
- available to your JRE.
-
-
-
- Print
-
- It is possible to directly print the document from the command line.
- This is done with the same code that renders to the Java2D/AWT renderer.
-
-
- Known issues
-
- 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.
-
-
-
-
- Bitmap (TIFF/PNG)
-
- It is possible to directly create bitmap images from the individual
- pages generated by the layout engine.
- This is done with the same code that renders to the Java2D/AWT renderer.
-
-
- Currently, two output formats are supported: PNG and TIFF. TIFF produces
- one file with multiple pages, while PNG output produces one file per
- page. The quality of the bitmap depends on the target resolution setting
- on the FOUserAgent.
-
-
- Configuration
-
- The TIFF and PNG renderer configuration currently allows the following settings:
-
-
-
- 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,
- no such background will be painted and you will get a transparent image if
- an alpha channel is available in the output format.
-
-
-
- TIFF-specific Configuration
-
- In addition to the above values the TIFF renderer configuration allows some additional
- settings:
-
-
-
- The default value for the "compression" setting is "PackBits" which
- which is a widely supported RLE compression scheme for TIFF. The set of compression
- names to be used here matches the set that the Image I/O API uses. Note that
- not all compression schemes may be available during runtime. This depends on the
- actual codecs being available. Here is a list of possible values:
-
-
-
NONE (no compression)
-
PackBits (RLE, run-length encoding)
-
JPEG
-
Deflate
-
LZW
-
ZLib
-
CCITT T.4 (Fax Group 3)
-
CCITT T.6 (Fax Group 4)
-
-
- If you want to use CCITT compression, please make sure you've got a J2SE 1.4 or later and
-
- Java Advanced Imaging Image I/O Tools
-
- in your classpath. The Sun JRE doesn't come with a TIFF codec built in, so it has to be
- added separately. The internal TIFF codec from XML Graphics Commons only supports PackBits,
- Deflate and JPEG compression for writing.
-
-
-
-
- TXT
-
- The text renderer produces plain ASCII text output
- that attempts to match the output of the PDFRenderer as closely as
- possible. This was originally developed to accommodate an archive system
- that could only accept plain text files, and is primarily useful for getting
- a quick-and-dirty view of the document text. The renderer is very limited,
- so do not be surprised if it gives unsatisfactory results.
-
-
- The Text renderer works with a fixed size page buffer. The size of this
- buffer is controlled with the textCPI and textLPI public variables.
- The textCPI is the effective horizontal characters per inch to use.
- The textLPI is the vertical lines per inch to use. From these values
- and the page width and height the size of the buffer is calculated.
- The formatting objects to be rendered are then mapped to this grid.
- Graphic elements (lines, borders, etc) are assigned a lower priority
- than text, so text will overwrite any graphic element representations.
-
-
- Because FOP lays the text onto a grid during layout, there are frequently
- extra or missing spaces between characters and lines, which is generally
- unsatisfactory.
- Users have reported that the optimal settings to avoid such spacing problems are:
-
-
-
font-family="Courier"
-
font-size="7.3pt"
-
line-height="10.5pt"
-
-
-
- Output Formats in the Sandbox
-
- Due to the state of certain renderers we moved some of them to a "sandbox" area until
- they are ready for more serious use. The renderers and FOEventHandlers in the sandbox
- can be found under src/sandbox and are compiled into build/fop-sandbox.jar during the
- main build. The output formats in the sandbox are marked as such below.
-
-
- MIF
- The MIF handler is in the sandbox and not yet functional in FOP Trunk!!! Please help us ressurrect this feature.
-
- This format is the Maker Interchange Format which is used by
- Adobe Framemaker.
-
-
-
- SVG
- The SVG renderer is in the sandbox and may not work as expected in FOP Trunk!!! Please help us improve this feature.
-
- This format creates an SVG document that has links between the pages.
- This is primarily for slides and creating svg images of pages.
- Large documents will create SVG files that are far too large for
- an SVG viewer to handle. Since FO documents usually have text the
- SVG document will have a large number of text elements.
- The font information for the text is obtained from the JVM in the
- same way as for the AWT viewer. If the SVG is viewed on a
- system where the fonts are different, such as another platform,
- then the page may look wrong.
-
-
-
-
- Wish list
-
- Apache FOP is easily extensible and allows you to add new output formats to enhance FOP's functionality. There's a number of output formats
- which are on our wish list. We're looking for volunteers to help us implement them.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/pdfa.xml b/src/documentation/content/xdocs/0.95/pdfa.xml
deleted file mode 100644
index e1d3f3010..000000000
--- a/src/documentation/content/xdocs/0.95/pdfa.xml
+++ /dev/null
@@ -1,156 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: PDF/A (ISO 19005)
- $Revision$
-
-
-
-
-
-
- Overview
-
- PDF/A is a standard which turns PDF into an "electronic document file
- format for long-term preservation". PDF/A-1 is the first part of the
- standard and is documented in
- ISO 19005-1:2005(E).
- Work on PDF/A-2 is in progress at
- AIIM.
-
-
- Design documentation on PDF/A can be found on FOP's Wiki on the
- PDFA1ConformanceNotes page.
-
-
-
- Implementation Status
-
- PDF/A-1b is implemented to the degree that FOP supports
- the creation of the elements described in ISO 19005-1.
-
-
- Tests have been performed against jHove and Adobe Acrobat 7.0.7 (Preflight function).
- FOP does not validate completely against Apago's PDF Appraiser. Reasons unknown due to
- lack of a full license to get a detailed error protocol.
-
-
- PDF/A-1a is not implemented, yet. This is mostly because of the requirement
- for tagged PDF which is not available in FOP, yet.
-
-
-
- Usage (command line)
-
- To activate PDF/A-1b from the command-line, specify "-pdfprofile PDF/A-1b"
- 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.
-
-
-
- Usage (embedded)
-
- When FOP is embedded in another Java application you can set a special option
- on the renderer options in the user agent to activate the PDF/A-1b profile.
- Here's an example:
-
-
-
- If one of the validation rules of PDF/A is violated, an PDFConformanceException
- (descendant of RuntimeException) is thrown.
-
-
-
- PDF/A in Action
-
- There are a number of things that must be looked after if you activate a PDF/A
- profile. If you receive a PDFConformanceException, have a look at the following
- list (not necessarily comprehensive):
-
-
-
- Make sure all (!) fonts are embedded. If you use base 14 fonts (like Helvetica)
- you need to obtain a license for them and embed them like any other font.
-
-
- Don't use PDF encryption. PDF/A doesn't allow it.
-
-
- Don't use CMYK images without an ICC color profile. PDF/A doesn't allow mixing
- color spaces and FOP currently only properly supports the sRGB color space. Please
- note that FOP embeds a standard sRGB ICC profile (sRGB IEC61966-2.1) as the
- primary output intent for the PDF if no other output intent has been specified
- in the configuration.
-
-
- Don't use non-RGB colors in SVG images. Same issue as with CMYK images.
-
-
- Don't use EPS graphics with fo:external-graphic. Embedding EPS graphics in PDF
- is deprecated since PDF 1.4 and prohibited by PDF/A.
-
-
- PDF is forced to version 1.4 if PDF/A-1 is activated.
-
-
- No filter must be specified explicitely for metadata objects. Metadata must be
- embedded in clear text so non-PDF-aware applications can extract the XMP metadata.
-
-
-
-
- PDF profile compatibility
-
- The PDF profiles "PDF/X-3:2003" and "PDF/A-1b" are compatible and can both be
- activated at the same time.
-
-
-
- Interoperability
-
- There has been some confusion about the namespace for the PDF/A indicator in the XMP
- metadata. At least three variants have been seen in the wild:
-
-
-
-
http://www.aiim.org/pdfa/ns/id.html
-
obsolete, from an early draft of ISO-19005-1, used by Adobe Acrobat 7.x
-
-
-
http://www.aiim.org/pdfa/ns/id
-
obsolete, found in the original ISO 19005-1:2005 document
-
-
-
http://www.aiim.org/pdfa/ns/id/
-
correct, found in the technical corrigendum 1 of ISO 19005-1:2005
-
-
-
- If you get an error validating a PDF/A file in Adobe Acrobat 7.x it doesn't mean that
- FOP did something wrong. It's Acrobat that is at fault. This is fixed in Adobe Acrobat 8.x
- which uses the correct namespace as described in the technical corrigendum 1.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/pdfencryption.xml b/src/documentation/content/xdocs/0.95/pdfencryption.xml
deleted file mode 100644
index e743f5fff..000000000
--- a/src/documentation/content/xdocs/0.95/pdfencryption.xml
+++ /dev/null
@@ -1,225 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: PDF encryption.
- $Revision$
-
-
-
-
-
-
-
- Overview
-
- Apache⢠FOP supports encryption of PDF output, thanks to Patrick
- C. Lankswert. This feature is commonly used to prevent
- unauthorized viewing, printing, editing, copying text from the
- document and doing annotations. It is also possible to ask the
- user for a password in order to view the contents. Note that
- there already exist third party applications which can decrypt
- an encrypted PDF without effort and allow the aforementioned
- operations, therefore the degree of protection is limited.
-
-
- For further information about features and restrictions regarding PDF
- encryption, look at the documentation coming with Adobe Acrobat or the
- technical documentation on the Adobe web site.
-
-
-
- Usage (command line)
-
- Encryption is enabled by supplying any of the encryption related
- options.
-
-
- An owner password is set with the -o option. This
- password is actually used as encryption key. Many tools for
- PDF processing ask for this password to disregard any
- restriction imposed on the PDF document.
-
-
- If no owner password has been supplied but FOP was asked to apply some
- restrictions, a random password is used. In this case it is obviously
- impossiible to disregard restrictions in PDF processing tools.
-
-
- A user password, supplied with the -u option, will
- cause the PDF display software to ask the reader for this password in
- order to view the contents of the document. If no user password was
- supplied, viewing the content is not restricted.
-
-
- Further restrictions can be imposed by using the -noprint,
- -nocopy, -noedit and
- -noannotations options, which disable printing, copying
- text, editing in Adobe Acrobat and making annotations, respectively.
-
-
-
- Usage (embedded)
-
- When FOP is embedded in another Java application you need to set an
- options map on the renderer. These are the supported options:
-
-
-
-
Option
-
Description
-
Values
-
Default
-
-
-
ownerPassword
-
The owner password
-
String
-
-
-
-
userPassword
-
The user password
-
String
-
-
-
-
allowPrint
-
Allows/disallows printing of the PDF
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
allowCopyContent
-
Allows/disallows copy/paste of content
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
allowEditContent
-
Allows/disallows editing of content
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
allowEditAnnotations
-
Allows/disallows editing of annotations
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
- Encryption is enabled as soon as one of these options is set.
-
-
- An example to enable PDF encryption in Java code:
-
-
-
- The parameters for the constructor of PDFEncryptionParams are:
-
-
-
userPassword: String, may be null
-
ownerPassword: String, may be null
-
allowPrint: true if printing is allowed
-
allowCopyContent: true if copying content is allowed
-
allowEditContent: true if editing content is allowed
-
allowEditAnnotations: true if editing annotations is allowed
-
-
- Alternatively, you can set each value separately in the Map provided by
- FOUserAgent.getRendererOptions() by using the following keys:
-
-
-
user-password: String
-
owner-password: String
-
noprint: Boolean or "true"/"false"
-
nocopy: Boolean or "true"/"false"
-
noedit: Boolean or "true"/"false"
-
noannotations: Boolean or "true"/"false"
-
-
-
- Environment
-
- In order to use PDF encryption, FOP has to be compiled with
- cryptography support. Currently, only JCE
- is supported. JCE is part of JDK 1.4. For earlier JDKs, it can
- be installed separately. The build process automatically
- detects JCE presence and installs PDF encryption support if
- possible, otherwise a stub is compiled in.
-
-
- Cryptography support must also be present at run time. In particular, a
- provider for the RC4 cipher is needed. Unfortunately, the sample JCE
- provider in Sun's JDK 1.4 does not provide RC4. If you
- get a message saying
-
-
-
- then you don't have the needed infrastructure.
-
-
- There are several commercial and a few Open Source packages which
- provide RC4. A pure Java implementation is produced by The Legion of the Bouncy
- Castle. Mozilla
- JSS is an interface to a native implementation.
-
-
-
- Installing a crypto provider
-
- The pure Java implementation from Bouncy Castle is easy to
- install.
-
-
-
- Unpack the distribution. Add the jar file to your classpath. A
- convenient way to use the jar on Linux is to simply drop it into the
- FOP lib directory, it will be automatically picked up by
- fop.sh.
-
-
- Open the java.security file and add
- security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider,
- preferably at the end of the block defining the other crypto
- providers. For JDK 1.4 this is detailed on Sun's web site.
-
-
-
- If you have any experience with Mozilla JSS or any other
- cryptography provider, please post it to the fop-user list.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/pdfx.xml b/src/documentation/content/xdocs/0.95/pdfx.xml
deleted file mode 100644
index bef2fce2a..000000000
--- a/src/documentation/content/xdocs/0.95/pdfx.xml
+++ /dev/null
@@ -1,136 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: PDF/X (ISO 15930)
- $Revision$
-
-
-
-
-
-
- Overview
-
- 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.
-
-
- PDF/X is a standard which faciliates prepress digital data exchange using PDF.
- Currently, only PDF/X-3:2003 is implemented out of the many different flavours of PDF/X
- profiles. PDF/X-3:2003 is documented in
- ISO 15930-6:2003(E).
- More info on PDF/X can be found on the
- PDF/X info site.
-
-
-
- Implementation Status
-
- PDF/X-3:2003 is implemented to the degree that FOP supports
- the creation of the elements described in ISO 15930-6.
-
-
- An important restriction of the current implementation is that all normal
- RGB colors specified in XSL-FO and SVG are left unchanged in the sRGB color
- space (XSL-FO and SVG both use sRGB as their default color space).
- There's no conversion to a CMYK color space. Although sRGB is a
- calibrated color space, its color space has a different size than a CMYK
- color space which makes the conversion a lossy conversion and can lead to
- unwanted results. Although the use of the calibrated sRGB has been promoted
- for years, print shops usually prefer to convert an sRGB PDF to CMYK prior
- to production. Until there's full CMYK support in FOP you will have to
- work closely with your print service provider to make sure you get the
- intended result.
-
-
- Tests have been performed against Adobe Acrobat 7.0.7 (Preflight function).
- Note that there are bugs in Adobe Acrobat which cause false alarms if both
- PDF/A-1b and PDF/X-3:2003 are activated at the same time.
-
-
-
- Usage (command line)
-
- To activate PDF/X-3:2003 from the command-line, specify "-pdfprofile PDF/X-3:2003"
- as a parameter. If there is a violation of one of the validation rules for
- PDF/X, an error message is presented and the processing stops.
-
-
-
- Usage (embedded)
-
- When FOP is embedded in another Java application you can set a special option
- on the renderer options in the user agent to activate the PDF/A-1b profile.
- Here's an example:
-
-
-
- If one of the validation rules of PDF/X is violated, an PDFConformanceException
- (descendant of RuntimeException) is thrown.
-
-
-
- PDF/X in Action
-
- There are a number of things that must be looked after if you activate a PDF/X
- profile. If you receive a PDFConformanceException, have a look at the following
- list (not necessarily comprehensive):
-
-
-
- Make sure all (!) fonts are embedded. If you use base 14 fonts (like Helvetica)
- you need to obtain a license for them and embed them like any other font.
-
-
- Don't use PDF encryption. PDF/X doesn't allow it.
-
-
- Don't use CMYK images without an ICC color profile. PDF/X doesn't allow mixing
- color spaces and FOP currently only properly supports the sRGB color space. However,
- you will need to specify an
- output device profile
- (usually a CMYK profile) in the configuration. sRGB won't work here since it's a
- display device profile, not an output device profile.
-
-
- Don't use non-RGB colors in SVG images. Same issue as with CMYK images.
-
-
- Don't use EPS graphics with fo:external-graphic. Embedding EPS graphics in PDF
- is deprecated since PDF 1.4 and prohibited by PDF/X-3:2003.
-
-
- PDF is forced to version 1.4 if PDF/X-3:2003 is activated.
-
-
-
-
- PDF profile compatibility
-
- The PDF profiles "PDF/X-3:2003" and "PDF/A-1b" are compatible and can both be
- activated at the same time.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/running.xml b/src/documentation/content/xdocs/0.95/running.xml
deleted file mode 100644
index 26a9596c0..000000000
--- a/src/documentation/content/xdocs/0.95/running.xml
+++ /dev/null
@@ -1,350 +0,0 @@
-
-
-
-
-
-
- Running Apache⢠FOP
- $Revision$
-
-
-
-
- System Requirements
-
The following software must be installed:
-
-
- Java 1.4.x or later Runtime Environment.
-
-
- 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.
-
-
-
-
- Apache⢠FOP. The FOP distribution 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:
-
The following software is optional, depending on your needs:
-
-
- Graphics libraries. Generally, FOP contains direct support for the most important
- bitmap image formats (including PNG, JPEG and GIF). See
- FOP: Graphics Formats for details.
-
In addition, the following system requirements apply:
-
-
- If you will be using FOP to process SVG, you must do so in a graphical environment.
- See FOP: Graphics (Batik) for details.
-
-
-
-
- Installation
-
- Instructions
-
- Basic FOP installation consists of first unzipping the .gz file that is the
- distribution medium, then unarchiving the resulting .tar file in a
- directory/folder that is convenient on your system. Please consult your operating system
- documentation or Zip application software documentation for instructions specific to your
- site.
-
-
-
- Problems
-
- Some Mac OSX users have experienced filename truncation problems using Stuffit to unzip
- and unarchive their distribution media. This is a legacy of older Mac operating systems,
- which had a 31-character pathname limit. Several Mac OSX users have recommended that
- Mac OSX users use the shell command tar -xzf instead.
-
-
-
-
- Starting FOP as a Standalone Application
-
- Using the fop script or batch file
-
- 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
- the path to use in this case is /Library/Java/Home. Caveat:
- We suspect that, as Apple releases new Java environments and as FOP upgrades the minimum
- Java requirements, the two will inevitably not match on some systems. Please see
- Java on Mac OSX FAQ for information as
- it becomes available.
-
-
-
- PDF encryption is only available if FOP was compiled with encryption support
- and if compatible encryption support is available at run time.
- Currently, only the JCE is supported. Check the Details.
-
-
-
- Writing your own script
-
FOP's entry point for your own scripts is the class
-org.apache.fop.cli.Main. The general pattern for the
- command line is: java -classpath <CLASSPATH>
- org.apache.fop.cli.Main <arguments>. 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.
-
-
-
- Running with java's -jar option
-
- As an alternative to the start scripts you can run java
- -jar path/to/build/fop.jar <arguments>, relying on
- FOP to build the classpath for running FOP dynamically, see below. If you use hyphenation,
- you must put fop-hyph.jar in the lib
- directory.
-
-
-
You can also run java -jar path/to/fop.jar
- <arguments>, relying on the Class-Path
- entry in the manifest file. This works if you put
- fop.jar and all jar files from the lib
- directory in a single directory. If you use hyphenation, you
- must also put fop-hyph.jar in that directory.
-
-
In both cases the arguments consist of the options and
- infile and outfile specifications as shown above for the
- standard scripts.
-
-
- FOP's dynamical classpath construction
-
-
If FOP is started without a proper classpath, it tries to
- add its dependencies dynamically. If the system property
- fop.home 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 build,
- then its parent directory becomes the base directory.
-
-
FOP expects to find fop.jar in the
- build subdirectory of the base directory, and
- adds it to the classpath. Subsequently FOP adds all
- jar files in the lib directory to the
- classpath. The lib directory is either the lib
- subdirectory of the base directory, or, if that does not
- exist, the base directory itself.
-
-
If the system property fop.optional.lib
- contains the name of a directory, then all jar
- files in that directory are also added to the classpath. See
- the methods getJARList and
- checkDependencies in
- org.apache.fop.cli.Main.
-
-
-
-
- Using Xalan to Check XSL-FO Input
-
- FOP sessions that use -xml and -xsl input instead of -fo input are actually
- controlling two distinct conversions: Tranforming XML to XSL-FO, then formatting
- the XSL-FO to PDF (or another FOP output format).
- Although FOP controls both of these processes, the first is included merely as
- a convenience and for performance reasons.
- Only the second is part of FOP's core processing.
- If a user has a problem running FOP, it is important to determine which of these
- two processes is causing the problem.
- If the problem is in the first process, the user's stylesheet is likely the cause.
- The FOP development team does not have resources to help with stylesheet issues,
- although we have included links to some useful
- Specifications and
- Books/Articles.
- If the problem is in the second process, FOP may have a bug or an unimplemented
- feature that does require attention from the FOP development team.
-
- The user is always responsible to provide correct XSL-FO code to FOP.
-
- In the case of using -xml and -xsl input, although the user is responsible for
- the XSL-FO code that is FOP's input, it is not visible to the user. To make the
- intermediate FO file visible, the FOP distribution includes the "-foout" option
- which causes FOP to run only the first (transformation) step, and write the
- results to a file. (See also the Xalan command-line below)
-
-
- When asking for help on the FOP mailing lists, never attach XML and
- XSL to illustrate the issue. Always run the XSLT step (-foout) and send the
- resulting XSL-FO file instead. Of course, be sure that the XSL-FO file is
- correct before sending it.
-
-
- The -foout option works the same way as if you would call the
- Xalan command-line:
-
- Note that there are some subtle differences between the FOP and Xalan command-lines.
-
-
-
- Memory Usage
-
- FOP can consume quite a bit of memory, even though this has been continually improved.
- This is partly inherent to the formatting process and partly caused by implementation choices.
- All FO processors currently on the market have memory problems with certain layouts.
-
-
- If you are running out of memory when using FOP, here are some ideas that may help:
-
-
-
- Increase memory available to the JVM. See
- the -Xmx option
- for more information.
-
- It is usually unwise to increase the memory allocated to the JVM beyond the amount of
- physical RAM, as this will generally cause significantly slower performance.
-
-
-
- Avoid forward references.
- Forward references are references to some later part of a document.
- Examples include page number citations which refer to pages which follow the citation,
- tables of contents at the beginning of a document, and page numbering schemes that
- include the total number of pages in the document
- ("page N of TOTAL").
- Forward references cause all subsequent pages to be held in memory until the reference
- can be resolved, i.e. until the page with the referenced element is encountered.
- Forward references may be required by the task, but if you are getting a memory
- overflow, at least consider the possibility of eliminating them.
- A table of contents could be replaced by PDF bookmarks instead or moved to the end of
- the document (reshuffle the paper could after printing).
-
-
- Avoid large images, especially if they are scaled down.
- If they need to be scaled, scale them in another application upstream from FOP.
- For many image formats, memory consumption is driven mainly by the size of the image
- file itself, not its dimensions (width*height), so increasing the compression rate
- may help.
-
-
- Use multiple page sequences.
- FOP starts rendering after the end of a page sequence is encountered.
- While the actual rendering is done page-by-page, some additional memory is
- freed after the page sequence has been rendered.
- This can be substantial if the page sequence contains lots of FO elements.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/servlets.xml b/src/documentation/content/xdocs/0.95/servlets.xml
deleted file mode 100644
index 807f19f98..000000000
--- a/src/documentation/content/xdocs/0.95/servlets.xml
+++ /dev/null
@@ -1,325 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Servlets
- How to use Apache� FOP in a Servlet
- $Revision$
-
-
-
- Overview
-
- This page discusses topic all around using Apache⢠FOP in a servlet environment.
-
-
-
- Example Servlets in the FOP distribution
-
- In the directory {fop-dir}/src/java/org/apache/fop/servlet, you'll find a working example
- of a FOP-enabled servlet.
-
-
- The servlet is automatically built when you build Apache FOP using the supplied Ant script. After building
- the servlet, drop fop.war into the webapps directory of Apache Tomcat (or any other web container). Then, you can use
- URLs like the following to generate PDF files:
-
The source code for the servlet can be found under {fop-dir}/src/java/org/apache/fop/servlet/FopServlet.java.
-
- This example servlet should not be used on a public web server connected to the Internet as it does not contain
- any measures to prevent Denial-of-Service-Attacks. It is provided as an example and as a starting point for
- your own servlet.
-
-
-
- Create your own Servlet
-
- This section assumes you are familiar with embedding FOP.
-
-
- A minimal Servlet
-
- Here is a minimal code snippet to demonstrate the basics:
-
-
-
- There are numerous problems with the code snippet above.
- Its purpose is only to demonstrate the basic concepts.
- See below for details.
-
-
-
- Adding XSL tranformation (XSLT)
-
- A common requirement is to transform an XML source to
- XSL-FO using an XSL transformation. It is recommended to use
- JAXP for this task. The following snippet shows the basic
- code:
-
-
-
- Buffering the generated PDF in a ByteArrayOutputStream is done to avoid potential
- problems with the Acrobat Reader Plug-in in Microsoft Internet Explorer.
-
-
- The Source instance used above is simply an
- example. If you have to read the XML from a string, supply
- a new StreamSource(new
- StringReader(xmlstring)). Constructing and reparsing
- an XML string is generally less desirable than using a
- SAXSource if you generate your XML. You can alternatively
- supply a DOMSource as well. You may also use dynamically
- generated XSL if you like.
-
-
- Because you have an explicit Transformer object, you can also use it to
- explicitely set parameters for the transformation run.
-
-
-
- Custom configuration
-
- You can easily set up your own FOUserAgent as demonstrated on the Embedding page.
-
-
-
- Improving performance
-
- There are several options to consider:
-
-
-
- Instead of java.io.ByteArrayOutputStream consider using the ByteArrayOutputStream
- implementation from the Jakarta Commons IO project which allocates less memory.
- The full class name is: org.apache.commons.io.output.ByteArrayOutputStream
-
-
- In certain cases it can help to write the generated PDF to a temporary file so
- you can quickly reuse the file. This is especially useful, if Internet Explorer
- calls the servlet multiple times with the same request or if you often generate
- equal PDFs.
-
-
-
- Accessing resources in your web application
-
- Often, you will want to use resources (stylesheets, images etc.) which are bundled with
- your web application. FOP provides a URIResolver implementation that lets you access
- files via the Servlet's ServletContext. The class is called
- org.apache.fop.servlet.ServletContextURIResolver.
-
-
- Here's how to set it up in your servlet. Instantiate a new instance in the servlet's
- init() method:
-
-
-
- The ServletContextURIResolver reacts on URIs beginning with "servlet-context:". If you
- want to access an image in a subdirectory of your web application, you could, for
- example, use: "servlet-context:/images/myimage.png". Don't forget the leading slash
- after the colon!
-
-
- Further down, you can use the URIResolver for various things:
-
-
-
- With the Transformer (JAXP/XSLT) so things like document() functions can resolver
- "servlet-context:" URIs.
-
-
- With the FopFactory so every resource FOP loads can be loaded using a "servlet-context:"
- URI.
-
-
- You can the ServletContextURIResolver yourself in your servlet code to access
- stylesheets or XML files bundled with your web application.
-
-
-
- Here are some example snippets:
-
-
-
-
-
- Notes on Microsoft Internet Explorer
-
- Some versions of Internet Explorer will not automatically show the PDF or call the servlet multiple times.
- These are well-known limitations of Internet Explorer and are not a problem of the servlet.
- However, Internet Explorer can still be used to download the PDF so that it can be viewed later.
- Here are some suggestions in this context:
-
-
-
- Use an URL ending in .pdf, like
- http://myserver/servlet/stuff.pdf. Yes, the servlet can
- be configured to handle this. If the URL has to contain parameters,
- try to have both the base URL as well as the last parameter end in
- .pdf, if necessary append a dummy parameter, like
- http://myserver/servlet/stuff.pdf?par1=a&par2=b&d=.pdf. The
- effect may depend on IEx version.
-
-
- Give IEx the opportunity to cache. In particular, ensure the
- server does not set any headers causing IEx not to cache the
- content. This may be a real problem if the document is sent
- over HTTPS, because most IEx installations will by default
- not cache any content retrieved over HTTPS.
- Setting the Expires header entry may help in
- this case: response.setDateHeader("Expires",
- System.currentTimeMillis() + cacheExpiringDuration *
- 1000); Consult your server manual and the
- relevant RFCs for further details on HTTP headers and
- caching.
-
-
- Cache in the server. It may help to include a parameter in
- the URL which has a timestamp as the value min order to
- decide whether a request is repeated. IEx is reported to
- retrieve a document up to three times, but never more often.
-
-
-
-
- Servlet Engines
-
- When using a servlet engine, there are potential CLASSPATH issues, and potential conflicts
- with existing XML/XSLT libraries. Servlet containers also often use their own classloaders
- for loading webapps, which can cause bugs and security problems.
-
-
- Tomcat
-
- Check Tomcat's documentation for detailed instructions about installing FOP and Cocoon.
- There are known bugs that must be addressed, particularly for Tomcat 4.0.3.
-
-
-
- WebSphere 3.5
-
- Put a copy of a working parser in some directory where WebSphere can access it.
- For example, if /usr/webapps/yourapp/servlets is the CLASSPATH for your servlets,
- copy the Xerces jar into it (any other directory would also be fine).
- Do not add the jar to the servlet CLASSPATH, but add it to the CLASSPATH of the
- application server which contains your web application.
- In the WebSphere administration console, click on the "environment" button in the
- "general" tab. In the "variable name" box, enter "CLASSPATH".
- In the "value" box, enter the correct path to the parser jar file
- (/usr/webapps/yourapp/servlets/Xerces.jar in our example here).
- Press "OK", then apply the change and restart the application server.
-
-
-
-
- Handling complex use cases
-
- Sometimes the requirements for a servlet get quite sophisticated: SQL data sources,
- multiple XSL transformations, merging of several datasources etc. In such a case
- consider using Apache Cocoon instead
- of a custom servlet to accomplish your goal.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/0.95/upgrading.xml b/src/documentation/content/xdocs/0.95/upgrading.xml
deleted file mode 100644
index 3ed062e9c..000000000
--- a/src/documentation/content/xdocs/0.95/upgrading.xml
+++ /dev/null
@@ -1,126 +0,0 @@
-
-
-
-
-
-
- Upgrading from an Earlier Version of Apache⢠FOP
- $Revision$
-
-
-
- Important!
-
- If you're planning to upgrade to the latest Apache⢠FOP version there are a few very important things
- to consider:
-
-
-
- More than half of the codebase has been rewritten over the
- last four years. With version 0.93 the code has reached
- production level, and continues to improve with
- version 0.94 and 0.95.
-
-
- The API of FOP has changed considerably and is not
- backwards-compatible with versions 0.20.5 and
- 0.91beta. Version 0.92 introduced the new stable
- API.
-
-
- Since version 0.92 some deprecated methods which were part
- of the old API have been removed. If you upgrade from 0.91
- beta, you will need to adjust your Java code. Similarly if
- you upgrade from 0.92 and use deprecated methods.
-
-
- 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 conf/fop.xconf for
- an example configuration file. A XML Schema file can be found under
- src/foschema/fop-configuration.xsd.
-
-
- Beginning with version 0.94 you can skip the generation of
- font metric files and remove the "font-metrics" attribute
- in the font configuration. The font metrics files are, for
- the moment, still required if you use a TrueType Collection (*.ttc)
- and in that case you need to regenerate the font metrics file
- if yours are from a FOP version before 0.93.
-
-
-
- The new code is much more strict about the interpretation of the XSL-FO 1.1 specification.
- Things that worked fine in version 0.20.5 might start to produce warnings or even errors
- now. FOP 0.20.5 contains many bugs which have been corrected in the new code.
-
-
- While FOP 0.20.5 allowed you to have empty fo:table-cell elements, the new code
- will complain about that (unless relaxed validation is enabled) because the specification
- demands at least one block-level element ((%block;)+, see
- XSL-FO 1.1, 6.7.10)
- inside an fo:table-cell element.
-
-
-
- Extensions and Renderers written for version 0.20.5 will not work with the new code! The new FOP
- extension for Barcode4J is available since
- January 2007.
-
-
- The SVG Renderer and the MIF Handler have not been resurrected, yet! They are currently non-functional
- and hope for someone to step up and reimplement them.
-
-
-
-
- What you need to know when you upgrade!
-
- When you use your existing FO files or XML/XSL files which work fine with FOP version
- 0.20.5 against this FOP version some things may not work as expected. The following
- list will hopefully help you to identify and correct those problems. This does not mean
- that the new FOP is at fault. Quite the opposite actually! See below:
-
-
-
- Check the Compliance page for the feature causing
- trouble. It may contain the necessary information to understand and resolve the problem.
-
-
- As stated above empty table cells <fo:table-cell></fo:table-cell>
- are not allowed by the specification. The same applies to empty static-content
- and block-container elements, for example.
-
-
- 0.20.5 is not XSL-FO compliant with respect to sizing images (external-graphic)
- or instream-foreign-object
- objects. If images or SVGs are sized differently in your outputs with the new FOP version
- check Bug 37136
- as it contains some hints on what to do. The file
-
- "examples/fo/basic/images.fo" has
- a number of good examples that show the new, more correct behaviour.
-
-
- The fox:outline extension is not implemented in this version anymore.
- It has been superseded by the new bookmark elements from XSL-FO 1.1. So please
- update your stylesheets accordingly.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/accessibility.xml b/src/documentation/content/xdocs/1.0/accessibility.xml
deleted file mode 100644
index 412519d8b..000000000
--- a/src/documentation/content/xdocs/1.0/accessibility.xml
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Accessibility
-
-
-
- Overview
-
- This page describes the
- accessibility
- features of Apache⢠FOP.
- Section 508 defines accessibility in the context
- of electronic documents for the USA but other countries have similar requirements.
-
-
- 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.
-
-
-
- Enabling accessibility
-
There are 3 ways to enable accessibility:
-
-
- Command line: The command line option -a turns on accessibility:
- fop -a -fo mydocument.fo -pdf mydocument.pdf
-
- 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.
-
- The processing of the logical structure is memory-hungry. You may need to adjust the
- Java heap size in order to process larger files.
-
-
- Changes to your XSL-FO input files
-
- 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:
-
-
-
Table cells must have a table row as their parent.
-
- Images must have an alternate text: use the fox:alt-text extension attribute
- (in the fox namespace) on
- fo:external-graphic and fo:instream-foreign-object to specify a
- short text describing the image.
-
-
- Ensure that the order of fo:block-container elements in a page corresponds to
- the reading order.
-
-
- Specify the natural language of the document using the language and country properties
- (or via the xml:lang shorthand property).
-
-
-
-
- Customized Tagging
-
The PDF Reference 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.
-
FOP provides a default mapping of Formatting Objects to elements from that standard set.
- For example, fo:page-sequence is mapped to âPartâ, fo:block is
- mapped to âPâ, fo:list-block to âLâ, etc.
-
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 role XSL-FO property:
-
-
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.
-
-
- Testing
-
- 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.
-
-
-
- Limitations
-
- Accessibility support in Apache FOP is relatively new, so there are certain
- limitations. Please help us identify and close any gaps.
-
-
-
- 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.
-
-
- It's currently not possible to specify the expanded form of an abbreviation or acronym.
-
-
- 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 fox:alt-text.
-
-
- The side regions (region-before, region-after etc.) are currently not specially
- identified. Screen readers may read their content at page changes.
-
-
-
-
- Related Links
-
- 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:
-
Required if a fileset is used to specify the files to render; optional for fofile. (Can alternatively specify the full path in the fofile value.)
-
-
-
force
-
Recreate target files, even if they are newer than their corresponding
- source files. Note: This attribute is available in post-0.20.5
- versions (0.20.x nightly build and 1.0dev) only; target files are
- always generated (i.e., force=true) in 0.20.5 release.
-
-
No, default is false
-
-
-
basedir
-
Base directory to resolve relative references (e.g., graphics files) within the
- FO document.
-
-
No, for single FO File entry, default is to use the location
- of that FO file.
-
-
-
-
relativebase
-
For fileset usage only. A value of true specifies using the location
- of each .fo file as the base directory for resolving relative file references located
- within that .fo file. A value of false specifies using the value of
- basedir for all files within the fileset, or just the current working directory
- if basedir is not specified.
-
-
No, default is false.
-
-
-
-
userconfig
-
User configuration file (same as the FOP "-c" command line option).
-
No
-
-
-
messagelevel
-
Logging level
- Possible values: error, warn, info, verbose, debug. Currently doesn't work in FOP Trunk!!!
-
No, defaults to verbose
-
-
-
logFiles
-
Controls whether the names of the files that are processed are logged
- (true) or not (false). Currently doesn't work in FOP Trunk!!!
-
No, default is true
-
-
-
throwexceptions
-
Controls whether or not an exception is thrown if an error occurs during rendering.
-
Default is true
-
-
-
-
Parameters specified as nested elements
-
-
Attribute
-
Description
-
Required
-
-
-
fileset
-
FileSets
- are used to specify multiple XSL-FO files to be rendered.
-
Yes, if no fofile attribute is supplied
-
-
-
-
- Examples
-
- The following example converts a single XSL-FO file to a PDF document:
-
-
-
-
- This example converts all XSL-FO files within an entire directory to PostScript:
-
-
-
- The following example transforms and converts a single XML and XSLT file to an AFP document:
-
-
-
- This example transforms and converts all XML files within an entire directory to PostScript:
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/compiling.xml b/src/documentation/content/xdocs/1.0/compiling.xml
deleted file mode 100644
index cf7b950ca..000000000
--- a/src/documentation/content/xdocs/1.0/compiling.xml
+++ /dev/null
@@ -1,140 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Building from Source Code
- $Revision$
-
-
-
- Do You Need To Build?
-
- Apache⢠FOP distributions are either pre-compiled binary or source.
- If you are using a binary distribution, it is already built and there is no need to build it again.
- See the Download Instructions for information about whether a
- binary or source distribution is best for your needs.
-
-
- If you got the source code from a repository snapshot or via Subversion you will need to build FOP
- in any case.
-
-
-
- Set Up Your Environment
-
- JDK
-
- Building FOP requires a minimum Java Development Kit (JDK/SDK) of 1.4
- (A Java Runtime Environment is not sufficient).
-
-
-
- CLASSPATH
-
- There is generally no need to setup a classpath. All libraries needed to compile FOP are included
- in the source distribution and are referenced by the build script.
- You will only need to adjust the classpath if you build FOP in some other way. See the build
- script build.xml for details.
-
-
-
- JAVA_HOME
-
- The build script uses Apache Ant, a popular
- Java-based build tool, which usually requires that the environment variable JAVA_HOME point to
- your local JDK root directory. This is true even if you use JDK 1.4 or above, which normally
- does not need this setting.
-
-
-
- Apache Ant
-
- Apache Ant (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
- instructions to install Ant in the Ant manual on the web.
-
-
-
-
- Run the Build Script
-
- Change to the FOP root directory and build FOP by executing the build script (build.xml)
- using the "ant" command.
-
-
- The "ant" command is only available on your system if you've properly
- installed Apache Ant and added Ant's location to the PATH
- environment variable.
-
-
- The file build.xml in the FOP root directory is the blueprint that Ant uses for the build. It
- contains information for numerous build targets, many of which are building blocks to more
- useful target, and others which are primarily used by the FOP developers.
- You may benefit from looking through this file to learn more about the various build targets.
- To obtain a complete list of useful build targets:
-
-
-
The most useful targets are:
-
-
- package: Generates the JAR files (default). This is the normal build that
- produces a jar file usable for running FOP.
-
-
- clean : Cleans the build directory. This is useful for making sure that
- any build errors are cleaned up before starting a new build. It should not ordinarily be
- needed, but may be helpful if you are having problems with the build process itself.
-
-
- javadocs: Creates the FOP API documentation.
- A minimum JDK version of 1.4.2 is required for generating the javadocs.
-
-
-
To run the build:
-
-
For example to do a normal build for the "all" target (which is the default):
-
-
OR
-
-
To clean the build directory first:
-
-
- If you want to shorten the build time you can just call the "package" target which
- doesn't perform any automated tests during the build.
-
-
-
- Troubleshooting
-
If you have problems building FOP, please try the following:
-
-
Run the build with the target of "clean", then rerun the build.
-
Delete the build directory completely, then rerun the build.
-
- Make sure you do not have a non-FOP version of xerces.jar, xalan.jar, batik.jar,
- or another dependency product somewhere in your CLASSPATH.
-
-
- If the build still fails, see the Getting Help
- page for further help.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/configuration.xml b/src/documentation/content/xdocs/1.0/configuration.xml
deleted file mode 100644
index 9adf63c46..000000000
--- a/src/documentation/content/xdocs/1.0/configuration.xml
+++ /dev/null
@@ -1,492 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Configuration
- $Revision$
-
-
-
-
- Configuration File Basics
-
- The FOP configuration file is an XML file containing a variety of settings that are useful
- for controlling FOP's behavior, and for helping it find resources that you wish it to use.
-
-
- The easiest way to get started using a FOP configuration file is to copy the sample found
- at {fop-dir}/conf/fop.xconf to a location of your choice, and then to
- edit it according to your needs.
- It contains templates for the various configuration options, most of which are commented
- out. Remove the comments and change the settings for entries that you wish to use.
- Be sure to follow any instructions, including comments which specify the value range.
- Also, since the configuration file is XML, be sure to keep it well-formed.
-
-
- Making Configuration Available to FOP
-
After creating your configuration file, you must tell FOP how to find it:
-
-
- If running FOP from the command-line, see the "-c" command-line option in
- Running FOP.
-
-
-
-
- Summary of the General Configuration Options
-
-
-
Element
-
Data Type (for the value)
-
Description
-
Default Value
-
-
-
base
-
URL or directory
-
Specifies the base URL based on which relative URL will be resolved.
-
current directory
-
-
-
font-base
-
URL or directory
-
Specifies the base URL based on which relative font URLs will be resolved.
-
-
base URL/directory (above)
-
-
-
hyphenation-base
-
URL or directory
-
Specifies the base URL based on which relative URLs to hyphenation pattern
- files will be resolved. If not specified, support for user-supplied hyphenation
- patterns remains disabled.
-
-
disabled
-
-
-
source-resolution
-
Integer, dpi
-
- Resolution in dpi (dots per inch) which is used internally to determine the pixel
- size for SVG images and bitmap images without resolution information.
-
-
72 dpi
-
-
-
target-resolution
-
Integer, dpi
-
- Resolution in dpi (dots per inch) used to specify the output resolution for bitmap
- images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps
- generated by Apache Batik for filter effects and such.
-
-
72 dpi
-
-
-
strict-configuration
-
Boolean (true, false)
-
- Setting this option to 'true' will cause FOP to strictly verify the contents of the
- FOP configuration file to ensure that defined resources (such as fonts and base
- URLs/directories) are valid and available to FOP. Any errors found will cause FOP to
- immediately raise an exception.
-
false
-
-
-
strict-validation
-
Boolean (true, false)
-
- Setting this option to 'false' causes FOP to be more forgiving about XSL-FO validity,
- for example, you're allowed to specify a border on a region-body which is supported
- by some FO implementations but is non-standard. Note that such a border would
- currently have no effect in Apache FOP.
-
true
-
-
-
break-indent-inheritance
-
Boolean (true, false)
-
- Setting this option to 'true' causes FOP to use an alternative rule set to determine
- text indents specified through margins, start-indent and end-indent. Many commercial
- FO implementations have chosen to break the XSL specification in this aspect. This
- option tries to mimic their behaviour. Please note that Apache FOP may still not
- behave exactly like those implementations either because FOP has not fully matched
- the desired behaviour and because the behaviour among the commercial implementations
- varies. The default for this option (i.e. false) is to behave exactly like the
- specification describes.
-
false
-
-
-
default-page-settings
-
n/a
-
- Specifies the default width and height of a page if "auto" is specified
- for either or both values. Use "height" and "width" attributes on the
- default-page-settings element to specify the two values.
-
"height" 11 inches, "width" 8.26 inches
-
-
-
prefer-renderer
-
boolean (true, false)
-
- By default, FOP prefers the newer output implementations based on the
- IFDocumentHandler interface. If no such implementation can be found for
- a given MIME type, it looks for an implementation of the Renderer interface.
- If necessary, you can invert the lookup order to prefer the Renderer variant over the
- IFDocumentHandler variant by setting this value to true.
-
-
false
-
-
-
use-cache
-
boolean (true, false)
-
All fonts information that has been gathered as a result of "directory"
- or "auto-detect" font configurations will be cached for future rendering runs.
- This setting should improve performance on systems where
- fonts have been configured using the "directory" or "auto-detect" tag mechanisms.
- By default this option is switched on.
-
true
-
-
-
cache-file
-
String
-
This options specifies the file/directory path of the fop cache file.
- This option can also be specified on the command-line using the -cache option.
- This file is currently only used to cache font triplet information for future reference.
-
${base}/conf/fop.cache
-
-
-
renderers
-
(see text below)
-
Contains the configuration for each renderer. See below.
-
N/A
-
-
-
- This is an excerpt from the example configuration file coming with FOP:
-
-
-
-
- Image Loading Customization
-
- Apache FOP uses the image loading framework from
- Apache XML Graphics Commons 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:
-
-
-
- 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.
-
-
- The second penalty element sets an "infinite" penalty for the TIFF loader using the internal
- TIFF codec. This practically disables that plug-in as it will never be chosen as a possible
- solution.
-
-
- Negative penalties are possible to promote a plug-in but a negative penalty sum will be
- treated as zero penalty in most cases. For more details on the image loading framework,
- please consult the documentation there.
-
-
-
- Renderer configuration
-
- Each Renderer has its own configuration section which is identified by the
- MIME type the Renderer is written for, ex. "application/pdf" for the PDF Renderer.
-
-
- The configuration for the PDF Renderer could look like this:
-
-
-
- The details on the font configuration can be found on the separate Fonts page.
- Note especially the section entitled Register Fonts with FOP.
-
-
- Special Settings for the PDF Renderer
-
- The configuration element for the PDF renderer contains two elements. One is for the font configuration
- (please follow the link above) and one is for the "filter list". The filter list controls how the
- individual objects in a PDF file are encoded. By default, all objects get "flate" encoded (i.e. simply
- compressed with the same algorithm that is also used in ZIP files). Most users don't need to change that
- setting. For debugging purposes, it may be desired not to compress the internal objects at all so the
- generated PDF commands can be read. In that case, you can simply use the following filter list. The
- second filter list (type="image") ensures that all images still get compressed but also ASCII-85 encoded
- so the produced PDF file is still easily readable in a text editor.
-
-
-
- Another (optional) setting specific to the PDF Renderer is an output color profile, an ICC
- color profile which indicates the target color space the PDF file is generated for. This
- setting is mainly used in conjunction with the PDF/X feature.
- An example:
-
-
-
- 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:
-
-
-
-
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.
-
-
-
-
- Special Settings for the PostScript Renderer
-
- Besides the normal font configuration (the same "fonts" element as for the PDF renderer) the PostScript
- renderer has an additional setting to force landscape pages to be rotated to fit on a page inserted into
- the printer in portrait mode. Set the value to "true" to activate this feature. The default is "false".
- Example:
-
-
-
-
- Special Settings for the PCL Renderer
-
- Non-standard fonts for the PCL renderer are made available through the Java2D subsystem which means that
- you don't have to do any custom font configuration in this case but you have to use the font names
- offered by Java.
-
-
- Additionally, there are certain settings that control how the renderer handles various elements.
-
-
-
- The default value for the "rendering" setting is "speed" which causes borders
- to be painted as plain rectangles. In this mode, no special borders (dotted,
- dashed etc.) are available. If you want support for all border modes, set the
- value to "quality" as indicated above. This will cause the borders to be painted
- as bitmaps.
-
-
- The default value for the "text-rendering" setting is "auto" which paints the
- base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D.
- If the mix of painting methods results in unwelcome output, you can set this
- to "bitmap" which causes all text to be rendered as bitmaps.
-
-
-
- Special Settings for the AFP Renderer
-
-
-
- Additionally, there are certain settings that control how the renderer handles various elements.
-
-
-
- The default value for the images "mode" setting is "b+w" (black and white). When the images "mode" setting is "b+w" a "bits-per-pixel" setting can be provided to aid the grayscale conversion process. With this setting all images referenced in your source document are converted to an IOCA FS45 grayscale bitmap image form.
- When the setting is "color" all images are converted to an IOCA FS45 color bitmap image form. When "native" setting is "true", all images encountered (TIFF, GIF, JPEG and Encapsulated Postscript etc.) will be embedded directly in the datastream in their native form using a MO:DCA Object Container.
-
-
- The default value for the "renderer-resolution" is 240 dpi.
-
-
-
- By default if there is no configuration definition for "resource-group-file", external resources will be placed in a file called resources.afp.
-
-
-
-
-
- When it does not work
-
-
FOP searches the configuration file for the information it
-expects, at the position it expects. When that information is not
-present, FOP will not complain, it will just continue. When there is
-other information in the file, FOP will not complain, it will just
-ignore it. That means that when your configuration information is in
-the file but in a different XML element, or in a different XML path,
-than FOP expects, it will be silently ignored.
-
-
Check the following possibilities:
-
-
-
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?
-
-
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 schema element:
-
-
-
-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.
-
-
Run FOP in debug mode (command line option
--d). This makes FOP report which configuration
-information it finds. Check if FOP finds what you expect.
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/embedding.xml b/src/documentation/content/xdocs/1.0/embedding.xml
deleted file mode 100644
index de2c6404c..000000000
--- a/src/documentation/content/xdocs/1.0/embedding.xml
+++ /dev/null
@@ -1,701 +0,0 @@
-
-
-
-
-
-
-
- Apache⢠FOP: Embedding
- How to Embed Apache� FOP in a Java application
- $Revision$
-
-
-
-
- Overview
-
- Review Running FOP for important information that applies
- to embedded applications as well as command-line use, such as options and performance.
-
-
- To embed Apache⢠FOP in your application, first create a new
- org.apache.fop.apps.FopFactory instance. This object can be used to launch multiple
- rendering runs. For each run, create a new org.apache.fop.apps.Fop instance through
- one of the factory methods of FopFactory. In the method call you specify which output
- format (i.e. Renderer) to use and, if the selected renderer requires an OutputStream,
- which OutputStream to use for the results of the rendering. You can customize FOP's
- behaviour in a rendering run by supplying your own FOUserAgent instance. The
- FOUserAgent can, for example, be used to set your own Renderer instance (details
- below). Finally, you retrieve a SAX DefaultHandler instance from the Fop object and
- use that as the SAXResult of your transformation.
-
-
- We recently changed FOP's outer API to what we consider the final API. This might require
- some changes in your application. The main reasons for these changes were performance
- improvements due to better reuse of reusable objects and reduced use of static variables
- for added flexibility in complex environments.
-
-
-
- Basic Usage Pattern
-
- Apache FOP relies heavily on JAXP. It uses SAX events exclusively to receive the XSL-FO
- input document. It is therefore a good idea that you know a few things about JAXP (which
- is a good skill anyway). Let's look at the basic usage pattern for FOP...
-
-
Here is the basic pattern to render an XSL-FO file to PDF:
-
-
-
- Let's discuss these 5 steps in detail:
-
-
-
- Step 1: You create a new FopFactory instance. The FopFactory instance holds
- references to configuration information and cached data. It's important to reuse this
- instance if you plan to render multiple documents during a JVM's lifetime.
-
-
- Step 2: You set up an OutputStream that the generated document
- will be written to. It's a good idea to buffer the OutputStream as demonstrated
- to improve performance.
-
-
- Step 3: You create a new Fop instance through one of the factory
- methods on the FopFactory. You tell the FopFactory what your desired output format
- is. This is done by using the MIME type of the desired output format (ex. "application/pdf").
- You can use one of the MimeConstants.* constants. The second parameter is the
- OutputStream you've setup up in step 2.
-
-
- Step 4 We recommend that you use JAXP Transformers even
- if you don't do XSLT transformations to generate the XSL-FO file. This way
- you can always use the same basic pattern. The example here sets up an
- "identity transformer" which just passes the input (Source) unchanged to the
- output (Result). You don't have to work with a SAXParser if you don't do any
- XSLT transformations.
-
-
- Step 5: Here you set up the input and output for the XSLT
- transformation. The Source object is set up to load the "myfile.fo" file.
- The Result is set up so the output of the XSLT transformation is sent to FOP.
- The FO file is sent to FOP in the form of SAX events which is the most efficient
- way. Please always avoid saving intermediate results to a file or a memory buffer
- because that affects performance negatively.
-
-
- Step 6: Finally, we start the XSLT transformation by starting
- the JAXP Transformer. As soon as the JAXP Transformer starts to send its output
- to FOP, FOP itself starts its processing in the background. When the
- transform() method returns FOP will also have finished converting
- the FO file to a PDF file and you can close the OutputStream.
-
- It's a good idea to enclose the whole conversion in a try..finally statement. If
- you close the OutputStream in the finally section, this will make sure that the
- OutputStream is properly closed even if an exception occurs during the conversion.
-
-
-
-
- If you're not totally familiar with JAXP Transformers, please have a look at the
- Embedding examples below. The section contains examples
- for all sorts of use cases. If you look at all of them in turn you should be able
- to see the patterns in use and the flexibility this approach offers without adding
- too much complexity.
-
-
- This may look complicated at first, but it's really just the combination of an
- XSL transformation and a FOP run. It's also easy to comment out the FOP part
- for debugging purposes, for example when you're tracking down a bug in your
- stylesheet. You can easily write the XSL-FO output from the XSL transformation
- to a file to check if that part generates the expected output. An example for that
- can be found in the Embedding examples (See "ExampleXML2FO").
-
-
- Logging
-
- Logging is now a little different than it was in FOP 0.20.5. We've switched from
- Avalon Logging to Jakarta Commons Logging.
- While with Avalon Logging the loggers were directly given to FOP, FOP now retrieves
- its logger(s) through a statically available LogFactory. This is similar to the
- general pattern that you use when you work with Apache Log4J directly, for example.
- We call this "static logging" (Commons Logging, Log4J) as opposed to "instance logging"
- (Avalon Logging). This has a consequence: You can't give FOP a logger for each
- processing run anymore. The log output of multiple, simultaneously running FOP instances
- is sent to the same logger.
-
-
- By default, Jakarta Commons Logging uses
- JDK logging (available in JDKs 1.4 or higher) as its backend. You can configure Commons
- Logging to use an alternative backend, for example Log4J. Please consult the
- documentation for Jakarta Commons Logging on
- how to configure alternative backends.
-
-
- As a result of the above we differentiate between two kinds of "logging":
-
- The use of "feedback" instead of "logging" is intentional. Most people were using
- log output as a means to get feedback from events within FOP. Therefore, FOP now
- includes an event package which can be used to receive feedback from
- the layout engine and other components within FOP per rendering run.
- This feedback is not just some
- text but event objects with parameters so these events can be interpreted by code.
- Of course, there is a facility to turn these events into normal human-readable
- messages. For details, please read on on the Events page.
- This leaves normal logging to be mostly a thing used by the FOP developers
- although anyone can surely activate certain logging categories but the feedback
- from the loggers won't be separated by processing runs. If this is required,
- the Events subsystem is the right approach.
-
-
-
-
- Processing XSL-FO
-
- Once the Fop instance is set up, call getDefaultHandler() to obtain a SAX
- DefaultHandler instance to which you can send the SAX events making up the XSL-FO
- document you'd like to render. FOP processing starts as soon as the DefaultHandler's
- startDocument() method is called. Processing stops again when the
- DefaultHandler's endDocument() method is called. Please refer to the basic
- usage pattern shown above to render a simple XSL-FO document.
-
-
-
-
- Processing XSL-FO generated from XML+XSLT
-
- If you want to process XSL-FO generated from XML using XSLT we recommend
- again using standard JAXP to do the XSLT part and piping the generated SAX
- events directly through to FOP. The only thing you'd change to do that
- on the basic usage pattern above is to set up the Transformer differently:
-
-
-
-
-
- Input Sources
-
- The input XSL-FO document is always received by FOP as a SAX stream (see the
- Parsing Design Document for the rationale).
-
-
- However, you may not always have your input document available as a SAX stream.
- But with JAXP it's easy to convert different input sources to a SAX stream so you
- can pipe it into FOP. That sounds more difficult than it is. You simply have
- to set up the right Source instance as input for the JAXP transformation.
- A few examples:
-
-
-
- URL:Source src = new StreamSource("http://localhost:8080/testfile.xml");
-
-
- File:Source src = new StreamSource(new File("C:/Temp/myinputfile.xml"));
-
-
- String:Source src = new StreamSource(new StringReader(myString)); // myString is a String
-
-
- InputStream:Source src = new StreamSource(new MyInputStream(something));
-
-
- Byte Array:Source src = new StreamSource(new ByteArrayInputStream(myBuffer)); // myBuffer is a byte[] here
-
-
- DOM:Source src = new DOMSource(myDocument); // myDocument is a Document or a Node
-
-
- Java Objects: Please have a look at the Embedding examples which contain an example for this.
-
-
-
- There are a variety of upstream data manipulations possible.
- For example, you may have a DOM and an XSL stylesheet; or you may want to
- set variables in the stylesheet. Interface documentation and some cookbook
- solutions to these situations are provided in
- Xalan Basic Usage Patterns.
-
-
-
- Configuring Apache FOP Programmatically
-
- Apache FOP provides two levels on which you can customize FOP's
- behaviour: the FopFactory and the user agent.
-
-
- Customizing the FopFactory
-
- The FopFactory holds configuration data and references to objects which are reusable over
- multiple rendering runs. It's important to instantiate it only once (except in special
- environments) and reuse it every time to create new FOUserAgent and Fop instances.
-
-
- You can set all sorts of things on the FopFactory:
-
-
-
-
- The font base URL to use when resolving relative URLs for fonts. Example:
-
-
-
-
-
- The hyphenation base URL to use when resolving relative URLs for
- hyphenation patterns. Example:
-
-
-
-
-
- Disable strict validation. When disabled FOP is less strict about the rules
- established by the XSL-FO specification. Example:
-
-
-
-
-
- Enable an alternative set of rules for text indents that tries to mimic the behaviour of many commercial
- FO implementations, that chose to break the specification in this respect. The default of this option is
- 'false', which causes Apache FOP to behave exactly as described in the specification. To enable the
- alternative behaviour, call:
-
-
-
-
-
- Set the source resolution for the document. This is used internally to determine the pixel
- size for SVG images and bitmap images without resolution information. Default: 72 dpi. Example:
-
-
-
-
-
- Manually add an ElementMapping instance. If you want to supply a special FOP extension
- you can give the instance to the FOUserAgent. Normally, the FOP extensions can be automatically detected
- (see the documentation on extension for more info). Example:
-
-
-
-
-
- Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add
- custom URI resolution functionality to FOP. For example, you can use
- Apache XML Commons Resolver to make use of XCatalogs. Example:
-
-
-
- Both the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FopFactory
- is primarily used to resolve URIs on factory-level (hyphenation patterns, for example) and it is always used
- if no other URIResolver (for example on the FOUserAgent) resolved the URI first.
-
-
-
-
-
- Customizing the User Agent
-
- The user agent is the entity that allows you to interact with a single rendering run, i.e. the processing of a single
- document. If you wish to customize the user agent's behaviour, the first step is to create your own instance
- of FOUserAgent using the appropriate factory method on FopFactory and pass that
- to the factory method that will create a new Fop instance:
-
-
-
- You can do all sorts of things on the user agent:
-
-
-
-
- The base URL to use when resolving relative URLs. Example:
-
-
-
-
-
- Set the producer of the document. This is metadata information that can be used for certain output formats such as PDF. The default producer is "Apache FOP". Example:
-
-
-
-
-
- Set the creating user of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Set the author of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Override the creation date and time of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Set the title of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Set the keywords of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Set the target resolution for the document. This is used to
- specify the output resolution for bitmap images generated by bitmap renderers
- (such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter
- effects and such. Default: 72 dpi. Example:
-
-
-
-
-
- Set your own Renderer instance. If you want to supply your own renderer or
- configure a Renderer in a special way you can give the instance to the FOUserAgent. Normally,
- the Renderer instance is created by FOP. Example:
-
-
-
-
-
- Set your own FOEventHandler instance. If you want to supply your own FOEventHandler or
- configure an FOEventHandler subclass in a special way you can give the instance to the FOUserAgent. Normally,
- the FOEventHandler instance is created by FOP. Example:
-
-
-
-
-
- Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add
- custom URI resolution functionality to FOP. For example, you can use
- Apache XML Commons Resolver to make use of XCatalogs. Example:
-
-
-
- Both the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FOUserAgent is
- used for resolving URIs which are document-related. If it's not set or cannot resolve a URI, the URIResolver
- from the FopFactory is used.
-
-
-
-
- You should not reuse an FOUserAgent instance between FOP rendering runs although you can. Especially
- in multi-threaded environment, this is a bad idea.
-
-
-
-
- Using a Configuration File
-
- Instead of setting the parameters manually in code as shown above you can also set
- many values from an XML configuration file:
-
-
-
- The layout of the configuration file is described on the Configuration page.
-
-
-
- Hints
-
- Object reuse
-
- Fop instances shouldn't (and can't) be reused. Please recreate
- Fop and FOUserAgent instances for each rendering run using the FopFactory.
- This is a cheap operation as all reusable information is held in the
- FopFactory. That's why it's so important to reuse the FopFactory instance.
-
-
-
- AWT issues
-
- If your XSL-FO files contain SVG then Apache Batik will be used. When Batik is
- initialised it uses certain classes in java.awt that
- intialise the Java AWT classes. This means that a daemon thread
- is created by the JVM and on Unix it will need to connect to a
- DISPLAY.
-
-
- The thread means that the Java application may not automatically quit
- when finished, you will need to call System.exit(). These
- issues should be fixed in the JDK 1.4.
-
-
- If you run into trouble running FOP on a head-less server, please see the
- notes on Batik.
-
-
-
- Getting information on the rendering process
-
- To get the number of pages that were rendered by FOP you can call
- Fop.getResults(). This returns a FormattingResults object
- where you can look up the number of pages produced. It also gives you the
- page-sequences that were produced along with their id attribute and their
- numbers of pages. This is particularly useful if you render multiple
- documents (each enclosed by a page-sequence) and have to know the number of
- pages of each document.
-
-
-
-
- Improving performance
-
- There are several options to consider:
-
-
-
- Whenever possible, try to use SAX to couple the individual components involved
- (parser, XSL transformer, SQL datasource etc.).
-
-
- Depending on the target OutputStream (in case of a FileOutputStream, but not
- for a ByteArrayOutputStream, for example) it may improve performance considerably
- if you buffer the OutputStream using a BufferedOutputStream:
- out = new java.io.BufferedOutputStream(out);
-
- Make sure you properly close the OutputStream when FOP is finished.
-
-
- Cache the stylesheet. If you use the same stylesheet multiple times
- you can set up a JAXP Templates object and reuse it each time you do
- the XSL transformation. (More information can be found
- here.)
-
-
- Use an XSLT compiler like XSLTC
- that comes with Xalan-J.
-
-
- Fine-tune your stylesheet to make the XSLT process more efficient and to create XSL-FO that can
- be processed by FOP more efficiently. Less is more: Try to make use of property inheritance where possible.
-
-
- You may also wish to consider trying to reduce memory usage.
-
-
-
-
- Multithreading FOP
-
- Apache FOP may currently not be completely thread safe.
- The code has not been fully tested for multi-threading issues, yet.
- If you encounter any suspicious behaviour, please notify us.
-
-
- There is also a known issue with fonts being jumbled between threads when using
- the Java2D/AWT renderer (which is used by the -awt and -print output options).
- In general, you cannot safely run multiple threads through the AWT renderer.
-
-
-
- Examples
-
- The directory "{fop-dir}/examples/embedding" contains several working examples.
-
-
- ExampleFO2PDF.java
-
This
-
- example
-demonstrates the basic usage pattern to transform an XSL-FO
-file to PDF using FOP.
-
-
-
-
- ExampleXML2FO.java
-
This
-
- example
-has nothing to do with FOP. It is there to show you how an XML
-file can be converted to XSL-FO using XSLT. The JAXP API is used to do the
-transformation. Make sure you've got a JAXP-compliant XSLT processor in your
-classpath (ex. Xalan).
-
-
-
-
- ExampleXML2PDF.java
-
This
-
- example
-demonstrates how you can convert an arbitrary XML file to PDF
-using XSLT and XSL-FO/FOP. It is a combination of the first two examples
-above. The example uses JAXP to transform the XML file to XSL-FO and FOP to
-transform the XSL-FO to PDF.
-
-
-
-The output (XSL-FO) from the XSL transformation is piped through to FOP using
-SAX events. This is the most efficient way to do this because the
-intermediate result doesn't have to be saved somewhere. Often, novice users
-save the intermediate result in a file, a byte array or a DOM tree. We
-strongly discourage you to do this if it isn't absolutely necessary. The
-performance is significantly higher with SAX.
-
-
-
- ExampleObj2XML.java
-
This
-
- example
-is a preparatory example for the next one. It's an example that
-shows how an arbitrary Java object can be converted to XML. It's an often
-needed task to do this. Often people create a DOM tree from a Java object and
-use that. This is pretty straightforward. The example here, however, shows how
-to do this using SAX, which will probably be faster and not even more
-complicated once you know how this works.
-
-
-
-For this example we've created two classes: ProjectTeam and ProjectMember
-(found in xml-fop/examples/embedding/java/embedding/model). They represent
-the same data structure found in
-xml-fop/examples/embedding/xml/xml/projectteam.xml. We want to serialize to XML a
-project team with several members which exist as Java objects.
-Therefore we created the two classes: ProjectTeamInputSource and
-ProjectTeamXMLReader (in the same place as ProjectTeam above).
-
-
-The XMLReader implementation (regard it as a special kind of XML parser) is
-responsible for creating SAX events from the Java object. The InputSource
-class is only used to hold the ProjectTeam object to be used.
-
-
-Have a look at the source of ExampleObj2XML.java to find out how this is
-used. For more detailed information see other resources on JAXP (ex.
-An older JAXP tutorial).
-
-
-
- ExampleObj2PDF.java
-
This
-
- example
-combines the previous and the third to demonstrate
-how you can transform a Java object to a PDF directly in one smooth run
-by generating SAX events from the Java object that get fed to an XSL
-transformation. The result of the transformation is then converted to PDF
-using FOP as before.
-
-
-
-
- ExampleDOM2PDF.java
-
This
-
- example
-has FOP use a DOMSource instead of a StreamSource in order to
-use a DOM tree as input for an XSL transformation.
-
This
-
- example
-shows the usage of the PDF Transcoder, a sub-application within FOP.
-It is used to generate a PDF document from an SVG file.
-
-
-
- Final notes
-
-These examples should give you an idea of what's possible. It should be easy
-to adjust these examples to your needs. Also, if you have other examples that you
-think should be added here, please let us know via either the fop-users or fop-dev
-mailing lists. Finally, for more help please send your questions to the fop-users
-mailing list.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/events.xml b/src/documentation/content/xdocs/1.0/events.xml
deleted file mode 100644
index 27daad59b..000000000
--- a/src/documentation/content/xdocs/1.0/events.xml
+++ /dev/null
@@ -1,449 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Events/Processing Feedback
- $Revision$
-
-
-
- Introduction
-
- In versions until 0.20.5, Apache⢠FOP used
- Avalon-style Logging where
- it was possible to supply a logger per processing run. During the redesign
- the logging infrastructure was switched over to
- Commons Logging which is (like Log4J or
- java.util.logging) a "static" logging framework (the logger is accessed through static
- variables). This made it very difficult in a multi-threaded system to retrieve information
- for a single processing run.
-
-
- With FOP's event subsystem, we'd like to close this gap again and even go further. The
- first point is to realize that we have two kinds of "logging". Firstly, we have the logging
- infrastructure for the (FOP) developer who needs to be able to enable finer log messages
- for certain parts of FOP to track down a certain problem. Secondly, we have the user who
- would like to be informed about missing images, overflowing lines or substituted fonts.
- These messages (or events) are targeted at less technical people and may ideally be
- localized (translated). Furthermore, tool and solution builders would like to integrate
- FOP into their own solutions. For example, an FO editor should be able to point the user
- to the right place where a particular problem occurred while developing a document template.
- Finally, some integrators would like to abort processing if a resource (an image or a font)
- has not been found, while others would simply continue. The event system allows to
- react on these events.
-
-
- On this page, we won't discuss logging as such. We will show how the event subsystem can
- be used for various tasks. We'll first look at the event subsystem from the consumer side.
- Finally, the production of events inside FOP will be discussed (this is mostly interesting
- for FOP developers only).
-
-
-
- The consumer side
-
- The event subsystem is located in the org.apache.fop.events package and its
- base is the Event class. An instance is created for each event and is sent
- to a set of EventListener instances by the EventBroadcaster.
- An Event contains:
-
-
-
an event ID,
-
a source object (which generated the event),
-
a severity level (Info, Warning, Error and Fatal Error) and
-
a map of named parameters.
-
-
- The EventFormatter class can be used to translate the events into
- human-readable, localized messages.
-
-
- A full example of what is shown here can be found in the
- examples/embedding/java/embedding/events directory in the FOP distribution.
- The example can also be accessed
- via the web.
-
-
- Writing an EventListener
-
- 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.
-
-
-
- You can see that for every event the method processEvent of the
- EventListener will be called. Inside this method you can do whatever
- processing you would like including throwing a RuntimeException, if you want
- to abort the current processing run.
-
-
- The code above also shows how you can turn an event into a human-readable, localized
- message that can be presented to a user. The EventFormatter class does
- this for you. It provides additional methods if you'd like to explicitly specify
- the locale.
-
-
- It is possible to gather all events for a whole processing run so they can be
- evaluated afterwards. However, care should be taken about memory consumption since
- the events provide references to objects inside FOP which may themselves have
- references to other objects. So holding on to these objects may mean that whole
- object trees cannot be released!
-
-
-
- Adding an EventListener
-
- To register the event listener with FOP, get the EventBroadcaster which
- is associated with the user agent (FOUserAgent) and add it there:
-
-
-
- Please note that this is done separately for each processing run, i.e. for each
- new user agent.
-
-
-
- An additional listener example
-
- Here's an additional example of an event listener:
-
-
- By default, FOP continues processing even if an image wasn't found. If you have
- more strict requirements and want FOP to stop if an image is not available, you can
- do something like the following in the simplest case:
-
-
-
- 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.
-
-
- You can also customize the exception to throw (you can may throw a RuntimeException
- or subclass yourself) and/or which event to respond to:
-
-
-
- This throws a RuntimeException with the FileNotFoundException
- as the cause. Further processing effectively stops in FOP. You can catch the exception
- in your code and react as you see necessary.
-
-
-
-
- The producer side (for FOP developers)
-
- This section is primarily for FOP and FOP plug-in developers. It describes how to use
- the event subsystem for producing events.
-
-
- The event package has been designed in order to be theoretically useful for use cases
- outside FOP. If you think this is interesting independently from FOP, please talk to
- us.
-
-
- Producing and sending an event
-
- The basics are very simple. Just instantiate an Event object and fill
- it with the necessary parameters. Then pass it to the EventBroadcaster
- which distributes the events to the interested listeneners. Here's a code example:
-
-
-
- The Event.paramsBuilder() is a
- fluent interface
- to help with the build-up of the parameters. You could just as well instantiate a
- Map (Map<String, Object>) and fill it with values.
-
-
-
- The EventProducer interface
-
- To simplify event production, the event subsystem provides the EventProducer
- interface. You can create interfaces which extend EventProducer. These
- interfaces will contain one method per event to be generated. By contract, each event
- method must have as its first parameter a parameter named "source" (Type Object) which
- indicates the object that generated the event. After that come an arbitrary number of
- parameters of any type as needed by the event.
-
-
- The event producer interface does not need to have any implementation. The implementation
- is produced at runtime by a dynamic proxy created by DefaultEventBroadcaster.
- The dynamic proxy creates Event instances for each method call against
- the event producer interface. Each parameter (except "source") is added to the event's
- parameter map.
-
-
- To simplify the code needed to get an instance of the event producer interface it is
- suggested to create a public inner provider class inside the interface.
-
-
- Here's an example of such an event producer interface:
-
-
-
- To produce the same event as in the first example above, you'd use the following code:
-
-
-
-
- The event model
-
- 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 Event's
- parameter map we need to know the parameter names. These are retrieved from an
- event object model. This is found in the org.apache.fop.events.model
- 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 (ant resourcegen). The Ant task (found in
- src/codegen/java/org/apache/fop/tools/EventProducerCollectorTask.java)
- scans FOP's sources for descendants of the EventProducer interface and
- uses QDox to parse these interfaces.
-
-
- The event model XML files are generated during build by the Ant task mentioned above when
- running the "resourcegen" task. So just run "ant resourcegen" if you receive
- a MissingResourceException at runtime indicating that
- "event-model.xml" is missing.
-
-
- Primarily, the QDox-based collector task records the parameters' names and types.
- Furthermore, it extracts additional attributes embedded as Javadoc comments from
- the methods. At the moment, the only such attribute is "@event.severity" which indicates
- the default event severity (which can be changed by event listeners). The example event
- producer above shows the Javadocs for an event method.
-
-
- There's one more information that is extracted from the event producer information for
- the event model: an optional primary exception. The first exception in the "throws"
- declaration of an event method is noted. It is used to throw an exception from
- the invocation handler if the event has an event severity of "FATAL" when all
- listeners have been called (listeners can update the event severity). Please note
- that an implementation of
- org.apache.fop.events.EventExceptionManager$ExceptionFactory has to be
- registered for the EventExceptionManager to be able to construct the
- exception from an event.
-
-
- For a given application, there can be multiple event models active at the same time.
- In FOP, each renderer is considered to be a plug-in and provides its own specific
- event model. The individual event models are provided through an
- EventModelFactory. This interface is implemented for each event model
- and registered through the service provider mechanism
- (see the plug-ins section for details).
-
-
-
- Event severity
-
- Four different levels of severity for events has been defined:
-
-
-
INFO: informational only
-
WARN: a Warning
-
ERROR: an error condition from which FOP can recover. FOP will continue processing.
-
FATAL: a fatal error which causes an exception in the end and FOP will stop processing.
-
-
- Event listeners can choose to ignore certain events based on their event severity.
- Please note that you may recieve an event "twice" in a specific case: if there is
- a fatal error an event is generated and sent to the listeners. After that an exception
- is thrown with the same information and processing stops. If the fatal event is
- shown to the user and the following exception is equally presented to the user it
- may appear that the event is duplicated. Of course, the same information is just
- published through two different channels.
-
-
-
- Plug-ins to the event subsystem
-
- The event subsystem is extensible. There are a number of extension points:
-
-
-
- org.apache.fop.events.model.EventModelFactory: Provides
- an event model to the event subsystem.
-
-
- org.apache.fop.events.EventExceptionManager$ExceptionFactory:
- Creates exceptions for events, i.e. turns an event into a specific exception.
-
-
-
- The names in bold above are used as filenames for the service provider files that
- are placed in the META-INF/services directory. That way, they are
- automatically detected. This is a mechanism defined by the
- JAR file specification.
-
-
-
- Localization (L10n)
-
- One goal of the event subsystem was to have localized (translated) event messages.
- The EventFormatter class can be used to convert an event to a
- human-readable message. Each EventProducer can provide its own XML-based
- translation file. If there is none, a central translation file is used, called
- "EventFormatter.xml" (found in the same directory as the EventFormatter
- class).
-
-
- The XML format used by the EventFormatter is the same as
- Apache Cocoon's catalog format. Here's an example:
-
-
-
- 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
- org.apache.fop.util.text.AdvancedMessageFormat which is more powerful
- than the MessageFormat classes provided by the Java class library
- (java.util.text package).
-
-
- "locator" is a template that is reused by the other message templates
- by referencing it through "{{locator}}". This is some kind of include command.
-
-
- Normal event parameters are accessed by name inside single curly braces, for example:
- "{node}". For objects, this format just uses the toString() method to turn
- the object into a string, unless there is an ObjectFormatter registered
- for that type (there's an example for org.xml.sax.Locator).
-
-
- 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).
-
-
- Additional such modifiers can be added by implementing the
- AdvancedMessageFormat$Part and AdvancedMessageFormat$PartFactory
- interfaces.
-
-
- 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).
-
-
- Developers can also register a function (in the above example:
- {#gatherContextInfo})
- to do more complex information rendering. These functions are implementations of the
- AdvancedMessageFormat$Function interface. Please take care that this is
- done in a locale-independent way as there is no locale information available, yet.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/extensions.xml b/src/documentation/content/xdocs/1.0/extensions.xml
deleted file mode 100644
index f8156b9f0..000000000
--- a/src/documentation/content/xdocs/1.0/extensions.xml
+++ /dev/null
@@ -1,339 +0,0 @@
-
-
-
-
-
-
- Standard Apache⢠FOP Extensions
- $Revision$
-
-
-
- By "extension", we mean any data that can be placed in the input XML document that
- is not addressed by the XSL-FO standard.
- By having a mechanism for supporting extensions, Apache⢠FOP is able to add features that
- are not covered in the specification.
-
-
- The extensions documented here are included with FOP, and are automatically available
- to you. If you wish to add an extension of your own to FOP, please see the
- Developers' Extension Page.
-
- All extensions require the correct use of an appropriate namespace in your input document.
-
- SVG
-
- By convention, FO extensions in FOP use the "fox" namespace prefix.
- To use any of the FO extensions, add a namespace entry for
- http://xmlgraphics.apache.org/fop/extensions to the root element:
-
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.
-
-
- It is possible that in some future release of FOP, all elements with
-"id" attributes will generate named-destinations, which will eliminate the need for
-fox:destination.
-
-
- Table Continuation Label
-
This extension element hasn't been reimplemented for the redesigned code, yet.
-
-
-
- fox:orphan-content-limit and fox:widow-content-limit
-
- The two proprietary extension properties, fox:orphan-content-limit and
- fox:widow-content-limit, are used to improve the layout of list-blocks and tables.
- If you have a table with many entries, you don't want a single row to be left over
- on a page. You will want to make sure that at least two or three lines are kept
- together. The properties take an absolute length which specifies the area at the
- beginning (fox:widow-content-limit) or at the end (fox:orphan-content-limit) of a
- table or list-block. The properties are inherited and only have an effect on fo:table
- and fo:list-block. An example: fox:widow-content-limit="3 * 1.2em" would make sure
- the you'll have at least three lines (assuming line-height="1.2") together on a table
- or list-block.
-
-
-
- fox:external-document
-
- This feature is incomplete. Support for multi-page documents will be added shortly.
- At the moment, only single-page images will work. And this will not work with RTF output.
-
-
- This is a proprietary extension element which allows to add whole images as pages to
- an FO document. For example, if you have a scanned document or a fax as multi-page TIFF
- file, you can append or insert this document using the fox:external-document
- element. Each page of the external document will create one full page in the target
- format.
-
-
- The fox:external-document element is structurally a peer to
- fo:page-sequence, so wherever you can put an fo:page-sequence
- you could also place a fox:external-document.
- Therefore, the specified contents for fo:root change to:
-
- The fox:external-document extension formatting object is used to specify
- how to create a (sub-)sequence of pages within a document. The content of these pages
- comes from the individual subimages/pages of an image or paged document (for example:
- multi-page TIFF in the form of faxes or scanned documents, or PDF files). The
- formatting object creates the necessary areas to display one image per page.
-
-
- In terms of page numbers, the behaviour is the same as for
- fo:page-sequence. The placement of the image inside the page is similar
- to that of fo:external-graphic or fo:instream-foreign-object,
- i.e. the viewport (and therefore the page size) is defined by either the intrinsic
- size of the image or by the size properties that apply to this formatting object.
-
-
Content: EMPTY
-
The following properties apply to this formatting object:
pages: <page-set> (see below) (not implemented, yet)
-
reference-orientation
-
scaling
-
scaling-method
-
src
-
text-align
-
width
-
-
- Datatype "page-set": Value: auto | <integer-range>,
- Default: "auto" which means all pages/subimages of the document.
- <integer-range> allows values such as "7" or "1-3"
-
-
- fox:external-document is not suitable for concatenating FO documents.
- For this, XInclude is recommended.
-
-
-
-
- Free-form Transformation for fo:block-container
-
- For fo:block-container elements whose absolute-position set to
- "absolute" or "fixed" you can use the extension attribute fox:transform
- to apply a free-form transformation to the whole block-container. The content of the
- fox:transform attribute is the same as for
- SVG's transform attribute.
- The transformation specified here is performed in addition to other implicit
- transformations of the block-container (resulting from top, left and other properties)
- and after them.
-
-
- Examples: fox:transform="rotate(45)" would rotate the block-container
- by 45 degrees clock-wise around its upper-left corner.
- fox:transform="translate(10000,0)" would move the block-container to the
- right by 10 points (=10000 millipoints, FOP uses millipoints internally!).
-
-
- This extension attribute doesn't work for all output formats! It's currently only
- supported for PDF, PS and Java2D-based renderers.
-
-
-
- Color functions
-
- XSL-FO supports specifying color using the rgb(), rgb-icc() and system-color() functions.
- Apache FOP provides additional color functions for special use cases. Please note that
- using these functions compromises the interoperability of an FO document.
-
-
- cmyk()
-
color cmyk(numeric, numeric, numeric, numeric)
-
- This function will construct a color in device-specific CMYK color space. The numbers
- must be between 0.0 and 1.0. For output formats that don't support device-specific
- color space the CMYK value is converted to an sRGB value.
-
-
-
- #CMYK pseudo-profile
-
color rgb-icc(numeric, numeric, numeric, #CMYK, numeric, numeric, numeric, numeric)
-
- The rgb-icc function will respond to a pseudo-profile called "#CMYK"
- which indicates a device-specific CMYK color space. The "#CMYK" profile is implicitely
- available and doesn't have to be (and cannot be) defined through an
- fo:color-profile element. It is provided for compatibility with certain
- commercial XSL-FO implementations. Please note that this is not part of the official
- specification but rather a convention. The following two color specifications are
- equivalent:
-
-
-
cmyk(0%,0%,20%,40%)
-
rgb-icc(153, 153, 102, #CMYK, 0, 0, 0.2, 0.4)
-
-
-
-
- Prepress Support
-
-
- This section defines a number of extensions related to
- prepress support.
- fox:scale defines a general scale factor for the generated pages.
- fox:bleed defines the
- bleed area for a page.
- fox:crop-offset defines the outer edges of the area in which crop marks,
- registration marks, color bars and page information are placed.
- For details, please read on below.
-
-
- Those extensions have been implemented in the PDF and Java2D renderers only.
-
-
-
- fox:scale
-
Value: <number>{1,2}
-
Initial: 1
-
Applies to: fo:simple-page-master
-
- This property specifies a scale factor along resp. the x and y axes. If only one number
- is provided it is used for both the x and y scales. A scale factor smaller than 1
- shrinks the page. A scale factor greater than 1 enlarges the page.
-
-
-
- fox:bleed
-
- Value: <length>{1,4}
-
-
- Initial: 0pt
-
-
Applies to: fo:simple-page-master
-
- If there is only one value, it applies to all sides. If there are two values, the top and bottom
- bleed widths are set to the first value and the right and left bleed widths are set to the second.
- If there are three values, the top is set to the first value, the left and right are set to the second,
- and the bottom is set to the third. If there are four values, they apply to the top, right, bottom, and
- left, respectively.
- (Corresponds to the definition of
- padding).
-
-
- This extension indirectly defines the BleedBox and is calculated by expanding the TrimBox by
- the bleed widths. The lengths must be non-negative.
-
-
-
- fox:crop-offset
-
- Value: <length>{1,4}
-
-
- Initial: bleed (see below)
-
-
Applies to: fo:simple-page-master
-
- Same behaviour as with fox:bleed. The initial value is set to the same values as the
- fox:bleed property.
-
-
- This extension indirectly defines the MediaBox and is calculated by expanding
- the TrimBox by the crop offsets. The lengths must be non-negative.
-
-
-
- fox:crop-box
-
- Value: [trim-box | bleed-box | media-box]
-
-
- Initial: media-box
-
-
Applies to: fo:simple-page-master
-
- 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.
-
-
- If requested in the future, we could offer to specify the CropBox in absolute coordinates rather
- than just by referencing another box.
-
The following table summarizes the font capabilities of the various Apache� FOP renderers:
-
-
-
Renderer
-
Base-14
-
AWT/OS
-
Custom
-
Custom Embedding
-
-
-
PDF
-
yes
-
no
-
yes
-
yes
-
-
-
PostScript
-
yes
-
no
-
yes
-
yes
-
-
-
PCL
-
yes (modified)
-
yes (painted as bitmaps)
-
yes (painted as bitmaps)
-
no
-
-
-
AFP
-
no
-
no
-
yes
-
yes
-
-
-
Java2D/AWT/Bitmap
-
if available from OS
-
yes
-
yes
-
n/a (display only)
-
-
-
Print
-
if available from OS
-
yes
-
yes
-
controlled by OS printer driver
-
-
-
RTF
-
n/a (font metrics not needed)
-
n/a
-
n/a
-
n/a
-
-
-
TXT
-
yes (used for layout but not for output)
-
no
-
yes (used for layout but not for output)
-
no
-
-
-
-
-
XML
-
yes
-
no
-
yes
-
n/a
-
-
-
-
- Base-14 Fonts
-
- The Adobe PostScript and PDF Specification specify a set of 14 fonts that must be
- available to every PostScript interpreter and PDF reader:
- Helvetica (normal, bold, italic, bold italic),
- Times (normal, bold, italic, bold italic),
- Courier (normal, bold, italic, bold italic),
- Symbol and ZapfDingbats.
-
-
- The following font family names are hard-coded into FOP for the Base-14 font set:
-
-
-
-
Base-14 font
-
font families
-
-
-
Helvetica
-
Helvetica, sans-serif, SansSerif
-
-
-
Times
-
Times, Times Roman, Times-Roman, serif, any
-
-
-
Courier
-
Courier, monospace, Monospaced
-
-
-
Symbol
-
Symbol
-
-
-
ZapfDingbats
-
ZapfDingbats
-
-
-
- Please note that recent versions of Adobe Acrobat Reader replace
- "Helvetica" with "Arial" and "Times" with "Times New Roman" internally.
- GhostScript replaces "Helvetica" with "Nimbus Sans L" and "Times" with
- "Nimbus Roman No9 L". Other document viewers may do similar font
- substitutions. If you need to make sure that there are no such
- substitutions, you need to specify an explicit font and embed it in
- the target document.
-
-
-
- Missing Fonts
-
- When FOP does not have a specific font at its disposal (because it's
- not installed in the operating system or set up in FOP's configuration),
- the font is replaced with "any". "any" is internally mapped to the
- Base-14 font "Times" (see above).
-
-
-
- Missing Glyphs
-
- Every font contains a particular set of
- glyphs. If no glyph can be found for
- a given character, FOP will issue a warning and use the glpyh for "#" (if available)
- instead. Before it does that, it consults a (currently hard-coded) registry of
- glyph substitution groups (see Glyphs.java in Apache XML Graphics Commons).
- This registry can supply alternative glyphs in some cases (like using space when a no-break
- space is requested). But there's no guarantee that the result will be as expected (for
- example, in the case of hyphens and similar glyphs). A better way is to use a font that
- has all the necessary glyphs. This glyph substitution is only a last resort.
-
-
-
- Java2D/AWT/Operating System Fonts
-
- The Java2D family of renderers (Java2D, AWT, Print, TIFF, PNG), use the
- Java AWT subsystem for font metric information. Through operating system
- registration, the AWT subsystem knows what fonts are available on the system,
- and the font metrics for each one.
-
-
- When working with one of these output formats and you're missing a font, just
- install it in your operating system and they should be available for these
- renderers. Please note that this is not true for other output formats such as
- PDF or PostScript.
-
-
-
- Custom Fonts
-
- Support for custom fonts is highly output format dependent (see above table).
- This section shows how to add Type 1 and TrueType fonts to the PDF, PostScript and
- Java2D-based renderers. Other renderers (like AFP) support other font formats. Details
- in this case can be found on the page about output formats.
-
-
- In earlier FOP versions, it was always necessary to create an XML font metrics file
- if you wanted to add a custom font. This unconvenient step has been removed and in
- addition to that, FOP supports auto-registration of fonts, i.e. FOP can find fonts
- installed in your operating system or can scan user-specified directories for fonts.
- Font registration via XML font metrics file is still supported and may still be necessary
- for some very special cases as fallback variant while we stabilize font auto-detection.
-
-
- Basic information about fonts can be found at:
-
- 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.
-
-
-
- Review the documentation for FOP Configuration
- for instructions on making the FOP configuration available to FOP when it runs.
- Otherwise, FOP has no way of finding your custom font information. It is currently
- not possible to easily configure fonts from Java code.
-
-
-
- Advanced font configuration
-
- The instructions found above should be sufficient for most users. Below are some
- additional instructions in case the basic font configuration doesn't lead to
- the desired results.
-
-
- Type 1 Font Metrics
-
FOP includes PFMReader, which reads the PFM file that normally comes with a Type 1 font, and generates an appropriate font metrics file for it.
- To use it, run the class org.apache.fop.fonts.apps.PFMReader:
-
Windows:
-
-
Unix:
-
-
PFMReader [options]:
-
-
-fn <fontname> By default, FOP uses the fontname from the
- .pfm file when embedding the font. Use the "-fn" option to override this name with one you have
- chosen. This may be useful in some cases to ensure that applications using the output document
- (Acrobat Reader for example) use the embedded font instead of a local font with the same
- name.
-
- The classpath in the above example has been simplified for readability.
- You will have to adjust the classpath to the names of the actual JAR files in the lib directory.
- xml-apis.jar, xercesImpl.jar, xalan.jar and serializer.jar are not necessary for JDK version 1.4 or later.
- The tool will construct some values (FontBBox, StemV and ItalicAngle) based on assumptions and calculations which are only an approximation to the real values.
- FontBBox and Italic Angle can be found in the human-readable part of the PFB file or in the AFM file.
- The PFMReader tool does not yet interpret PFB or AFM files, so if you want to be correct, you may have to adjust the values in the XML file manually.
- The constructed values however appear to have no visible influence.
-
-
- TrueType Font Metrics
-
FOP includes TTFReader, which reads the TTF file and generates an appropriate font metrics file for it.
- Use it in a similar manner to PFMReader.
- For example, to create such a metrics file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:
-
-
TTFReader [options]:
-
-
-d <DEBUG | INFO > Sets the debug level (default is
- INFO).
-
-fn <fontname> Same as for PFMReader.
-
-ttcname <fontname> If you're reading data from a
- TrueType Collection (.ttc file) you must specify which font from the collection you will read
- metrics from.
- If you read from a .ttc file without this option, the fontnames will be listed for you.
-
-enc ansi Creates a WinAnsi-encoded font metrics file.
- Without this option, a CID-keyed font metrics file is created.
- The table below summarizes the differences between these two encoding options as currently
- used within FOP.
- Please note that this information only applies to TrueType fonts and TrueType collections:
-
-
-
-
Issue
-
WinAnsi
-
CID-keyed
-
-
-
Usable Character Set
-
Limited to WinAnsi character set, which is roughly equivalent to iso-8889-1.
-
Limited only by the characters in the font itself.
-
-
-
Embedding the Font
-
Optional.
-
Mandatory. Not embedding the font produces invalid PDF documents.
-
-
-
- You may experience failures with certain TrueType fonts, especially if they don't contain
- the so-called Unicode "cmap" table. TTFReader can currently not deal with font like this.
-
-
-
- TrueType Collections
-
TrueType collections (.ttc files) contain more than one font.
- To create metrics files for these fonts, you must specify which font in the collection should be generated, by using the "-ttcname" option with the TTFReader.
-
To get a list of the fonts in a collection, just start the TTFReader as if it were a normal TrueType file (without the -ttcname option).
- It will display all of the font names and exit with an Exception.
-
Here is an example of generating a metrics file for a .ttc file:
-
-
- 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:
-
-
-
-
- Register Fonts with FOP
-
You must tell FOP how to find and use the font metrics files by registering them in the FOP Configuration. Add entries for your custom fonts, regardless of font type, to the configuration file in a manner similar to the following:
-
-
-
- URLs are used to access the font metric and font files.
- Relative URLs are resolved relative to the font-base property (or base) if available.
- See FOP: Configuration for more information.
-
-
The "metrics-url" attribute is generally not necessary except if you run into problems with certain fonts.
-
Either an "embed-url" or a "metrics-url" must be specified for font tag configurations.
-
The font "kerning" attribute is optional. Default is "true".
-
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.
-
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.
-
The attribute "encoding-mode" is optional an may have the following values:
-
-
auto: default font encoding mode ("cid" for Truetype, "single-byte" for Type 1)
-
single-byte: use single-byte encodings in the target format (if applicable)
-
cid: encode as CID-keyed font (currently only supported for PDF output with TrueType fonts)
-
-
-
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.
-
The fonts "auto-detect" tag can be used to automatically register fonts that are found to be installed on the native operating system.
-
Fonts registered with "font" tag configurations override fonts found by means of "directory" tag definitions.
-
Fonts found as a result of a "directory" tag configuration override fonts found as a result of the "auto-detect" tag being specified.
-
- If relative URLs are specified, they are evaluated relative to the value of the
- "font-base" setting. If there is no "font-base" setting, the fonts are evaluated
- relative to the base directory.
-
-
-
-
-
- Auto-Detect and auto-embed feature
-
When the "auto-detect" flag is set in the configuration, FOP will automatically search for fonts in the default paths for your operating system.
-
FOP will also auto-detect fonts which are available in the classpath, if they are described as "application/x-font" in the MANIFEST.MF file. For example, if your .jar file contains font/myfont.ttf:
-
-
This feature allows you to create JAR files containing fonts. The JAR files can be added to fop by providem them in the classpath, e.g. copying them into the lib/ directory.
-
-
- Embedding
-
- By default, all fonts are embedded if an output format supports font embedding. In some
- cases, however, it is preferred that some fonts are only referenced. When working
- with referenced fonts it is important to be in control of the target environment where
- the produced document is consumed, i.e. the necessary fonts have to be installed there.
-
-
- There are two different ways how you can specify that a font should be referenced:
-
-
-
- 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.
-
-
- 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:
-
-
-
-
- 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
- java.util.regex package.
- 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 font-family=".*".
-
-
- The referenced-fonts element can be placed either inside the general
- fonts element (right under the root) or in the fonts 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.
-
-
- Various notes related to embedded fonts:
-
-
-
The PostScript renderer does not yet support TrueType fonts, but can embed Type 1 fonts.
-
The font is simply embedded into the PDF file, it is not converted.
-
When FOP embeds a font, it adds a prefix to the fontname to ensure that the name will not match the fontname of an installed font.
- This is helpful with older versions of Acrobat Reader that preferred installed fonts over embedded fonts.
-
When embedding PostScript fonts, the entire font is always embedded.
-
When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a subset of the
- original font, containing only the glyphs used, is embedded in the output document.
- That's the default, but if you specify encoding-mode="single-byte" (see above), the
- complete font is embedded.
-
-
-
- Substitution
-
When a <substitutions/> section is defined in the configuration, FOP will re-map any font-family references found in your FO input to a given substitution font.
-
-
If a <substitution/> is declared, it is mandatory that both a <from/> and <to/> child element is declared with a font-family attribute.
-
Both font-weight and font-style are optional attributes, if they are provided then a value of 'normal' is assumed.
-
-
For example you could make all FO font-family references to 'Arial' with weights between 700 and 900 reference the normal 'Arial Black' font.
-
-
-
-
-
- Font Selection Strategies
-
- There are two font selection strategies: character-by-character or auto. The default is auto.
-
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):
-
-
aaa lll xxx would be displayed in fonts A A B
-
aaaxx would be displayed in font A
-
aaaxxx would be displayed in font A
-
aaaxxxx would be displayed in font B
-
-
Character-by-Character is NOT yet supported!
-
-
- Font List Command-Line Tool
-
- FOP contains a small command-line tool that lets you generate a list of all configured
- fonts. Its class name is: org.apache.fop.tools.fontlist.FontListMain.
- Run it with the "-?" parameter to get help for the various options.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/fotree/disabled-testcases.xml b/src/documentation/content/xdocs/1.0/fotree/disabled-testcases.xml
deleted file mode 100644
index 196eafcc4..000000000
--- a/src/documentation/content/xdocs/1.0/fotree/disabled-testcases.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
- demo test failure
- demo-test-failure.fo
-
-
-
- Markers and core function evaluation
- from-table-column_marker.fo
- The code currently evaluates this function according to the column in which the
- marker appears in the source document, rather than the column it is retrieved in.
-
-
diff --git a/src/documentation/content/xdocs/1.0/graphics.xml b/src/documentation/content/xdocs/1.0/graphics.xml
deleted file mode 100644
index b1653443a..000000000
--- a/src/documentation/content/xdocs/1.0/graphics.xml
+++ /dev/null
@@ -1,590 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Graphics Formats
- $Revision$
-
-
-
- Introduction
-
- Some noteworthy features of the image handling subsystem are:
-
-
-
- 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.
-
-
- Some bitmap images are not converted to a standardized 24 bit RGB image but are
- instead handled in their native format.
-
-
- A plug-in mechanism offers a possibility to add support for new formats without changing
- the FOP's source code.
-
- The table below summarizes the theoretical support for graphical formats
- within FOP. In other words, within the constraints of the limitations listed here,
- these formats should work. However, many of them have not been tested,
- and there may be limitations that have not yet been discovered or documented.
- The packages needed to support some formats are not included in the FOP distribution
- and must be installed separately. Follow the links in the "Support Through" columns
- for more details.
-
"(X)" means restricted support. Please see the details below.
-
- [1]: Requires the presence of JAI Image I/O Tools
- (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.
-
-
-
- JAI Image I/O Tools is not the same as the
- JAI library! The
- former simply exposes JAI's codecs using the Image I/O API but does not include all
- the image manipulation functionality.
-
-
- Map of supported image formats by output format
-
- 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:
-
- XML Graphics Commons supports a number
- of graphic file formats natively as basic functionality: all bitmap formats for which
- there are Image I/O codecs available (JPEG, PNG, GIF, TIFF, etc.), EPS and EMF.
-
-
-
- FOP Native
-
- FOP has no native image plug-ins for the image loading framework of its own but currently
- hosts the Batik-dependent SVG and WMF plug-ins until they can be moved to
- Apache Batik.
-
-
-
- Apache Batik
-
- Apache Batik will later receive the
- SVG and WMF plug-ins for the image loading framework that are currently hosted inside
- FOP.
-
-
- Current FOP distributions include a distribution of the
- Apache Batik.
- Because Batik's API changes frequently, it is highly recommended that you use the
- version that ships with FOP, at least when running FOP.
-
- Batik must be run in a graphical environment.
-
- Batik must be run in a graphical environment.
- It uses AWT classes for rendering SVG, which in turn require an X server on Unixish
- systems. If you run a server without X, or if you can't connect to the X server due to
- security restrictions or policies (a so-called "headless" environment), SVG rendering
- will fail.
-
-
Here are some workarounds:
-
-
- Start Java with the -Djava.awt.headless=true command line option.
-
-
- Install an X server which provides an in-memory framebuffer without actually using a
- screen device or any display hardware. One example is Xvfb.
-
-
- Install a toolkit which emulates AWT without the need for an underlying X server. One
- example is the PJA toolkit, which is free
- and comes with detailed installation instructions.
-
-
-
-
- Image I/O
-
- The image loading framework in XML Graphics Commons
- provides a wrapper to load images through the
- JDK's Image I/O API (JSR 015).
- Image I/O allows to dynamically add additional image codecs. An example of such an
- add-on library are the
- JAI Image I/O Tools
- available from Sun.
-
-
-
-
- Details on image formats
-
- BMP
-
- BMP images are supported through an Image I/O codec. There may be limitations of the
- codec which are outside the control of Apache FOP.
-
-
-
- EMF
-
- Windows Enhanced Metafiles (EMF) are only supported in RTF output where they are
- embedded without decoding.
-
-
-
- EPS
-
Apache FOP allows to use EPS files when generating PostScript output only.
-
- Other output targets can't be supported at the moment because
- FOP lacks a PostScript interpreter. Furthermore, FOP is currently not able
- to parse the preview bitmaps sometimes contained in EPS files.
-
-
-
- GIF
-
- GIF images are supported through an Image I/O codec. Transparency is supported but
- not guaranteed to work with every output format.
-
-
-
- JPEG
-
- FOP native support (i.e. the handling of undecoded images) of JPEG does not include all
- variants, especially those containing unusual color lookup tables and color profiles.
- If you have trouble with a JPEG image in FOP, try opening it with an image processing
- program (such as Photoshop or Gimp) and then saving it. Specifying 24-bit color output
- may also help. For the PDF and PostScript renderers most JPEG images can be passed
- through without decompression. User reports indicate that grayscale, RGB, and
- CMYK color spaces are all rendered properly. However, for other output formats, the
- JPEG images have to be decompressed. Tests have shown that there are some limitation
- in some Image I/O codecs concerning images in the CMYK color space. Work-arounds are
- in place but may not always work as expected.
-
-
-
- PNG
-
- PNG images are supported through an Image I/O codec. Transparency is supported but
- not guaranteed to work with every output format.
-
-
-
- SVG
-
- Introduction
-
FOP uses Apache Batik for SVG support.
- This format can be handled as an fo:instream-foreign-object or in a separate
- file referenced with fo:external-graphic.
-
- Batik's SVG Rasterizer utility may also be used to convert standalone SVG
- documents into PDF. For more information please see the
- SVG Rasterizer documentation
- on the Batik site.
-
-
-
- Placing SVG Graphics into PDF
-
- The SVG is rendered into PDF by using PDF commands to draw and fill
- lines and curves. This means that the graphical objects created with
- this remain as vector graphics. The same applies to PostScript output.
- For other output formats the SVG graphic may be converted to a bitmap
- image.
-
-
- There are a number of SVG things that cannot be converted directly into
- PDF. Parts of the graphic such as effects, patterns and images are inserted
- into the PDF as a raster graphic. The resolution of these raster images can
- be controlled through the "target resolution" setting in the
- configuration.
-
- Currently transparency is limited in PDF so some SVG images that
- contain effects or graphics with transparent areas may not be displayed
- correctly.
-
-
-
- Placing SVG Text into PDF and PostScript
-
If possible, Batik will use normal PDF or PostScript text when inserting text. It does
- this by checking if the text can be drawn normally and the font is
- supported. This example svg text.svg /
- text.pdf / text.png
- shows how various types and effects with text are handled.
- Note that SVG font support is not yet implemented. Furthermore, text handling in
- PostScript output is inferior to PDF output - more text will be painted as shapes in
- PS than in PDF.
-
-
- When there's no support to paint text using native text operations,
- text is converted and drawn as a set of shapes by Batik, using the
- stroking text painter. This means that a typical character will
- have about 10 curves (each curve consists of at least 20 characters).
- This can make the output files large and when it is viewed the
- viewer may not normally draw those fine curves very well (In Adobe Acrobat, turning on
- "Smooth Line Art" in the preferences will fix this). Copy/paste functionality
- will not be supported in this case.
- If the text is inserted into the output file using the inbuilt text commands
- it will use a single character.
-
-
- Note that because SVG text can be rendered as either text or a vector graphic, you
- may need to consider settings in your viewer for both. The Acrobat viewer has both
- "smooth line art" and "smooth text" settings that may need to be set for SVG images
- to be displayed nicely on your screen (see Edit / Preferences / Display).
- This setting will not affect the printing of your document, which should be OK in
- any case, but will only affect the quality of the screen display.
-
-
-
- Font selection notes
-
- Apache Batik uses the AWT/Java2D subsystem as font source while FOP has its own font
- subsystem. Great care has been taken that font selection does the best possible choices.
- But it must be noted when creating PDF or PostScript that a font used in SVG graphics
- needs to be registered with the operating system as well as in FOP's configuration.
- By using FOP's font auto-detection, you simply have to install the font in the operating
- system and not care about anything else. This is less of an issue if you create
- formats like TIFFs, PNGs or PCL because in these cases SVG graphics are usually rendered
- to bitmaps which means that on both sides (Batik and FOP), AWT/Java2D is used as the
- single font source.
-
-
- Whenever an SVG is converted into a PDF or PostScript file, the font that has been used
- inside Batik has to be mapped to a font used by the actual output format. Features like
- font substitution in FOP may need to be taken into account but can also be an advantage
- when working around font mapping issues. Like for XSL-FO content, you'll get a warning
- if a particular font could not be found and had to be substituted, or if a particular
- glyph is missing in a font.
-
-
-
- Scaling
-
- Currently, SVG images are rendered with the dimensions specified in the SVG
- file, within the viewport specified in the fo:external-graphic element.
- For everything to work properly, the two should be equal. The SVG standard leaves
- this issue as an implementation detail. Additional scaling options are available
- through XSL-FO means.
-
-
- If you use pixels to specify the size of an SVG graphic the "source resolution" setting
- in the configuration will be used to determine the
- size of a pixel. The use of pixels to specify sizes is discouraged as they may
- be interpreted differently in different environments.
-
-
-
- Known Problems
-
-
- Soft mask transparency is combined with white so that it looks better
- on PDF 1.3 viewers but this causes the soft mask to be slightly lighter
- or darker on PDF 1.4 viewers.
-
-
- There is some problem with a gradient inside a pattern which may cause a PDF
- error when viewed in Acrobat 5.
-
-
- Text is not always handled correctly, it may select the wrong font
- especially if characters have multiple fonts in the font list.
-
-
- Uniform transparency for images and other SVG elements that are converted
- into a raster graphic are not drawn properly in PDF. The image is opaque.
-
-
-
-
-
- TIFF
-
- FOP can embed TIFF images without decompression into PDF, PostScript and AFP if they
- have either CCITT T.4, CCITT T.6, or JPEG compression. Otherwise, a TIFF-capable
- Image I/O codec is necessary for decoding the image.
-
-
- There may be some limitation concerning images in the CMYK color space.
-
-
-
- WMF
-
- Windows Metafiles (WMF) are supported through classes in
- Apache Batik. At the moment, support
- for this format is experimental and may not always work as expected.
-
-
-
-
- Graphics Resolution
-
- Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution
- values. FOP tries to use this resolution information whenever possible to determine
- the image's intrinsic size. This size is used during the layout process when it is not
- superseded by an explicit size on fo:external-graphic (content-width and content-height
- properties).
-
-
- Please note that not all images contain resolution information. If it's not available
- the source resolution set on the FopFactory (or through the user configuration XML) is used.
- The default here is 72 dpi.
-
-
- Bitmap images are generally embedded into the output format at their original resolution
- (as is). No resampling of the image is performed. Explicit resampling is on our wishlist,
- but hasn't been implemented, yet. Bitmaps included in SVG graphics may be resampled to
- the resolution specified in the "target resolution" setting in the
- configuration if SVG filters are applied. This can be
- used as a work-around to resample images in FO documents.
-
-
-
- Page selection for multi-page formats
-
- 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:
- <uri>#page=<nr>
- (for example: http://localhost/images/myimage.tiff#page=3)
-
-
-
- Image caching
-
- FOP caches images between runs. There is one cache per FopFactory instance. The URI is
- used as a key to identify images which means that when a particular URI appears again,
- the image is taken from the cache. If you have a servlet that generates a different
- image each time it is called with the same URI you need to use a constantly
- changing dummy parameter on the URI to avoid caching.
-
-
- The image cache has been improved considerably in the redesigned code. Therefore,
- resetting the image cache should be a thing of the past. If you
- still experience OutOfMemoryErrors, please notify us.
-
-
- If all else fails, the image cache can be cleared like this:
- fopFactory.getImageManager().getCache().clearCache();
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/hyphenation.xml b/src/documentation/content/xdocs/1.0/hyphenation.xml
deleted file mode 100644
index 1d1c63d82..000000000
--- a/src/documentation/content/xdocs/1.0/hyphenation.xml
+++ /dev/null
@@ -1,237 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Hyphenation
- $Revision$
-
-
-
- Hyphenation Support
-
- Introduction
-
Apache⢠FOP uses Liang's hyphenation algorithm, well known from TeX. It needs
- language specific pattern and other data for operation.
- If you have made improvements to an existing FOP hyphenation pattern,
- or if you have created one from scratch, please consider contributing these
- to OFFO so that they can benefit other FOP users as well.
- Please inquire on the FOP User
- mailing list.
-
-
- License Issues
-
Many of the hyphenation files distributed with TeX and its offspring are
- licenced under the LaTeX
- Project Public License (LPPL), which prevents them from being
- distributed with Apache software. The LPPL puts restrictions on file names
- in redistributed derived works which we feel can't guarantee. Some
- hyphenation pattern files have other or additional restrictions, for
- example against use for commercial purposes.
-
Although Apache FOP cannot redistribute hyphenation pattern files that do
- not conform with its license scheme, that does not necessarily prevent users
- from using such hyphenation patterns with FOP. However, it does place on
- the user the responsibility for determining whether the user can rightly use
- such hyphenation patterns under the hyphenation pattern license.
- The user is responsible to settle license issues for hyphenation
- pattern files that are obtained from non-Apache sources.
-
-
- Sources of Custom Hyphenation Pattern Files
-
The most important source of hyphenation pattern files is the
- CTAN TeX
- Archive.
-
-
- Installing Custom Hyphenation Patterns
-
To install a custom hyphenation pattern for use with FOP:
-
-
Convert the TeX hyphenation pattern file to the FOP format. The FOP
- format is an xml file conforming to the DTD found at
- {fop-dir}/hyph/hyphenation.dtd.
-
Name this new file following this schema:
- languageCode_countryCode.xml. The country code is
- optional, and should be used only if needed. For example:
-
-
en_US.xml would be the file name for American
- English hyphenation patterns.
-
it.xml would be the file name for Italian
- hyphenation patterns.
-
- The language and country codes must match the XSL-FO input, which
- follows ISO
- 639 (languages) and ISO
- 3166 (countries). NOTE: The ISO 639/ISO 3166 convention is that
- language names are written in lower case, while country codes are written
- in upper case. FOP does not check whether the language and country specified
- in the FO source are actually from the current standard, but it relies
- on it being two letter strings in a few places. So you can make up your
- own codes for custom hyphenation patterns, but they should be two
- letter strings too (patches for proper handling extensions are welcome)
-
There are basically three ways to make the FOP-compatible hyphenation pattern
- file(s) accessible to FOP:
-
-
Download the precompiled JAR from OFFO
- and place it either in the {fop-dir}/lib directory, or
- in a directory of your choice (and append the full path to the JAR to
- the environment variable FOP_HYPHENATION_PATH).
-
Download the desired FOP-compatible hyphenation pattern file(s) from
- OFFO,
- and/or take your self created hyphenation pattern file(s),
-
-
place them in the directory {fop-dir}/hyph,
-
or place them in a directory of your choice and set the Ant variable
- user.hyph.dir to point to that directory (in
- build-local.properties),
-
- and run Ant with build target
- jar-hyphenation. This will create a JAR containing the
- compiled patterns in {fop-dir}/build that will be added to the
- classpath on the next run.
- (When FOP is built from scratch, and there are pattern source file(s)
- present in the directory pointed to by the
- user.hyph.dir variable, this JAR will automatically
- be created from the supplied pattern(s)).
-
Put the pattern source file(s) into a directory of your choice and
- configure FOP to look for custom patterns in this directory, by setting the
- <hyphenation-base>
- configuration option.
-
-
-
-
- Either of these three options will ensure hyphenation is working when using
- FOP from the command-line. If FOP is being embedded, remember to add the location(s)
- of the hyphenation JAR(s) to the CLASSPATH (option 1 and 2) or to set the
- <hyphenation-dir>
- configuration option programmatically (option 3).
-
-
-
-
- Hyphenation Patterns
-
If you would like to build your own hyphenation pattern files, or modify
- existing ones, this section will help you understand how to do so. Even
- when creating a pattern file from scratch, it may be beneficial to start
- with an existing file and modify it. See
- OFFO's Hyphenation page for examples.
- Here is a brief explanation of the contents of FOP's hyphenation patterns:
- The remaining content of this section should be considered "draft"
- quality. It was drafted from theoretical literature, and has not been
- tested against actual FOP behavior. It may contain errors or omissions.
- Do not rely on these instructions without testing everything stated here.
- If you use these instructions, please provide feedback on the
- FOP User mailing list, either
- confirming their accuracy, or raising specific problems that we can
- address.
-
-
The root of the pattern file is the <hyphenation-info> element.
-
<hyphen-char>: its attribute "value" contains the character signalling
- a hyphen in the <exceptions> section. It has nothing to do with the
- hyphenation character used in FOP, use the XSLFO hyphenation-character
- property for defining the hyphenation character there. At some points
- a dash U+002D is hardwired in the code, so you'd better use this too
- (patches to rectify the situation are welcome). There is no default,
- if you declare exceptions with hyphenations, you must declare the
- hyphen-char too.
-
<hyphen-min> contains two attributes:
-
-
before: the minimum number of characters in a word allowed to exist
- on a line immediately preceding a hyphenated word-break.
-
after: the minimum number of characters in a word allowed to exist
- on a line immediately after a hyphenated word-break.
-
- This element is unused and not even read. It should be considered a
- documentation for parameters used during pattern generation.
-
-
<classes> contains whitespace-separated character sets. The members
- of each set should be treated as equivalent for purposes of hyphenation,
- usually upper and lower case of the same character. The first character
- of the set is the canonical character, the patterns and exceptions
- should only contain these canonical representation characters (except
- digits for weight, the period (.) as word delimiter in the patterns and
- the hyphen char in exceptions, of course).
-
<exceptions> contains whitespace-separated words, each of which
- has either explicit hyphen characters to denote acceptable breakage
- points, or no hyphen characters, to indicate that this word should
- never be hyphenated, or contain explicit <hyp> elements for specifying
- changes of spelling due to hyphenation (like backen -> bak-ken or
- Stoffarbe -> Stoff-farbe in the old german spelling). Exceptions override
- the patterns described below. Explicit <hyp> declarations don't work
- yet (patches welcome). Exceptions are generally a bit brittle, test
- carefully.
-
<patterns> includes whitespace-separated patterns, which are what
- drive most hyphenation decisions. The characters in these patterns are
- explained as follows:
-
-
non-numeric characters represent characters in a sub-word to be
- evaluated
-
the period character (.) represents a word boundary, i.e. either
- the beginning or ending of a word
-
numeric characters represent a scoring system for indicating the
- acceptability of a hyphen in this location. Odd numbers represent an
- acceptable location for a hyphen, with higher values overriding lower
- inhibiting values. Even numbers indicate an unacceptable location, with
- higher values overriding lower values indicating an acceptable position.
- A value of zero (inhibiting) is implied when there is no number present.
- Generally patterns are constructed so that valuse greater than 4 are rare.
- Due to a bug currently patterns with values of 8 and greater don't
- have an effect, so don't wonder.
-
- Here are some examples from the English patterns file:
-
-
Knuth (The TeXBook, Appendix H) uses the example hach4, which indicates that it is extremely undesirable to place a hyphen after the substring "hach", for example in the word "toothach-es".
-
.leg5e indicates that "leg-e", when it occurs at the beginning of a word, is a very good place to place a hyphen, if one is needed. Words like "leg-end" and "leg-er-de-main" fit this pattern.
-
- Note that the algorithm that uses this data searches for each of the word's substrings in the patterns, and chooses the highest value found for letter combination.
-
-
-
If you want to convert a TeX hyphenation pattern file, you have to undo
- the TeX encoding for non-ASCII text. FOP uses Unicode, and the patterns
- must be proper Unicode too. You should be aware of the XML encoding issues,
- preferably use a good Unicode editor.
-
Note that FOP does not do Unicode character normalization. If you use
- combining chars for accents and other character decorations, you must
- declare character classes for them, and use the same sequence of base character
- and combining marks in the XSLFO source, otherwise the pattern wouldn't match.
- Fortunately, Unicode provides precomposed characters for all important cases
- in common languages, until now nobody run seriously into this issue. Some dead
- languages and dialects, especially ancient ones, may pose a real problem
- though.
-
If you want to generate your own patterns, an open-source utility called
- patgen is available on many Unix/Linux distributions and every TeX
- distribution which can be used to assist in
- creating pattern files from dictionaries. Pattern creation for languages like
- english or german is an art. If you can, read Frank Liang's original paper
- "Word Hy-phen-a-tion by Com-pu-ter" (yes, with hyphens). It is not available
- online. The original patgen.web source, included in the TeX source distributions,
- contains valuable comments, unfortunately technical details obscure often the
- high level issues. Another important source is
- The
- TeX Book, appendix H (either read the TeX source, or run it through
- TeX to typeset it). Secondary articles, for example the works by Petr Sojka,
- may also give some much needed insight into problems arising in automated
- hyphenation.
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/index.xml b/src/documentation/content/xdocs/1.0/index.xml
deleted file mode 100644
index d05299d1e..000000000
--- a/src/documentation/content/xdocs/1.0/index.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP Version 1.0
- $Revision$
-
-
-
- Introduction
-
- The Apache⢠FOP team is proud to present to you this production
- quality codebase. FOP 1.0 provides a good subset of the W3C
- XSL-FO 1.0 and 1.1 Standards. Its stable, 1.0 designation
- provides added recognition as the productive tool it has been
- for years.
-
-
- We remain committed to improving the tool, and we continue to
- add new features. We welcome any feedback you might have and
- even more, any other form of help to get the project forward.
-
-
- This release contains many bug fixes and new features compared
- to the previous version. To see what has changed since the last release, please visit the
- Changes Page and the
- Release Notes.
-
-
- This release implements a good subset of the W3C XSL-FO 1.0
- and 1.1 Standards. For a detailed overview of FOP's
- compliance, visit the compliance
- page.
-
-
-
- Upgrading from an earlier version
-
- If you're upgrading to this version from an earlier version of FOP, please read the
- information contained on the Upgrading page!
-
-
-
- Download
-
- To download this version, please visit the download page.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/intermediate.xml b/src/documentation/content/xdocs/1.0/intermediate.xml
deleted file mode 100644
index a154ce733..000000000
--- a/src/documentation/content/xdocs/1.0/intermediate.xml
+++ /dev/null
@@ -1,331 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Intermediate Format
- $Revision$
-
-
-
- Please note that the intermediate formats described here are
- advanced features and can be ignored by most users of Apache⢠FOP.
-
-
- Introduction
-
- 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
- XSL-FO specification in chapter 1.1.2.
- 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).
-
-
- 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.
-
-
- 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.
-
-
-
- Which Intermediate Format to choose?
-
- 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:
-
-
- Area Tree XML (AT XML)
-
-
1:1 representation of FOP's area tree in XML.
-
Contains more structure information than the new intermediate format.
-
Used in FOP's layout engine test suite for regression testing.
-
-
-
- Intermediate Format (IF)
-
-
Highly optimized for speed.
-
Smaller XML files.
-
Easier to post-process.
-
XML Schema is available.
-
- Recommended for use cases where documents are formatted concurrently and later
- concatenated to a single print job.
-
-
-
-
- More technical information about the two formats can be found on the
- FOP Wiki.
-
-
-
- Architectural Overview
-
-
-
- Usage of the Area Tree XML format (AT XML)
-
- As already mentioned, the area tree XML format is generated by using the
- XMLRenderer (MIME type: application/X-fop-areatree).
- So, you basically set the right MIME type for the output format and process your FO files
- as if you would create a PDF file.
-
-
- However, there is an important detail to consider: The
- various Renderers don't all use the same font sources. To be able to create the right
- area tree for the ultimate output 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.
-
-
- The second step is to reparse the file using the AreaTreeParser 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
- examples/embedding
- directory in the FOP distribution.
-
-
- The basic pattern to parse the area tree XML format looks like this:
-
-
-
- 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
- endDocument() on the AreaTreeModel. This lets the Renderer know that the processing
- is now finished.
-
-
- The area tree XML format can also be used from the command-line
- by using the "-atin" parameter for specifying the area tree XML as input file. You can also
- specify a "mimic renderer" by inserting a MIME type between "-at" and the output file.
-
-
- Concatenating Documents
-
- This initial example is obviously not very useful. It would be faster to create the PDF file
- directly. As the ExampleConcat.java
- example shows you can easily parse multiple 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.
-
-
-
- Modifying Documents
-
- 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.
-
-
- The area tree XML format is sensitive to changes in whitespace. If you're not careful,
- the modified file may not render correctly.
-
-
-
- Advanced Use
-
- 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 setTransformerHandler() on
- XMLRenderer to give the XMLRenderer your own TransformerHandler instance in case you would like to
- do custom serialization (to a W3C DOM, for example) and/or to directly modify the area tree using
- XSLT. The AreaTreeParser on the other side allows you to retrieve a ContentHandler instance where
- you can manually send SAX events to to start the parsing process (see getContentHandler()).
-
-
-
-
- Usage of the Intermediate Format (IF)
-
- The Intermediate Format (IF) is generated by the IFSerializer
- (MIME type: application/X-fop-intermediate-format).
- 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.
-
-
- The IFSerializer is an implementation of the IFDocumentHandler and
- IFPainter interfaces. The IFRenderer class is responsible
- for converting FOP's area tree into calls against these two interfaces.
-
-
-
- IFDocumentHandler: This interface is used on the document-level and defines the
- overall structure of the Intermediate Format.
-
-
- IFPainter: This interface is used to generate graphical page content like text, images
- and borders.
-
-
-
- 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.
-
-
- The second step is to reparse the file using the IFParser 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
- examples/embedding
- directory in the FOP distribution.
-
-
- The basic pattern to parse the intermediate format looks like this:
-
-
-
- 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.
-
-
- Concatenating Documents
-
- This initial example is obviously not very useful. It would be faster to create the PDF file
- directly (without the intermediate step). As the
- ExampleConcat.java
- 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.
-
-
-
- Modifying Documents
-
- 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.
-
- 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.
-
-
-
- Advanced Use
-
- 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 getContentHandler()).
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/known-issues.xml b/src/documentation/content/xdocs/1.0/known-issues.xml
deleted file mode 100644
index 2ef4b7102..000000000
--- a/src/documentation/content/xdocs/1.0/known-issues.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
- MIF and SVG output support have not been restored, yet.
-
-
- 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.
-
-
- Auto table layout is not implemented, yet.
-
-
- Footnotes may overlap with text of the region-body in multi-column
- documents.
-
-
- Space resolution does not work between footnote regions.
-
-
- There's a problem involving nested block-containers and
- reference-orientation 180/-180 (Bugzilla #36391)
-
-
- block-containers with no height currently don't create a fence for
- spaces as they should (they behave like a normal block).
-
-
- Preserved linefeeds in fo:character are not handled correctly.
-
-
- An empty block currently produces a fence for stacking constraints
- which it shouldn't.
-
-
- There are several small problems around white space handling.
-
-
- Images currently don't shrink so they fit on a page when they are
- too big and shrinking is allowed to happen.
-
-
- inline-container may not work as expected.
-
-
- letter-spacing and word-spacing properties may not work as expected.
-
-
- leaders with leader-pattern="use-content" may not work as expected.
-
-
- keep-with-previous doesn't work inside tables and lists, yet.
-
-
- 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.
-
-
- background-images on page-number-citations are not placed correctly.
-
-
- Not all FO elements can be referenced by their "id", most notably:
- table-body, table-header, table-footer and table-row.
-
-
- Border and padding conditionality are not supported on table-cells, yet.
-
-
- Column balancing in multi-column documents may not work as expected
- (Bugzilla #36356)
-
-
diff --git a/src/documentation/content/xdocs/1.0/knownissues_overview.xml b/src/documentation/content/xdocs/1.0/knownissues_overview.xml
deleted file mode 100644
index 8daa97490..000000000
--- a/src/documentation/content/xdocs/1.0/knownissues_overview.xml
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Known Issues
- $Revision$
-
-
-
- Known issues
-
- This page lists currently known issues in the current release.
-
-
-
- For additional information on known issues in Apache⢠FOP, please have a look at the following pages, too:
-
- Apache⢠FOP has an extensive automated testing infrastructure. Parts of this infrastructure are several
- sets of test cases. When a test case is listed in disabled-testcases.xml it is disabled in the JUnit
- tests during the normal build process. This indicates a problem in the current codebase. When a bug is
- fixed or a missing feature is added the entry for the relevant test case(s) are removed.
-
-
- FO Tree
-
- This section lists disabled test cases in the test suite for the FO tree tests, at the time
- of the release.
-
-
-
-
- Layout Engine
-
- This section lists disabled test cases in the test suite for the layout engine tests, at the
- time of the release.
-
-
-
-
- Other known issues
-
This section lists other known issues.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/layoutengine/disabled-testcases.xml b/src/documentation/content/xdocs/1.0/layoutengine/disabled-testcases.xml
deleted file mode 100644
index 1fb4f2926..000000000
--- a/src/documentation/content/xdocs/1.0/layoutengine/disabled-testcases.xml
+++ /dev/null
@@ -1,225 +0,0 @@
-
-
-
-
-
-
-
- External link around an SVG not properly sized
- basic-link_external-destination_2.xml
- The bpd trait of the inlineparent area for the basic-link
- is not sized correctly if it wraps an image that is higher than the
- nominal line.
-
-
- Auto-height block-containers produce fences
- block-container_space-before_space-after_3.xml
- Block-containers with no height currently don't
- create a fence for spaces as they should (they behave like a
- normal block).
-
-
- font-stretch NYI
- block_font-stretch.xml
- Font-stretch is not implemented, yet.
-
-
- Hyphenation with preserved linefeeds
- block_hyphenation_linefeed_preserve.xml
- When hyphenation is enabled and linefeeds are preserved,
- the text is output multiple times.
-
-
- linefeed-treatment
- block_linefeed-treatment.xml
- Preserved linefeeds in a fo:character are not handled
- correctly.
-
-
- white-space-treatment
- block_white-space-treatment_3.xml
- White space handling incorrectly stops at fo:inline
- boundaries when it comes to formatter generated line breaks.
-
-
- Empty blocks produce fences
- block_space-before_space-after_8.xml
- An empty block currently produces a fence for
- stacking constraints which it shouldn't.
-
-
- block white-space nbsp 2
- block_white-space_nbsp_2.xml
- The nbsp given as an fo:character is not adjustable and therefore
- the justification does not work in this case.
-
-
- block word-spacing
- block_word-spacing.xml
- Word-spacing may not work as expected.
-
-
- block word-spacing text-align justify
- block_word-spacing_text-align_justify.xml
- Word-spacing may not work as expected.
-
-
- external-graphic don't shrink
- external-graphic_oversized.xml
- Images currently don't shrink so they fit on a page
- when they are too big and shrinking is allowed to
- happen (min/opt/max).
-
-
- Test case with HTTP URL
- external-graphic_src_uri.xml
- Doesn't work behind a proxy which requires
- authorization.
-
-
- Space Resolution in foot note area
- footnote_space-resolution.xml
- Space resolution does not work between footnote
- regions.
-
-
- NPE for table inside an inline
- inline_block_nested_3.xml
- Placing a table as a child of an fo:inline produces a
- NullPointerException.
-
-
- inline-container is not implemented, yet.
- inline-container_block_nested.xml
- inline-container is not implemented, yet. Content of an
- inline-container will get swallowed. The test case contains no checks.
-
-
- inline-container is not implemented, yet.
- inline-container_border_padding.xml
- inline-container is not implemented, yet. Content of an
- inline-container will get swallowed.
-
-
- inline letter-spacing
- inline_letter-spacing.xml
- Letter-spacing may not work as
- expected within fo:inline.
-
-
- inline word-spacing
- inline_word-spacing.xml
- Word-spacing may not work as expected within
- fo:inline.
-
-
- inline word-spacing text-align justify
- inline_word-spacing_text-align_justify.xml
-
-
-
- leader-alignment NYI
- leader-alignment.xml
- Leader-alignment is not yet
- implemented.
-
-
- leader-pattern="use-content": Problem with line height
- leader_leader-pattern_use-content_bug.xml
- Line height is not correctly calculated for
- use-content leaders whose height is larger than the rest of the
- line.
- http://www.nabble.com/leaders-with-leader-pattern%3D%22use-content%22-t546244.html
-
-
- Page breaking doesn't deal with IPD changes
- page-breaking_4.xml
- Page breaking currently doesn't support changing available IPD
- between pages of a single page-sequence. Element list generation has to be reset to
- redetermine line breaks in this case.
-
-
- Overflow handing is incomplete
- page-breaking_6.xml
- Line breaking is not 100% correct when there's too little space.
- Overflows are not detected and warned.
-
-
- Indefinite page height handling is imcomplete
- page-height_indefinite_simple.xml
- A RuntimeException is thrown for a page of indefinite height. Lots of warnings.
-
-
- page-number-citation: Problem with background-image
- page-number-citation_background-image.xml
- Background-images on page-number-citations are not
- placed correctly.
-
-
- IDs are not working on all FO elements
- page-number-citation_complex_1.xml
- The "id" attributes are not properly handled for all block-level FO elements.
-
-
- IDs are not working on all FO elements
- page-number-citation_complex_2.xml
- The "id" attributes are not properly handled for all inline-level FO elements.
-
-
- Footnotes in multi-column documents
- region-body_column-count_footnote.xml
- Footnotes may overlap with text of the region-body in
- multi-column documents.
-
-
- Column Balancing problems
- region-body_column-count_balance_4col.xml
- Situation in a 4-column document where the column balancing doesn't work and even causes some
- content to disappear.
-
-
- Column Balancing problems
- region-body_column-count_bug36356.xml
- Column balancing doesn't work as expected.
-
-
- table-cell empty area with marker.xml
- table-cell_empty_area_with_marker.xml
- A table-cell producing an empty area does currently not add any markers to a page.
- See TODO entry in AreaAdditionUtil.
-
-
- Border conditionality on table
- table_border-width_conditionality.xml
- The code should be ok, but the test case uses shorthands and therefore
- is probably not expressing the indended outcome according to the spec. The test
- case should be revisited.
-
-
- Soft hyphen with normal hyphenation enabled
- block_shy_linebreaking_hyph.xml
- A soft hyphen should be a preferred as break compared to a
- normal hyphenation point but is not.
-
-
- Page-keep not respected in multi-column layout
- keep_within-page_multi-column_overflow.xml
- The block should cause overflow in the
- last column on the page, rather than be broken.
-
-
diff --git a/src/documentation/content/xdocs/1.0/metadata.xml b/src/documentation/content/xdocs/1.0/metadata.xml
deleted file mode 100644
index 795177583..000000000
--- a/src/documentation/content/xdocs/1.0/metadata.xml
+++ /dev/null
@@ -1,243 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Metadata
-
-
-
- Overview
-
- 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
- XMP (eXtensible Metadata Platform, specified by Adobe).
- 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.
-
-
-
- Embedding XMP in an XSL-FO document
-
- 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.
-
-
- Document-level metadata can be specified in the fo:declarations element.
- XMP specification recommends to use x:xmpmeta, rdf:RDF, and
- rdf:Description elements as shown in example below. Both
- x:xmpmeta and rdf:RDF elements are recognized as the top-level
- element introducing an XMP fragment (as per the XMP specification).
-
-
- Example
-
-
- fo:declarationsmust be declared after
- fo:layout-master-set and before the first page-sequence.
-
-
-
-
- Implementation in Apache FOP
-
- Currently, XMP support is only available for PDF output.
-
-
- 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.
-
-
- 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.
-
-
- The mapping between the Info and the Metadata object used by Apache FOP comes from
- the PDF/A-1 specification.
- For convenience, here's the mapping table:
-
-
-
-
Document information dictionary
-
XMP
-
-
-
Entry
-
PDF type
-
Property
-
XMP type
-
Category
-
-
-
Title
-
text string
-
dc:title
-
Text
-
External
-
-
-
Author
-
text string
-
dc:creator
-
seq Text
-
External
-
-
-
Subject
-
text string
-
dc:description["x-default"]
-
Text
-
External
-
-
-
Keywords
-
text string
-
pdf:Keywords
-
Text
-
External
-
-
-
Creator
-
text string
-
xmp:CreatorTool
-
Text
-
External
-
-
-
Producer
-
text string
-
pdf:Producer
-
Text
-
Internal
-
-
-
CreationDate
-
date
-
xmp:CreationDate
-
Date
-
Internal
-
-
-
ModDate
-
date
-
xmp:ModifyDate
-
Date
-
Internal
-
-
-
- "Internal" in the Category column means that the user should not set this value.
- It is set by the application.
-
-
- The "Subject" used to be mapped to dc:subject in the initial publication of
- PDF/A-1 (ISO 19005-1). In the
- Technical Corrigendum 1
- this was changed to map to dc:description["x-default"].
-
-
- Namespaces
-
- Metadata is made of property sets where each property set uses a different namespace URI.
-
-
- 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:
-
-
-
-
Set/Schema
-
Namespace Prefix
-
Namespace URI
-
-
-
Dublin Core
-
dc
-
http://purl.org/dc/elements/1.1/
-
-
-
XMP Basic
-
xmp
-
http://ns.adobe.com/xap/1.0/
-
-
-
Adobe PDF Schema
-
pdf
-
http://ns.adobe.com/pdf/1.3/
-
-
-
- Please refer to the XMP Specification
- for information on other metadata namespaces.
-
-
- 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.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/output.xml b/src/documentation/content/xdocs/1.0/output.xml
deleted file mode 100644
index 65f808ae8..000000000
--- a/src/documentation/content/xdocs/1.0/output.xml
+++ /dev/null
@@ -1,1265 +0,0 @@
-
-
-
-
-
-
-
- Apache⢠FOP Output Formats
- $Revision$
-
-
-
-
-
-
-
-
- Apache⢠FOP supports multiple output formats by using a different renderer for each format.
- The renderers do not all have the same set of capabilities, sometimes because of
- the output format itself, sometimes because some renderers get more development
- attention than others.
-
-
- General Information
-
- Fonts
-
- Most FOP renderers use a FOP-specific system for font registration.
- However, the Java2D/AWT and print renderers use the Java AWT package, which gets its
- font information from the operating system registration.
- This can result in several differences, including actually using different fonts,
- and having different font metrics for the same font.
- The net effect is that the layout of a given FO document can be quite different between
- renderers that do not use the same font information.
-
-
- 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.
-
-
- 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
- intermediate format. 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):
-
-
-
- Produce an IF file: fop -fo myfile.fo -at application/pdf myfile.at.xml
- 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.
-
-
Render to a PDF file: fop -atin myfile.at.xml -pdf myfile.pdf
-
Render to a Java2D-based renderer:
-
-
fop -atin myfile.at.xml -print
-
fop -atin myfile.at.xml -awt
-
fop -atin myfile.at.xml -tiff myfile.tiff
-
-
-
-
-
- Output to a Printer or Other Device
-
- The most obvious way to print your document is to use the FOP
- print renderer, which uses the Java2D API (AWT).
- However, you can also send output from the Postscript renderer directly to a Postscript
- device, or output from the PCL renderer directly to a PCL device.
-
-
- Here are Windows command-line examples for Postscript and PCL:
-
-
-
-
- Here is some Java code to accomplish the task in UNIX:
-
-
-
- Set the output MIME type to "application/x-pcl" (MimeConstants.MIME_PCL) and
- it happily sends the PCL to the UNIX printer queue.
-
-
-
-
- PDF
-
- PDF is the best supported output format. It is also the most accurate
- with text and layout. This creates a PDF document that is streamed out
- as each page is rendered. This means that the internal page index
- information is stored near the end of the document.
- The PDF version supported is 1.4. PDF versions are forwards/backwards
- compatible.
-
-
- Note that FOP does not currently support PDF/A-1a.
- Support for Tagged PDF, PDF/A-1b
- and PDF/X has recently been added, however.
-
-
- Fonts
-
- PDF has a set of fonts that are always available to all PDF viewers;
- to quote from the PDF Specification:
-
- "PDF prescribes a set of 14 standard fonts that can be used without prior
- definition.
- These include four faces each of three Latin text typefaces (Courier,
- Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf
- Dingbats). These fonts, or suitable substitute fonts with the same metrics, are
- guaranteed to be available in all PDF viewer applications."
-
-
-
- Post-processing
-
- FOP does not currently support several desirable PDF features: 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.
-
-
- Another popular post-processing tool is iText,
- which has tools for adding security features, document properties, watermarks, and many
- other features to PDF files.
-
-
- Caveat: iText may swallow PDF bookmarks. But
- Jens Stavnstrup tells us
- that this doesn't happen if you use iText's PDFStamper.
-
-
- Here is some sample code that uses iText to encrypt a FOP-generated PDF. (Note that FOP now
- supports PDF encryption. However the principles for using
- iText for other PDF features are similar.)
-
-
-
- Check the iText tutorial and documentation for setting access flags, password,
- encryption strength and other parameters.
-
-
-
- Watermarks
-
- In addition to the PDF Post-processing options, consider the following workarounds:
-
-
-
- Use a background image for the body region.
-
-
- (submitted by Trevor Campbell) Place an image in a
- region that overlaps the flowing text. For example, make
- region-before large enough to contain your image. Then include a
- block (if necessary, use an absolutely positioned block-container)
- containing the watermark image in the static-content for the
- region-before. Note that the image will be drawn on top of the
- normal content.
-
-
-
-
-
- PostScript
-
- The PostScript renderer has been brought up to a similar quality as the
- PDF renderer, but may still be missing certain features. It provides good
- support for most text and layout.
- Images and SVG are not fully supported, yet. Currently, the PostScript
- renderer generates PostScript Level 3 with most DSC comments. Actually,
- the only Level 3 features used are the FlateDecode and DCTDecode
- filter (the latter is used for 1:1 embedding of JPEG images), everything
- else is Level 2.
-
-
- Configuration
-
- The PostScript renderer configuration currently allows the following settings:
-
-
-
- The default value for the "auto-rotate-landscape" setting is "false". Setting it
- to "true" will automatically rotate landscape pages and will mark them as landscape.
-
-
- The default value for the "language-level" setting is "3". This setting specifies
- the PostScript language level which should be used by FOP. Set this to "2"
- only if you don't have a Level 3 capable interpreter.
-
-
- The default value for the "optimize-resources" setting is "false". Setting it
- to "true" will produce the PostScript file in two steps. A temporary file will be
- written first which will then be processed to add only the fonts which were really
- used and images are added to the stream only once as PostScript forms. This will
- reduce file size but can potentially increase the memory needed in the interpreter
- to process.
-
-
- 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.
-
-
- 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.
-
-
-
- Limitations
-
-
Images and SVG may not be displayed correctly. SVG support is far from being complete. No image transparency is available.
-
Only Type 1 fonts are supported.
-
Multibyte characters are not supported.
-
PPD support is still missing.
-
-
-
-
- PCL
-
- This format is for the Hewlett-Packard PCL printers and other printers
- supporting PCL. It should produce output as close to identical as possible
- to the printed output of the PDFRenderer within the limitations of the
- renderer, and output device.
-
-
- The output created by the PCLRenderer is generic PCL 5, HP GL/2 and PJL.
- This should allow any device fully supporting PCL 5 to be able to
- print the output generated by the PCLRenderer. PJL is used to control the
- print job and switch to the PCL language. PCL 5 is used for text, raster
- graphics and rectangular fill graphics. HP GL/2 is used for more complex
- painting operations. Certain painting operations are done off-screen and
- rendered to PCL as bitmaps because of limitations in PCL 5.
-
- Text or graphics outside the left or top of the printable area are not
- rendered properly. This is a limitation of PCL, not FOP. In general,
- things that should print to the left of the printable area are shifted
- to the right so that they start at the left edge of the printable area.
-
-
- The Helvetica and Times fonts are not well supported among PCL printers
- so Helvetica is mapped to Arial and Times is mapped to Times New. This
- is done in the PCLRenderer, no changes are required in the FO's. The
- metrics and appearance for Helvetica/Arial and Times/Times New are
- nearly identical, so this has not been a problem so far.
-
-
For the non-symbol fonts, the ISO 8859-1 symbol set is used (PCL set "0N").
-
- All fonts available to the Java2D subsystem are usable. The texts are
- painted as bitmap much like the Windows PCL drivers do.
-
-
Multibyte characters are not supported.
-
- At the moment, only monochrome output is supported. PCL5c color extensions
- will only be implemented on demand. Color and grayscale images are converted
- to monochrome bitmaps (1-bit). Dithering only occurs if the JAI image library
- is available.
-
-
- Images are scaled up to the next resolution level supported by PCL (75,
- 100, 150, 200, 300, 600 dpi). For color and grayscale images an even
- higher PCL resolution is selected to give the dithering algorithm a chance
- to improve the bitmap quality.
-
-
- Currently, there's no support for clipping and image transparency, largely
- because PCL 5 has certain limitations.
-
-
-
-
- Configuration
-
- The PCL renderer configuration currently allows the following settings:
-
-
-
- The default value for the "rendering" setting is "speed" which causes borders
- to be painted as plain rectangles. In this mode, no special borders (dotted,
- dashed etc.) are available. If you want support for all border modes, set the
- value to "quality" as indicated above. This will cause the borders to be painted
- as bitmaps.
-
-
- The default value for the "text-rendering" setting is "auto" which paints the
- base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D.
- If the mix of painting methods results in unwelcome output, you can set this
- to "bitmap" which causes all text to be rendered as bitmaps.
-
-
- 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".
-
-
- 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
- supported PCL resolution. Currently, only 300 and 600 dpi are supported which
- should be enough for most use cases. Note that this setting directly affects
- the size of the output file and the print quality.
-
-
-
- Extensions
-
The PCL Renderer supports some PCL specific extensions which can be embedded
- into the input FO document. To use the extensions the appropriate namespace must
- be declared in the fo:root element like this:
-
-
- Page Source (Tray selection)
-
- The page-source extension attribute on fo:simple-page-master allows to
- select the paper tray the sheet for a particular simple-page-master is
- to be taken from. Example:
-
-
-
- Note: the tray number is a positive integer and the value depends on
- the target printer. Not all PCL printers support the same paper trays.
- Usually,
- "1" is the default tray,
- "2" is the manual paper feed,
- "3" is the manual envelope feed,
- "4" is the "lower" tray and
- "7" is "auto-select".
- Consult the technical reference for your printer for all available values.
-
-
-
- Output Bin
-
- The output-bin extension attribute on fo:simple-page-master allows to
- select the output bin into which the printed output should be fed. Example:
-
-
-
- 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.
-
-
-
- Page Duplex Mode
-
- 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:
-
-
-
- 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.
-
-
-
-
-
- AFP
-
- 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).
-
-
- The mapping of XSL-FO elements to the major MO:DCA structures is as follows:
-
-
-
-
XSL-FO element
-
MO:DCA-P object
-
-
-
fo:root
-
Document
-
-
-
fo:page-sequence
-
Page Group
-
-
-
fo:simple-page-master
-
Page
-
-
-
- FOP creates exactly one Document per Printfile with an optional Resource Group at the
- beginning. FOP does not create document indices.
-
- Clipping of text and graphics is not supported.
-
-
- Only IBM outline and raster fonts and to a limited extend the original fonts built into FOP are supported.
- Support for TrueType fonts may be added later.
-
-
-
-
- Deployment in older environments
-
- 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.
-
-
-
- Configuration
-
- Fonts
-
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
- looks like:
-
-
There are 4 font configuration variants supported:
-
-
IBM Raster fonts
-
IBM Outline fonts
-
IBM CID-keyed (Type 0) fonts
-
FOP built-in Base14 fonts
-
-
A typical raster font configuration looks like:
-
-
An outline font configuration is simpler as the individual font size entries are not required.
- However, the characterset definition is now required within the afp-font element.
-
-
- 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).
-
-
- 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.
-
-
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.
-
-
-Note that the value of the encoding attribute in the example is the double-byte encoding 'UnicodeBigUnmarked' (UTF-16BE).
-
-
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 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.
-
-
- By default, all manually configured fonts are embedded, unless they are matched in the
- referenced-fonts section of the configuration file.
- However, the default fonts shown above will not be embedded.
-
-
-
- Output Resolution
-
By default the AFP Renderer creates output with a resolution of 240 dpi.
- This can be overridden by the <renderer-resolution/> configuration element. Example:
-
-
-
- Images
-
By default the AFP Renderer converts all images to 8 bit grey level.
- This can be overridden by the <images/> configuration element. Example:
-
-
This will put images as RGB images into the AFP output stream. The default setting is:
-
-
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.
-
-
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".
-
- Setting cmyk="true" on the images element will enable CMYK
- colors. This will only have an effect if the color mode is set to "color". Example:
-
-
-
- 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.
-
-
-
-
- Shading
-
- 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:
-
-
-
-
- Resource Group File
-
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 <resource-group-file/> configuration element. Example:
-
- Be careful when using this option not to overwrite existing resource files from previous rendering runs.
-
-
- Resource Level Defaults
-
- 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.
-
-
- It is possible to override these defaults, either per image (see the
- afp:resource-level
- extension attribute below) or by specifying different defaults in the configuration:
-
-
-
- "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.
-
-
-
-
- Extensions
-
The AFP Renderer supports some AFP specific extensions which can be embedded into the input
- fo document. To use the extensions the appropriate namespace must be declared in the fo:root element like this:
-
-
- Page Overlay (IPO) Extension
-
The include-page-overlay extension element allows to define on a per simple-page-master basis a page overlay resource. Example:
-
-
The mandatory name attribute must refer to an 8 character (space padded) resource name that
- 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.
-
-
- Page Segment (IPS) Extension
-
The include-page-segment extension element allows to define resource substitution for fo:external-graphics elements.
- Example:
-
-
The include-page-segment extension element can only occur within a simple-page-master.
- Multiple include-page-segment extension elements within a simple-page-master are allowed.
- The mandatory name attribute must refer to an 8 character
- (space padded) resource name that must be known in the AFP processing environment.
- The value of the mandatory src attribute is compared against the value of the src attribute in
- 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.
-
-
- 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.
-
-
-
- Tag Logical Element (TLE) Extension
-
The tag-logical-element extension element allows to injects TLEs into the AFP output stream. Example:
-
-
- 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.
-
-
-
- No Operation (NOP) Extension
-
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:
-
-
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.
-
-
-
- Invoke Medium Map (IMM) Extension
-
- The invoke-medium-map extension allows to generate IMM fields (Invoke Medium Map) in the
- generated AFP output. Example:
-
-
-
- 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.
-
-
-
- Form Maps/Defs
-
- Apache FOP supports embedding an external form map resource in the
- generated AFP output. This is done using the afp:include-form-map
- extension. An example:
-
-
-
- The afp:include-form-map is to be placed as a direct child of
- fo:declarations. The name is an AFP resource name
- (max. 8 characters) and the src attribute is the URI identifying the
- external form map resource. When such a form map is embedded, you can use the
- afp:invoke-medium-map extension (described above) to invoke any medium
- map included in the form map.
-
-
- 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.
-
-
-
-
- Foreign Attributes
-
- Resource
-
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 <fo:external-graphic/> and <instream-foreign-object/>.
- Example:
-
-
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 Resource Level Defaults
- above to see what is used if the resource-level attribute is not specified.
-
-
-
-
-
-
- RTF
-
- JFOR, an open source XSL-FO to RTF converter has been integrated into Apache FOP.
- This will create an RTF (rich text format) document that will
- attempt to contain as much information from the 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.
-
-
- The RTF output follows Microsoft's RTF specifications
- and produces best results on Microsoft Word.
-
- 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.
-
- These are some known restrictions compared to other supported output formats (not a complete list):
-
-
-
- Not supported/implemented:
-
-
break-before/after (supported by the RTF library but not tied into the RTFHandler)
-
fo:page-number-citation-last
-
keeps (supported by the RTF library but not tied into the RTFHandler)
-
region-start/end (RTF limitation)
-
multiple columns
-
-
-
Only a single page-master is supported
-
Not all variations of fo:leader are supported (RTF limitation)
-
percentages are not supported everywhere
-
-
-
- XML (Area Tree XML)
-
- This is primarily for testing and verification. The XML created is simply
- a representation of the internal area tree put into XML. We use that to verify
- the functionality of FOP's layout engine.
-
-
- The other use case of the Area Tree XML is as FOP's "intermediate format". More information
- on that can be found on the page dedicated to the Intermediate Format.
-
-
-
- Java2D/AWT
-
- The Java2DRenderer provides the basic functionality for all
- Java2D-based output formats (AWT viewer, direct print, PNG, TIFF).
-
-
- The AWT viewer shows a window with the pages displayed inside a
- Java graphic. It displays one page at a time.
- The fonts used for the formatting and viewing depend on the fonts
- available to your JRE.
-
-
-
- Print
-
- It is possible to directly print the document from the command line.
- This is done with the same code that renders to the Java2D/AWT renderer.
-
-
- Known issues
-
- 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.
-
-
-
-
- Bitmap (TIFF/PNG)
-
- It is possible to directly create bitmap images from the individual
- pages generated by the layout engine.
- This is done with the same code that renders to the Java2D/AWT renderer.
-
-
- Currently, two output formats are supported: PNG and TIFF. TIFF produces
- one file with multiple pages, while PNG output produces one file per
- page. Note: FOP can only produce multiple files (with PNG output) if
- you can set a java.io.File indicating the primary PNG file
- using the FOUserAgent.setOutputFile(File) method.
-
-
- The quality of the bitmap depends on the target resolution setting
- on the FOUserAgent and on further settings described below.
-
-
- Configuration
-
- The TIFF and PNG renderer configuration currently allows the following settings:
-
-
-
- The default value for the "color-mode" setting is "rgba" which
- is equivalent to a 24bit RGB image with an 8bit alpha channel for transparency.
- Valid values are:
-
-
-
rgba: RGB with alpha channel (24bit + 8bit = 32bit)
-
rgb: RGB (24bit)
-
gray: gray (8bit)
-
bi-level (or binary): bi-level (1bit)
-
-
- Please note that there is currently no dithering or error diffusion available for bi-level
- bitmap output.
-
-
- 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",
- no such background will be painted and you will get a transparent image if
- an alpha channel is available in the output format.
-
-
- The default value for the "background-color" setting is "white".
- The color specifies in which color the page background is painted. It will only be
- painted if "transparent-page-background" is not set to "true".
- All XSL-FO colors (including color functions) can be used.
-
-
- The default value for the "anti-aliasing" setting is "true".
- You can set this value to "false" to disable anti-aliasing and
- thus improve rendering speeds a bit at the loss of some image quality.
-
-
- The default value for the "rendering" setting is "true".
- You can set this value to "false" 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.
-
-
-
- TIFF-specific Configuration
-
- In addition to the above values the TIFF renderer configuration allows some additional
- settings:
-
-
-
- The default value for the "compression" setting is "PackBits" which
- which is a widely supported RLE compression scheme for TIFF. The set of compression
- names to be used here matches the set that the Image I/O API uses. Note that
- not all compression schemes may be available during runtime. This depends on the
- actual codecs being available. Here is a list of possible values:
-
-
-
NONE (no compression)
-
PackBits (RLE, run-length encoding)
-
JPEG
-
Deflate
-
LZW
-
ZLib
-
CCITT T.4 (Fax Group 3)
-
CCITT T.6 (Fax Group 4)
-
-
- This setting may override any setting made using the "color-mode". For example, if
- "CCITT T.6" is selected, the color mode is automatically forced to "bi-level" because
- this compression format only supports bi-level images.
-
-
- If you want to use CCITT compression, please make sure you've got
-
- Java Advanced Imaging Image I/O Tools
-
- in your classpath. The Sun JRE doesn't come with a TIFF codec built in, so it has to be
- added separately. The internal TIFF codec from XML Graphics Commons only supports PackBits,
- Deflate and JPEG compression for writing.
-
-
-
- Runtime Rendering Options
-
- 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:
-
-
-
-
-
- TXT
-
- The text renderer produces plain ASCII text output
- that attempts to match the output of the PDFRenderer as closely as
- possible. This was originally developed to accommodate an archive system
- that could only accept plain text files, and is primarily useful for getting
- a quick-and-dirty view of the document text. The renderer is very limited,
- so do not be surprised if it gives unsatisfactory results.
-
-
- The Text renderer works with a fixed size page buffer. The size of this
- buffer is controlled with the textCPI and textLPI public variables.
- The textCPI is the effective horizontal characters per inch to use.
- The textLPI is the vertical lines per inch to use. From these values
- and the page width and height the size of the buffer is calculated.
- The formatting objects to be rendered are then mapped to this grid.
- Graphic elements (lines, borders, etc) are assigned a lower priority
- than text, so text will overwrite any graphic element representations.
-
-
- Because FOP lays the text onto a grid during layout, there are frequently
- extra or missing spaces between characters and lines, which is generally
- unsatisfactory.
- Users have reported that the optimal settings to avoid such spacing problems are:
-
-
-
font-family="Courier"
-
font-size="7.3pt"
-
line-height="10.5pt"
-
-
-
- Output Formats in the Sandbox
-
- Due to the state of certain renderers we moved some of them to a "sandbox" area until
- they are ready for more serious use. The renderers and FOEventHandlers in the sandbox
- can be found under src/sandbox and are compiled into build/fop-sandbox.jar during the
- main build. The output formats in the sandbox are marked as such below.
-
-
- MIF
- The MIF handler is in the sandbox and not yet functional in FOP Trunk!!! Please help us ressurrect this feature.
-
- This format is the Maker Interchange Format which is used by
- Adobe Framemaker.
-
-
-
- SVG
- The SVG renderer is in the sandbox and may not work as expected in FOP Trunk!!! Please help us improve this feature.
-
- This format creates an SVG document that has links between the pages.
- This is primarily for slides and creating svg images of pages.
- Large documents will create SVG files that are far too large for
- an SVG viewer to handle. Since FO documents usually have text the
- SVG document will have a large number of text elements.
- The font information for the text is obtained from the JVM in the
- same way as for the AWT viewer. If the SVG is viewed on a
- system where the fonts are different, such as another platform,
- then the page may look wrong.
-
-
-
-
- Wish list
-
- Apache FOP is easily extensible and allows you to add new output formats to enhance FOP's functionality. There's a number of output formats
- which are on our wish list. We're looking for volunteers to help us implement them.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/pdfa.xml b/src/documentation/content/xdocs/1.0/pdfa.xml
deleted file mode 100644
index 0b8399121..000000000
--- a/src/documentation/content/xdocs/1.0/pdfa.xml
+++ /dev/null
@@ -1,168 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: PDF/A (ISO 19005)
- $Revision$
-
-
-
-
-
-
- Overview
-
- PDF/A is a standard which turns PDF into an "electronic document file
- format for long-term preservation". PDF/A-1 is the first part of the
- standard and is documented in
- ISO 19005-1:2005(E).
- Work on PDF/A-2 is in progress at
- AIIM.
-
-
- Design documentation on PDF/A can be found on FOP's Wiki on the
- PDFA1ConformanceNotes page.
-
-
-
- Implementation Status
-
- PDF/A-1b is implemented to the degree that FOP supports
- the creation of the elements described in ISO 19005-1.
-
-
- Tests have been performed against jHove and Adobe Acrobat 7.0.7 (Preflight function).
- FOP does not validate completely against Apago's PDF Appraiser. Reasons unknown due to
- lack of a full license to get a detailed error protocol.
-
-
- PDF/A-1a is based on PDF-A-1b and adds accessibility features
- (such as Tagged PDF). This format is available within the limitation described on
- the Accessibility page.
-
-
-
- Usage (command line)
-
- To activate PDF/A-1b from the command-line, specify "-pdfprofile PDF/A-1b"
- 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.
-
-
- PDF/A-1a is enabled by specifying "-pdfprofile PDF/A-1a".
-
-
-
- Usage (embedded)
-
- When FOP is embedded in another Java application you can set a special option
- on the renderer options in the user agent to activate the PDF/A-1b profile.
- Here's an example:
-
-
-
- If one of the validation rules of PDF/A is violated, an PDFConformanceException
- (descendant of RuntimeException) is thrown.
-
-
- For PDF/A-1a, just use the string "PDF/A-1a" instead of "PDF/A-1b".
-
-
-
- PDF/A in Action
-
- There are a number of things that must be looked after if you activate a PDF/A
- profile. If you receive a PDFConformanceException, have a look at the following
- list (not necessarily comprehensive):
-
-
-
- Make sure all (!) fonts are embedded. If you use base 14 fonts (like Helvetica)
- you need to obtain a license for them and embed them like any other font.
-
-
- Don't use PDF encryption. PDF/A doesn't allow it.
-
-
- Don't use CMYK images without an ICC color profile. PDF/A doesn't allow mixing
- color spaces and FOP currently only properly supports the sRGB color space. Please
- note that FOP embeds a standard sRGB ICC profile (sRGB IEC61966-2.1) as the
- primary output intent for the PDF if no other output intent has been specified
- in the configuration.
-
-
- Don't use non-RGB colors in SVG images. Same issue as with CMYK images.
-
-
- Don't use EPS graphics with fo:external-graphic. Embedding EPS graphics in PDF
- is deprecated since PDF 1.4 and prohibited by PDF/A.
-
-
- PDF is forced to version 1.4 if PDF/A-1 is activated.
-
-
- No filter must be specified explicitely for metadata objects. Metadata must be
- embedded in clear text so non-PDF-aware applications can extract the XMP metadata.
-
-
-
- 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 Accessibility page for details.
-
-
-
- PDF profile compatibility
-
- 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.
-
-
-
- Interoperability
-
- There has been some confusion about the namespace for the PDF/A indicator in the XMP
- metadata. At least three variants have been seen in the wild:
-
-
-
-
http://www.aiim.org/pdfa/ns/id.html
-
obsolete, from an early draft of ISO-19005-1, used by Adobe Acrobat 7.x
-
-
-
http://www.aiim.org/pdfa/ns/id
-
obsolete, found in the original ISO 19005-1:2005 document
-
-
-
http://www.aiim.org/pdfa/ns/id/
-
correct, found in the technical corrigendum 1 of ISO 19005-1:2005
-
-
-
- If you get an error validating a PDF/A file in Adobe Acrobat 7.x it doesn't mean that
- FOP did something wrong. It's Acrobat that is at fault. This is fixed in Adobe Acrobat 8.x
- which uses the correct namespace as described in the technical corrigendum 1.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/pdfencryption.xml b/src/documentation/content/xdocs/1.0/pdfencryption.xml
deleted file mode 100644
index 6b27d9857..000000000
--- a/src/documentation/content/xdocs/1.0/pdfencryption.xml
+++ /dev/null
@@ -1,228 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: PDF encryption.
- $Revision$
-
-
-
-
-
-
-
- Overview
-
- Apache⢠FOP supports encryption of PDF output, thanks to Patrick
- C. Lankswert. This feature is commonly used to prevent
- unauthorized viewing, printing, editing, copying text from the
- document and doing annotations. It is also possible to ask the
- user for a password in order to view the contents. Note that
- there already exist third party applications which can decrypt
- an encrypted PDF without effort and allow the aforementioned
- operations, therefore the degree of protection is limited.
-
-
- For further information about features and restrictions regarding PDF
- encryption, look at the documentation coming with Adobe Acrobat or the
- technical documentation on the Adobe web site.
-
-
-
- Usage (command line)
-
- Encryption is enabled by supplying any of the encryption related
- options.
-
-
- An owner password is set with the -o option. This
- password is actually used as encryption key. Many tools for
- PDF processing ask for this password to disregard any
- restriction imposed on the PDF document.
-
-
- If no owner password has been supplied but FOP was asked to apply some
- restrictions, a random password is used. In this case it is obviously
- impossiible to disregard restrictions in PDF processing tools.
-
-
- A user password, supplied with the -u option, will
- cause the PDF display software to ask the reader for this password in
- order to view the contents of the document. If no user password was
- supplied, viewing the content is not restricted.
-
-
- Further restrictions can be imposed by using the -noprint,
- -nocopy, -noedit and
- -noannotations options, which disable printing, copying
- text, editing in Adobe Acrobat and making annotations, respectively.
-
-
-
- Usage (embedded)
-
- When FOP is embedded in another Java application you need to set an
- options map on the renderer. These are the supported options:
-
-
-
-
Option
-
Description
-
Values
-
Default
-
-
-
ownerPassword
-
The owner password
-
String
-
-
-
-
userPassword
-
The user password
-
String
-
-
-
-
allowPrint
-
Allows/disallows printing of the PDF
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
allowCopyContent
-
Allows/disallows copy/paste of content
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
allowEditContent
-
Allows/disallows editing of content
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
allowEditAnnotations
-
Allows/disallows editing of annotations
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
- Encryption is enabled as soon as one of these options is set.
-
-
- An example to enable PDF encryption in Java code:
-
-
-
- The parameters for the constructor of PDFEncryptionParams are:
-
-
-
userPassword: String, may be null
-
ownerPassword: String, may be null
-
allowPrint: true if printing is allowed
-
allowCopyContent: true if copying content is allowed
-
allowEditContent: true if editing content is allowed
-
allowEditAnnotations: true if editing annotations is allowed
-
-
- Alternatively, you can set each value separately in the Map provided by
- FOUserAgent.getRendererOptions() by using the following keys:
-
-
-
user-password: String
-
owner-password: String
-
noprint: Boolean or "true"/"false"
-
nocopy: Boolean or "true"/"false"
-
noedit: Boolean or "true"/"false"
-
noannotations: Boolean or "true"/"false"
-
-
-
- Environment
-
- In order to use PDF encryption, FOP has to be compiled with
- cryptography support. Currently, only JCE
- is supported. JCE is part of JDK 1.4. For earlier JDKs, it can
- be installed separately. The build process automatically
- detects JCE presence and installs PDF encryption support if
- possible, otherwise a stub is compiled in.
-
-
- Cryptography support must also be present at run time. In particular, a
- provider for the RC4 cipher is needed. Unfortunately, the sample JCE
- provider in Sun's JDK 1.4 does not provide RC4. If you
- get a message saying
-
-
-
- then you don't have the needed infrastructure.
-
-
- There are several commercial and a few Open Source packages which
- provide RC4. A pure Java implementation is produced by The Legion of the Bouncy
- Castle. Mozilla
- JSS is an interface to a native implementation.
-
-
-
- Installing a crypto provider
-
- The pure Java implementation from Bouncy Castle is easy to
- install.
-
-
-
- Download the binary distribution for your JDK version.
-
-
- Unpack the distribution. Add the jar file to your classpath. A
- convenient way to use the jar on Linux is to simply drop it into the
- FOP lib directory, it will be automatically picked up by
- fop.sh.
-
-
- Open the java.security file and add
- security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider,
- preferably at the end of the block defining the other crypto
- providers. For JDK 1.4 this is detailed on Sun's web site.
-
-
-
- If you have any experience with Mozilla JSS or any other
- cryptography provider, please post it to the fop-user list.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/pdfx.xml b/src/documentation/content/xdocs/1.0/pdfx.xml
deleted file mode 100644
index 8eced022c..000000000
--- a/src/documentation/content/xdocs/1.0/pdfx.xml
+++ /dev/null
@@ -1,136 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: PDF/X (ISO 15930)
- $Revision$
-
-
-
-
-
-
- Overview
-
- Support for PDF/X is available beginning with Apache⢠FOP version 0.93.
- This feature is new and may not be 100% complete, yet. Feedback is welcome.
-
-
- PDF/X is a standard which faciliates prepress digital data exchange using PDF.
- Currently, only PDF/X-3:2003 is implemented out of the many different flavours of PDF/X
- profiles. PDF/X-3:2003 is documented in
- ISO 15930-6:2003(E).
- More info on PDF/X can be found on the
- PDF/X info site.
-
-
-
- Implementation Status
-
- PDF/X-3:2003 is implemented to the degree that FOP supports
- the creation of the elements described in ISO 15930-6.
-
-
- An important restriction of the current implementation is that all normal
- RGB colors specified in XSL-FO and SVG are left unchanged in the sRGB color
- space (XSL-FO and SVG both use sRGB as their default color space).
- There's no conversion to a CMYK color space. Although sRGB is a
- calibrated color space, its color space has a different size than a CMYK
- color space which makes the conversion a lossy conversion and can lead to
- unwanted results. Although the use of the calibrated sRGB has been promoted
- for years, print shops usually prefer to convert an sRGB PDF to CMYK prior
- to production. Until there's full CMYK support in FOP you will have to
- work closely with your print service provider to make sure you get the
- intended result.
-
-
- Tests have been performed against Adobe Acrobat 7.0.7 (Preflight function).
- Note that there are bugs in Adobe Acrobat which cause false alarms if both
- PDF/A-1b and PDF/X-3:2003 are activated at the same time.
-
-
-
- Usage (command line)
-
- To activate PDF/X-3:2003 from the command-line, specify "-pdfprofile PDF/X-3:2003"
- as a parameter. If there is a violation of one of the validation rules for
- PDF/X, an error message is presented and the processing stops.
-
-
-
- Usage (embedded)
-
- When FOP is embedded in another Java application you can set a special option
- on the renderer options in the user agent to activate the PDF/A-1b profile.
- Here's an example:
-
-
-
- If one of the validation rules of PDF/X is violated, an PDFConformanceException
- (descendant of RuntimeException) is thrown.
-
-
-
- PDF/X in Action
-
- There are a number of things that must be looked after if you activate a PDF/X
- profile. If you receive a PDFConformanceException, have a look at the following
- list (not necessarily comprehensive):
-
-
-
- Make sure all (!) fonts are embedded. If you use base 14 fonts (like Helvetica)
- you need to obtain a license for them and embed them like any other font.
-
-
- Don't use PDF encryption. PDF/X doesn't allow it.
-
-
- Don't use CMYK images without an ICC color profile. PDF/X doesn't allow mixing
- color spaces and FOP currently only properly supports the sRGB color space. However,
- you will need to specify an
- output device profile
- (usually a CMYK profile) in the configuration. sRGB won't work here since it's a
- display device profile, not an output device profile.
-
-
- Don't use non-RGB colors in SVG images. Same issue as with CMYK images.
-
-
- Don't use EPS graphics with fo:external-graphic. Embedding EPS graphics in PDF
- is deprecated since PDF 1.4 and prohibited by PDF/X-3:2003.
-
-
- PDF is forced to version 1.4 if PDF/X-3:2003 is activated.
-
-
-
-
- PDF profile compatibility
-
- The PDF profiles "PDF/X-3:2003" and "PDF/A-1b" are compatible and can both be
- activated at the same time.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/running.xml b/src/documentation/content/xdocs/1.0/running.xml
deleted file mode 100644
index aa0b9f9fc..000000000
--- a/src/documentation/content/xdocs/1.0/running.xml
+++ /dev/null
@@ -1,362 +0,0 @@
-
-
-
-
-
-
- Running Apache⢠FOP
- $Revision$
-
-
-
-
- System Requirements
-
The following software must be installed:
-
-
- Java 1.4.x or later Runtime Environment.
-
-
- 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.
-
-
-
-
- Apache⢠FOP. The FOP distribution 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:
-
The following software is optional, depending on your needs:
-
-
- Graphics libraries. Generally, FOP contains direct support for the most important
- bitmap image formats (including PNG, JPEG and GIF). See
- FOP: Graphics Formats for details.
-
In addition, the following system requirements apply:
-
-
- If you will be using FOP to process SVG, you must do so in a graphical environment.
- See FOP: Graphics (Batik) for details.
-
-
-
-
- Installation
-
- Instructions
-
- Basic FOP installation consists of first unzipping the .gz file that is the
- distribution medium, then unarchiving the resulting .tar file in a
- directory/folder that is convenient on your system. Please consult your operating system
- documentation or Zip application software documentation for instructions specific to your
- site.
-
-
-
- Problems
-
- Some Mac OSX users have experienced filename truncation problems using Stuffit to unzip
- and unarchive their distribution media. This is a legacy of older Mac operating systems,
- which had a 31-character pathname limit. Several Mac OSX users have recommended that
- Mac OSX users use the shell command tar -xzf instead.
-
-
-
-
- Starting FOP as a Standalone Application
-
- Using the fop script or batch file
-
- 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
- the path to use in this case is /Library/Java/Home. Caveat:
- We suspect that, as Apple releases new Java environments and as FOP upgrades the minimum
- Java requirements, the two will inevitably not match on some systems. Please see
- Java on Mac OSX FAQ for information as
- it becomes available.
-
-
-
- PDF encryption is only available if FOP was compiled with encryption support
- and if compatible encryption support is available at run time.
- Currently, only the JCE is supported. Check the Details.
-
-
-
- Writing your own script
-
FOP's entry point for your own scripts is the class
-org.apache.fop.cli.Main. The general pattern for the
- command line is: java -classpath <CLASSPATH>
- org.apache.fop.cli.Main <arguments>. 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.
-
-
-
- Running with java's -jar option
-
- As an alternative to the start scripts you can run java
- -jar path/to/build/fop.jar <arguments>, relying on
- FOP to build the classpath for running FOP dynamically, see below. If you use hyphenation,
- you must put fop-hyph.jar in the lib
- directory.
-
-
-
You can also run java -jar path/to/fop.jar
- <arguments>, relying on the Class-Path
- entry in the manifest file. This works if you put
- fop.jar and all jar files from the lib
- directory in a single directory. If you use hyphenation, you
- must also put fop-hyph.jar in that directory.
-
-
In both cases the arguments consist of the options and
- infile and outfile specifications as shown above for the
- standard scripts.
-
-
- FOP's dynamical classpath construction
-
-
If FOP is started without a proper classpath, it tries to
- add its dependencies dynamically. If the system property
- fop.home 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 build,
- then its parent directory becomes the base directory.
-
-
FOP expects to find fop.jar in the
- build subdirectory of the base directory, and
- adds it to the classpath. Subsequently FOP adds all
- jar files in the lib directory to the
- classpath. The lib directory is either the lib
- subdirectory of the base directory, or, if that does not
- exist, the base directory itself.
-
-
If the system property fop.optional.lib
- contains the name of a directory, then all jar
- files in that directory are also added to the classpath. See
- the methods getJARList and
- checkDependencies in
- org.apache.fop.cli.Main.
-
-
-
-
- Using Xalan to Check XSL-FO Input
-
- FOP sessions that use -xml and -xsl input instead of -fo input are actually
- controlling two distinct conversions: Tranforming XML to XSL-FO, then formatting
- the XSL-FO to PDF (or another FOP output format).
- Although FOP controls both of these processes, the first is included merely as
- a convenience and for performance reasons.
- Only the second is part of FOP's core processing.
- If a user has a problem running FOP, it is important to determine which of these
- two processes is causing the problem.
- If the problem is in the first process, the user's stylesheet is likely the cause.
- The FOP development team does not have resources to help with stylesheet issues,
- although we have included links to some useful
- Specifications and
- Books/Articles.
- If the problem is in the second process, FOP may have a bug or an unimplemented
- feature that does require attention from the FOP development team.
-
- The user is always responsible to provide correct XSL-FO code to FOP.
-
- In the case of using -xml and -xsl input, although the user is responsible for
- the XSL-FO code that is FOP's input, it is not visible to the user. To make the
- intermediate FO file visible, the FOP distribution includes the "-foout" option
- which causes FOP to run only the first (transformation) step, and write the
- results to a file. (See also the Xalan command-line below)
-
-
- When asking for help on the FOP mailing lists, never attach XML and
- XSL to illustrate the issue. Always run the XSLT step (-foout) and send the
- resulting XSL-FO file instead. Of course, be sure that the XSL-FO file is
- correct before sending it.
-
-
- The -foout option works the same way as if you would call the
- Xalan command-line:
-
- Note that there are some subtle differences between the FOP and Xalan command-lines.
-
-
-
- Memory Usage
-
- FOP can consume quite a bit of memory, even though this has been continually improved.
- This is partly inherent to the formatting process and partly caused by implementation choices.
- All FO processors currently on the market have memory problems with certain layouts.
-
-
- If you are running out of memory when using FOP, here are some ideas that may help:
-
-
-
- Increase memory available to the JVM. See
- the -Xmx option
- for more information.
-
- It is usually unwise to increase the memory allocated to the JVM beyond the amount of
- physical RAM, as this will generally cause significantly slower performance.
-
-
-
- Avoid forward references.
- Forward references are references to some later part of a document.
- Examples include page number citations which refer to pages which follow the citation,
- tables of contents at the beginning of a document, and page numbering schemes that
- include the total number of pages in the document
- ("page N of TOTAL").
- Forward references cause all subsequent pages to be held in memory until the reference
- can be resolved, i.e. until the page with the referenced element is encountered.
- Forward references may be required by the task, but if you are getting a memory
- overflow, at least consider the possibility of eliminating them.
- A table of contents could be replaced by PDF bookmarks instead or moved to the end of
- the document (reshuffle the paper could after printing).
-
-
- Avoid large images, especially if they are scaled down.
- If they need to be scaled, scale them in another application upstream from FOP.
- For many image formats, memory consumption is driven mainly by the size of the image
- file itself, not its dimensions (width*height), so increasing the compression rate
- may help.
-
-
- Use multiple page sequences.
- FOP starts rendering after the end of a page sequence is encountered.
- While the actual rendering is done page-by-page, some additional memory is
- freed after the page sequence has been rendered.
- This can be substantial if the page sequence contains lots of FO elements.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/servlets.xml b/src/documentation/content/xdocs/1.0/servlets.xml
deleted file mode 100644
index dd2df4351..000000000
--- a/src/documentation/content/xdocs/1.0/servlets.xml
+++ /dev/null
@@ -1,325 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Servlets
- How to use Apache⢠FOP in a Servlet
- $Revision$
-
-
-
- Overview
-
- This page discusses topic all around using Apache⢠FOP in a servlet environment.
-
-
-
- Example Servlets in the FOP distribution
-
- In the directory {fop-dir}/src/java/org/apache/fop/servlet, you'll find a working example
- of a FOP-enabled servlet.
-
-
- The servlet is automatically built when you build Apache FOP using the supplied Ant script. After building
- the servlet, drop fop.war into the webapps directory of Apache Tomcat (or any other web container). Then, you can use
- URLs like the following to generate PDF files:
-
The source code for the servlet can be found under {fop-dir}/src/java/org/apache/fop/servlet/FopServlet.java.
-
- This example servlet should not be used on a public web server connected to the Internet as it does not contain
- any measures to prevent Denial-of-Service-Attacks. It is provided as an example and as a starting point for
- your own servlet.
-
-
-
- Create your own Servlet
-
- This section assumes you are familiar with embedding FOP.
-
-
- A minimal Servlet
-
- Here is a minimal code snippet to demonstrate the basics:
-
-
-
- There are numerous problems with the code snippet above.
- Its purpose is only to demonstrate the basic concepts.
- See below for details.
-
-
-
- Adding XSL tranformation (XSLT)
-
- A common requirement is to transform an XML source to
- XSL-FO using an XSL transformation. It is recommended to use
- JAXP for this task. The following snippet shows the basic
- code:
-
-
-
- Buffering the generated PDF in a ByteArrayOutputStream is done to avoid potential
- problems with the Acrobat Reader Plug-in in Microsoft Internet Explorer.
-
-
- The Source instance used above is simply an
- example. If you have to read the XML from a string, supply
- a new StreamSource(new
- StringReader(xmlstring)). Constructing and reparsing
- an XML string is generally less desirable than using a
- SAXSource if you generate your XML. You can alternatively
- supply a DOMSource as well. You may also use dynamically
- generated XSL if you like.
-
-
- Because you have an explicit Transformer object, you can also use it to
- explicitely set parameters for the transformation run.
-
-
-
- Custom configuration
-
- You can easily set up your own FOUserAgent as demonstrated on the Embedding page.
-
-
-
- Improving performance
-
- There are several options to consider:
-
-
-
- Instead of java.io.ByteArrayOutputStream consider using the ByteArrayOutputStream
- implementation from the Jakarta Commons IO project which allocates less memory.
- The full class name is: org.apache.commons.io.output.ByteArrayOutputStream
-
-
- In certain cases it can help to write the generated PDF to a temporary file so
- you can quickly reuse the file. This is especially useful, if Internet Explorer
- calls the servlet multiple times with the same request or if you often generate
- equal PDFs.
-
-
-
- Accessing resources in your web application
-
- Often, you will want to use resources (stylesheets, images etc.) which are bundled with
- your web application. FOP provides a URIResolver implementation that lets you access
- files via the Servlet's ServletContext. The class is called
- org.apache.fop.servlet.ServletContextURIResolver.
-
-
- Here's how to set it up in your servlet. Instantiate a new instance in the servlet's
- init() method:
-
-
-
- The ServletContextURIResolver reacts on URIs beginning with "servlet-context:". If you
- want to access an image in a subdirectory of your web application, you could, for
- example, use: "servlet-context:/images/myimage.png". Don't forget the leading slash
- after the colon!
-
-
- Further down, you can use the URIResolver for various things:
-
-
-
- With the Transformer (JAXP/XSLT) so things like document() functions can resolver
- "servlet-context:" URIs.
-
-
- With the FopFactory so every resource FOP loads can be loaded using a "servlet-context:"
- URI.
-
-
- You can the ServletContextURIResolver yourself in your servlet code to access
- stylesheets or XML files bundled with your web application.
-
-
-
- Here are some example snippets:
-
-
-
-
-
- Notes on Microsoft Internet Explorer
-
- Some versions of Internet Explorer will not automatically show the PDF or call the servlet multiple times.
- These are well-known limitations of Internet Explorer and are not a problem of the servlet.
- However, Internet Explorer can still be used to download the PDF so that it can be viewed later.
- Here are some suggestions in this context:
-
-
-
- Use an URL ending in .pdf, like
- http://myserver/servlet/stuff.pdf. Yes, the servlet can
- be configured to handle this. If the URL has to contain parameters,
- try to have both the base URL as well as the last parameter end in
- .pdf, if necessary append a dummy parameter, like
- http://myserver/servlet/stuff.pdf?par1=a&par2=b&d=.pdf. The
- effect may depend on IEx version.
-
-
- Give IEx the opportunity to cache. In particular, ensure the
- server does not set any headers causing IEx not to cache the
- content. This may be a real problem if the document is sent
- over HTTPS, because most IEx installations will by default
- not cache any content retrieved over HTTPS.
- Setting the Expires header entry may help in
- this case: response.setDateHeader("Expires",
- System.currentTimeMillis() + cacheExpiringDuration *
- 1000); Consult your server manual and the
- relevant RFCs for further details on HTTP headers and
- caching.
-
-
- Cache in the server. It may help to include a parameter in
- the URL which has a timestamp as the value min order to
- decide whether a request is repeated. IEx is reported to
- retrieve a document up to three times, but never more often.
-
-
-
-
- Servlet Engines
-
- When using a servlet engine, there are potential CLASSPATH issues, and potential conflicts
- with existing XML/XSLT libraries. Servlet containers also often use their own classloaders
- for loading webapps, which can cause bugs and security problems.
-
-
- Tomcat
-
- Check Tomcat's documentation for detailed instructions about installing FOP and Cocoon.
- There are known bugs that must be addressed, particularly for Tomcat 4.0.3.
-
-
-
- WebSphere 3.5
-
- Put a copy of a working parser in some directory where WebSphere can access it.
- For example, if /usr/webapps/yourapp/servlets is the CLASSPATH for your servlets,
- copy the Xerces jar into it (any other directory would also be fine).
- Do not add the jar to the servlet CLASSPATH, but add it to the CLASSPATH of the
- application server which contains your web application.
- In the WebSphere administration console, click on the "environment" button in the
- "general" tab. In the "variable name" box, enter "CLASSPATH".
- In the "value" box, enter the correct path to the parser jar file
- (/usr/webapps/yourapp/servlets/Xerces.jar in our example here).
- Press "OK", then apply the change and restart the application server.
-
-
-
-
- Handling complex use cases
-
- Sometimes the requirements for a servlet get quite sophisticated: SQL data sources,
- multiple XSL transformations, merging of several datasources etc. In such a case
- consider using Apache Cocoon instead
- of a custom servlet to accomplish your goal.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.0/upgrading.xml b/src/documentation/content/xdocs/1.0/upgrading.xml
deleted file mode 100644
index a4092c758..000000000
--- a/src/documentation/content/xdocs/1.0/upgrading.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
-
-
-
-
- Upgrading from an Earlier Version of Apache⢠FOP
- $Revision$
-
-
-
- Important!
-
- If you're planning to upgrade to the latest Apache⢠FOP version there are a few very important
- things to consider:
-
-
-
- More than half of the codebase has been rewritten over the
- last three years. With version 0.93 the code has reached
- production level, and continues to improve with
- version 0.94.
-
-
- The API of FOP has changed considerably and is not
- backwards-compatible with versions 0.20.5 and
- 0.91beta. Version 0.92 introduced the new stable
- API.
-
-
- Since version 0.92 some deprecated methods which were part
- of the old API have been removed. If you upgrade from 0.91
- beta, you will need to adjust your Java code. Similarly if
- you upgrade from 0.92 and use deprecated methods.
-
-
- 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 conf/fop.xconf for
- an example configuration file. A XML Schema file can be found under
- src/foschema/fop-configuration.xsd.
-
-
- 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.
-
-
-
- The new code is much more strict about the interpretation of the XSL-FO 1.1 specification.
- Things that worked fine in version 0.20.5 might start to produce warnings or even errors
- now. FOP 0.20.5 contains many bugs which have been corrected in the new code.
-
-
- While FOP 0.20.5 allowed you to have empty fo:table-cell elements, the new code
- will complain about that (unless relaxed validation is enabled) because the specification
- demands at least one block-level element ((%block;)+, see
- XSL-FO 1.1, 6.7.10)
- inside an fo:table-cell element.
-
-
-
- Extensions and Renderers written for version 0.20.5 will not work with the new code! The new FOP
- extension for Barcode4J is available since
- January 2007.
-
-
- The SVG Renderer and the MIF Handler have not been resurrected, yet! They are currently non-functional
- and hope for someone to step up and reimplement them.
-
-
-
-
- What you need to know when you upgrade!
-
- When you use your existing FO files or XML/XSL files which work fine with FOP version
- 0.20.5 against this FOP version some things may not work as expected. The following
- list will hopefully help you to identify and correct those problems.
-
-
-
- Check the Compliance page for the feature causing
- trouble. It may contain the necessary information to understand and resolve the problem.
-
-
- Not all 0.20.5 output formats are supported. PDF and Postscript should be fully supported.
- See Output Targets for a more complete description.
-
-
- As stated above empty table cells <fo:table-cell></fo:table-cell>
- are not allowed by the specification. The same applies to empty static-content
- and block-container elements, for example.
-
-
- 0.20.5 is not XSL-FO compliant with respect to sizing images (external-graphic)
- or instream-foreign-object
- objects. If images or SVGs are sized differently in your outputs with the new FOP version
- check Bug 37136
- as it contains some hints on what to do. The file
-
- "examples/fo/basic/images.fo" has
- a number of good examples that show the new, more correct behaviour.
-
-
- The fox:outline extension is not implemented in this version anymore.
- It has been superseded by the new bookmark elements from XSL-FO 1.1.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1/accessibility.xml b/src/documentation/content/xdocs/1.1/accessibility.xml
deleted file mode 100644
index 412519d8b..000000000
--- a/src/documentation/content/xdocs/1.1/accessibility.xml
+++ /dev/null
@@ -1,167 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Accessibility
-
-
-
- Overview
-
- This page describes the
- accessibility
- features of Apache⢠FOP.
- Section 508 defines accessibility in the context
- of electronic documents for the USA but other countries have similar requirements.
-
-
- 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.
-
-
-
- Enabling accessibility
-
There are 3 ways to enable accessibility:
-
-
- Command line: The command line option -a turns on accessibility:
- fop -a -fo mydocument.fo -pdf mydocument.pdf
-
- 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.
-
- The processing of the logical structure is memory-hungry. You may need to adjust the
- Java heap size in order to process larger files.
-
-
- Changes to your XSL-FO input files
-
- 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:
-
-
-
Table cells must have a table row as their parent.
-
- Images must have an alternate text: use the fox:alt-text extension attribute
- (in the fox namespace) on
- fo:external-graphic and fo:instream-foreign-object to specify a
- short text describing the image.
-
-
- Ensure that the order of fo:block-container elements in a page corresponds to
- the reading order.
-
-
- Specify the natural language of the document using the language and country properties
- (or via the xml:lang shorthand property).
-
-
-
-
- Customized Tagging
-
The PDF Reference 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.
-
FOP provides a default mapping of Formatting Objects to elements from that standard set.
- For example, fo:page-sequence is mapped to âPartâ, fo:block is
- mapped to âPâ, fo:list-block to âLâ, etc.
-
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 role XSL-FO property:
-
-
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.
-
-
- Testing
-
- 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.
-
-
-
- Limitations
-
- Accessibility support in Apache FOP is relatively new, so there are certain
- limitations. Please help us identify and close any gaps.
-
-
-
- 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.
-
-
- It's currently not possible to specify the expanded form of an abbreviation or acronym.
-
-
- 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 fox:alt-text.
-
-
- The side regions (region-before, region-after etc.) are currently not specially
- identified. Screen readers may read their content at page changes.
-
-
-
-
- Related Links
-
- 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:
-
Required if a fileset is used to specify the files to render; optional for fofile. (Can alternatively specify the full path in the fofile value.)
-
-
-
force
-
Recreate target files, even if they are newer than their corresponding
- source files. Note: This attribute is available in post-0.20.5
- versions (0.20.x nightly build and 1.0dev) only; target files are
- always generated (i.e., force=true) in 0.20.5 release.
-
-
No, default is false
-
-
-
basedir
-
Base directory to resolve relative references (e.g., graphics files) within the
- FO document.
-
-
No, for single FO File entry, default is to use the location
- of that FO file.
-
-
-
-
relativebase
-
For fileset usage only. A value of true specifies using the location
- of each .fo file as the base directory for resolving relative file references located
- within that .fo file. A value of false specifies using the value of
- basedir for all files within the fileset, or just the current working directory
- if basedir is not specified.
-
-
No, default is false.
-
-
-
-
userconfig
-
User configuration file (same as the FOP "-c" command line option).
-
No
-
-
-
messagelevel
-
Logging level
- Possible values: error, warn, info, verbose, debug. Currently doesn't work in FOP Trunk!!!
-
No, defaults to verbose
-
-
-
logFiles
-
Controls whether the names of the files that are processed are logged
- (true) or not (false). Currently doesn't work in FOP Trunk!!!
-
No, default is true
-
-
-
throwexceptions
-
Controls whether or not an exception is thrown if an error occurs during rendering.
-
Default is true
-
-
-
-
Parameters specified as nested elements
-
-
Attribute
-
Description
-
Required
-
-
-
fileset
-
FileSets
- are used to specify multiple XSL-FO files to be rendered.
-
Yes, if no fofile attribute is supplied
-
-
-
-
- Examples
-
- The following example converts a single XSL-FO file to a PDF document:
-
-
-
-
- This example converts all XSL-FO files within an entire directory to PostScript:
-
-
-
- The following example transforms and converts a single XML and XSLT file to an AFP document:
-
-
-
- This example transforms and converts all XML files within an entire directory to PostScript:
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1/compiling.xml b/src/documentation/content/xdocs/1.1/compiling.xml
deleted file mode 100644
index 054f209b3..000000000
--- a/src/documentation/content/xdocs/1.1/compiling.xml
+++ /dev/null
@@ -1,147 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Building from Source Code
- $Revision$
-
-
-
- Do You Need To Build?
-
-
-
-
-
- Apache⢠FOP snapshots are either pre-compiled binary or source.
- If you are using a binary snapshot, it is already built and there is no need to build it again.
- If you got the source code from a repository snapshot or via Subversion you will need to build FOP.
- See the Download Instructions for information about where to obtain binary or repository snapshots, and whether a
- binary or source snapshot is best for your needs.
-
-
-
-
- Set Up Your Environment
-
- JDK
-
- Building FOP 1.1 requires a minimum Java Development Kit (JDK/SDK) of 1.5
- (A Java Runtime Environment is not sufficient).
-
-
-
- CLASSPATH
-
- There is generally no need to setup a classpath. All libraries needed to compile FOP are included
- in the source distribution and are referenced by the build script.
- You will only need to adjust the classpath if you build FOP in some other way. See the build
- script build.xml for details.
-
-
-
- JAVA_HOME
-
- The build script uses Apache Ant, a popular
- Java-based build tool, which usually requires that the environment variable JAVA_HOME point to
- your local JDK root directory. This is true even if you use JDK 1.4 or above, which normally
- does not need this setting.
-
-
-
- Apache Ant
-
- Apache Ant (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
- instructions to install Ant in the Ant manual on the web.
-
-
-
-
- Run the Build Script
-
- Change to the FOP root directory and build FOP by executing the build script (build.xml)
- using the "ant" command.
-
-
- The "ant" command is only available on your system if you've properly
- installed Apache Ant and added Ant's location to the PATH
- environment variable.
-
-
- The file build.xml in the FOP root directory is the blueprint that Ant uses for the build. It
- contains information for numerous build targets, many of which are building blocks to more
- useful target, and others which are primarily used by the FOP developers.
- You may benefit from looking through this file to learn more about the various build targets.
- To obtain a complete list of useful build targets:
-
-
-
The most useful targets are:
-
-
- package: Generates the JAR files (default). This is the normal build that
- produces a jar file usable for running FOP.
-
-
- clean : Cleans the build directory. This is useful for making sure that
- any build errors are cleaned up before starting a new build. It should not ordinarily be
- needed, but may be helpful if you are having problems with the build process itself.
-
-
- javadocs: Creates the FOP API documentation.
- A minimum JDK version of 1.4.2 is required for generating the javadocs.
-
-
-
To run the build:
-
-
For example to do a normal build for the "all" target (which is the default):
-
-
OR
-
-
To clean the build directory first:
-
-
- If you want to shorten the build time you can just call the "package" target which
- doesn't perform any automated tests during the build.
-
-
-
- Troubleshooting
-
If you have problems building FOP, please try the following:
-
-
Run the build with the target of "clean", then rerun the build.
-
Delete the build directory completely, then rerun the build.
-
- Make sure you do not have a non-FOP version of xerces.jar, xalan.jar, batik.jar,
- or another dependency product somewhere in your CLASSPATH.
-
-
- If the build still fails, see the Getting Help
- page for further help.
-
- When complex scripts features are enabled, additional information related to bidirectional
- level resolution, the association between characters and glyphs, and glyph position adjustments
- are added to the internal, parsed representation of the XSL-FO tree and its corresponding
- formatted area tree. This additional information will somewhat increase the memory requirements for
- processing documents that use these features.
-
- A document author need not make explicit use of any complex scripts feature in order
- for this additional information to be created. For example, if the author makes use of a font
- that contains OpenType GSUB and/or GPOS tables, then those tables will be automatically used
- unless complex scripts features are disabled.
-
-
- Changes to your XSL-FO input files
-
- In most circumstances, XSL-FO content does not need to change in order to make use of
- complex scripts features; however, in certain contexts, fully automatic processing is not
- sufficient. In these cases, an author may make use of the following XSL-FO constructs:
-
-
-
The script property.
-
The language property.
-
The writing-mode property.
-
The number to string conversion properties:
- format,
- grouping-separator,
- grouping-size,
- letter-value,
- and fox:number-conversion-features.
Explicit join control characters: U+200C ZWNJ and U+200D ZWJ.
-
-
-
- Authoring Details
-
The complex scripts related effects of the above enumerated XSL-FO constructs are more
- fully described in the following sub-sections.
-
- Script Property
-
In order to apply font specific complex script features, it is necessary to know
- the script that applies to the text undergoing layout processing. This script is determined
- using the following algorithm:
-
-
-
If the FO element that governs the text specifies a
- script
- property and its value is not the empty string or "auto", then that script is used.
-
Otherwise, the dominant script of the text is determined automatically by finding the
- script whose constituent characters appear most frequently in the text.
-
-
In case the automatic algorithm does not produce the desired results, an author may
- explicitly specify a script property with the desired script. If specified,
- it must be one of the four-letter script code specified in
- ISO 15924 Code List or
- in the Extended Script Codes table. Comparison
- of script codes is performed in a case-insensitive manner, so it does not matter what case
- is used when specifying these codes in an XSL-FO document.
-
- Standard Script Codes
-
The following table enumerates the standard ISO 15924 4-letter codes recognized by FOP.
-
-
-
Code
-
Script
-
-
-
arab
-
Arabic
-
-
-
beng
-
Bengali
-
-
-
bopo
-
Bopomofo
-
-
-
cyrl
-
Cyrillic
-
-
-
deva
-
Devanagari
-
-
-
ethi
-
Ethiopic
-
-
-
geor
-
Georgian
-
-
-
grek
-
Greek
-
-
-
gujr
-
Gujarati
-
-
-
guru
-
Gurmukhi
-
-
-
hang
-
Hangul
-
-
-
hani
-
Han
-
-
-
hebr
-
Hebrew
-
-
-
hira
-
Hiragana
-
-
-
kana
-
Katakana
-
-
-
knda
-
Kannada
-
-
-
khmr
-
Khmer
-
-
-
laoo
-
Lao
-
-
-
latn
-
Latin
-
-
-
mlym
-
Malayalam
-
-
-
mymr
-
Burmese
-
-
-
mong
-
Mongolian
-
-
-
orya
-
Oriya
-
-
-
sinh
-
Sinhalese
-
-
-
taml
-
Tamil
-
-
-
telu
-
Telugu
-
-
-
thai
-
Thai
-
-
-
tibt
-
Tibetan
-
-
-
zmth
-
Math
-
-
-
zsym
-
Symbol
-
-
-
zyyy
-
Undetermined
-
-
-
zzzz
-
Uncoded
-
-
-
-
- Extended Script Codes
-
The following table enumerates a number of non-standard extended script codes recognized by FOP.
-
-
-
-
-
-
-
-
Code
-
Script
-
Comments
-
-
-
bng2
-
Bengali
-
OpenType Indic Version 2 (May 2008 and following) behavior.
-
-
-
dev2
-
Devanagari
-
OpenType Indic Version 2 (May 2008 and following) behavior.
-
-
-
gur2
-
Gurmukhi
-
OpenType Indic Version 2 (May 2008 and following) behavior.
-
-
-
gjr2
-
Gujarati
-
OpenType Indic Version 2 (May 2008 and following) behavior.
-
-
-
knd2
-
Kannada
-
OpenType Indic Version 2 (May 2008 and following) behavior.
-
-
-
mlm2
-
Malayalam
-
OpenType Indic Version 2 (May 2008 and following) behavior.
-
-
-
ory2
-
Oriya
-
OpenType Indic Version 2 (May 2008 and following) behavior.
-
-
-
tml2
-
Tamil
-
OpenType Indic Version 2 (May 2008 and following) behavior.
-
-
-
tel2
-
Telugu
-
OpenType Indic Version 2 (May 2008 and following) behavior.
-
-
-
- Explicit use of one of the above extended script codes is not portable,
- and should be limited to use with FOP only.
-
-
- When performing automatic script determination, FOP selects the OpenType Indic
- Version 2 script codes by default. If the author requires Version 1 behavior, then
- an explicit, non-extension script code should be specified in a governing script
- property.
-
-
-
-
- Language Property
-
Certain fonts that support complex script features can make use of language information in order for
- language specific processing rules to be applied. For example, a font designed for the Arabic script may support
- typographic variations according to whether the written language is Arabic, Farsi (Persian), Sindhi, Urdu, or
- another language written with the Arabic script. In order to apply these language specific features, the author
- may explicitly mark the text with a language
- property.
-
When specifying the language property, the value of the property must be either an
- ISO639-2 3-letter code or an
- ISO639-1 2-letter code. Comparison of language
- codes is performed in a case-insensitive manner, so it does not matter what case is used when specifying these
- codes in an XSL-FO document.
-
-
- Writing Mode Property
-
The writing-mode property is used to determine the axes and direction of the inline
- progression direction, the block progression direction, the column progression direction (in tables
- and flows), the shift direction, region placement, the resolution of writing-mode relative property
- values (such as start, end, before, after), and the default block (paragraph) bidirectionality
- level.
-
-
The writing-mode property is inherited, so it can appear on any XSL-FO element type; however,
- it applies (semantically) only to the following element types:
-
-
-
fo:page-sequence
-
fo:simple-page-master
-
fo:region-*
-
fo:block-container
-
fo:inline-container
-
fo:table
-
-
If it is not specified on one of these element types, but is specified on an ancestor element, then the value specified on that
- ancestor element (the inherited value) is used; otherwise, the initial value lr-tb is used.
-
At present, only the following values of the writing-mode property are supported:
-
-
lr-tb
-
rl-tb
-
lr
-
rl
-
-
Writing modes that employ a vertical inline progression direction are not yet supported.
-
-
-
- Bidi Override Element
-
The fo:bidi-override
- element may be used to override default bidirectional processing behavior,
- including default embedding levels and default character directionality. In the absence of either this element
- or use of explicit Bidi Control Characters, the default behavior prescribed
- by the Unicode Bidirectional Algorithm
- applies.
-
-
-
- Bidi Control Characters
-
In addition to the use of the Bidi Override Element, an author
- may make use of the following explicit Unicode Bidi Control Characters:
-
-
U+200E - LEFT-TO-RIGHT MARK (LRM)
-
U+200F - RIGHT-TO-LEFT MARK (RLM)
-
U+202A - LEFT-TO-RIGHT EMBEDDING (LRE)
-
U+202B - RIGHT-TO-LEFT EMBEDDING (RLE)
-
U+202C - POP DIRECTIONAL FORMATTING (PDF)
-
U+202D - LEFT-TO-RIGHT OVERRIDE (LRO)
-
U+202E - RIGHT-TO-LEFT OVERRIDE (RLO)
-
-
If an embedding or override is not terminated (using U+202C PDF) prior to the end of a
- delimited text range,
- then it is automatically terminated by FOP.
-
-
-
- Join Control Characters
-
In order to prevent joining behavior in contexts where joining occurs by default,
- for example, between U+0628 ARABIC LETTER BEH and U+0646 ARABIC LETTER NOON,
- an author may used a U+200C ZERO WIDTH NON-JOINER (ZWNJ).
-
-
Conversely, in order to force joining behavior in contexts where joining does not occur by default,
- for example, between U+0628 ARABIC LETTER BEH and U+0020 SPACE, an author may used a U+200D ZERO WIDTH JOINER (ZWJ).
-
-
The behavior of ZWNJ and ZWJ is script specific. See
- The Unicode Standard, Chapter 8,
- Middle Eastern Scripts for information on the use of these control characters with the Arabic
- script. See
- The Unicode Standard, Chapter 9,
- South Asian Scripts - I for information on the use of these control characters with common
- Indic scripts.
-
-
-
-
- Supported Scripts
-
Support for specific complex scripts is enumerated in the following table. Support
- for those marked as not being supported is expected to be added in future revisions.
-
-
-
-
-
-
-
-
-
Script
-
Support
-
Tested
-
Comments
-
-
-
Arabic
-
full
-
full
-
-
-
-
Bengali
-
none
-
none
-
-
-
-
Burmese
-
none
-
none
-
-
-
-
Devanagari
-
partial
-
partial
-
join controls (ZWJ, ZWNJ) not yet supported
-
-
-
Khmer
-
none
-
none
-
-
-
-
Gujarati
-
partial
-
none
-
pre-alpha
-
-
-
Gurmukhi
-
partial
-
none
-
pre-alpha
-
-
-
Hebrew
-
full
-
partial
-
-
-
-
Kannada
-
none
-
none
-
-
-
-
Lao
-
none
-
none
-
-
-
-
Malayalam
-
none
-
none
-
-
-
-
Mongolian
-
none
-
none
-
-
-
-
Oriya
-
none
-
none
-
-
-
-
Tamil
-
none
-
none
-
-
-
-
Telugu
-
none
-
none
-
-
-
-
Tibetan
-
none
-
none
-
-
-
-
Thai
-
none
-
none
-
-
-
-
-
- Supported Fonts
-
Support for specific fonts is enumerated in the following sub-sections. If a given
- font is not listed, then it has not been tested with these complex scripts features.
-
- Arabic Fonts
-
-
-
-
-
-
-
-
-
Font
-
Version
-
Glyphs
-
Comments
-
-
-
Arial Unicode MS
-
1.01
-
50377
-
limited GPOS support
-
-
-
Lateef
-
1.0
-
1147
-
language features for Kurdish (KUR), Sindhi (SND), Urdu (URD)
-
-
-
Scheherazade
-
1.0
-
1197
-
language features for Kurdish (KUR), Sindhi (SND), Urdu (URD)
-
-
-
Simplified Arabic
-
1.01
-
-
contains invalid, out of order coverage table entries
-
-
-
Simplified Arabic
-
5.00
-
414
-
lacks GPOS support
-
-
-
Simplified Arabic
-
5.92
-
473
-
includes GPOS for advanced position adjustment
-
-
-
Traditional Arabic
-
1.01
-
530
-
lacks GPOS support
-
-
-
Traditional Arabic
-
5.00
-
530
-
lacks GPOS support
-
-
-
Traditional Arabic
-
5.92
-
589
-
includes GPOS for advanced position adjustment
-
-
-
-
- Devanagari Fonts
-
-
-
-
-
-
-
-
-
Font
-
Version
-
Glyphs
-
Comments
-
-
-
Aparajita
-
1.00
-
706
-
-
-
-
Kokila
-
1.00
-
706
-
-
-
-
Mangal
-
5.01
-
885
-
designed for use in user interfaces
-
-
-
Utsaah
-
1.00
-
706
-
-
-
-
-
-
- Other Limitations
-
- Complex scripts support in Apache FOP is relatively new, so there are certain
- limitations. Please help us identify and close any gaps.
-
-
-
Only the PDF output format fully supports complex scripts features at the present time.
-
Shaping context does not extend across an element boundary. This limitation prevents the use of
- fo:character, fo:inline or fo:wrapper in order to colorize
- individual Arabic letters without affecting shaping behavior across the element boundary.
-
-
-
- Related Links
-
- In addition to the XSL-FO specification, a number of external resources provide
- guidance about authoring documents that employ complex scripts and the features
- described above:
-
- The Apache⢠FOP configuration file is an XML file containing a variety of settings that are useful
- for controlling FOP's behavior, and for helping it find resources that you wish it to use.
-
-
- The easiest way to get started using a FOP configuration file is to copy the sample found
- at {fop-dir}/conf/fop.xconf to a location of your choice, and then to
- edit it according to your needs.
- It contains templates for the various configuration options, most of which are commented
- out. Remove the comments and change the settings for entries that you wish to use.
- Be sure to follow any instructions, including comments which specify the value range.
- Also, since the configuration file is XML, be sure to keep it well-formed.
-
-
- Making Configuration Available to FOP
-
After creating your configuration file, you must tell FOP how to find it:
-
-
- If running FOP from the command-line, see the "-c" command-line option in
- Running FOP.
-
-
-
-
- Summary of the General Configuration Options
-
-
-
Element
-
Data Type (for the value)
-
Description
-
Default Value
-
-
-
base
-
URL or directory
-
Specifies the base URL based on which relative URL will be resolved.
-
current directory
-
-
-
font-base
-
URL or directory
-
Specifies the base URL based on which relative font URLs will be resolved.
-
-
base URL/directory (above)
-
-
-
hyphenation-base
-
URL or directory
-
Specifies the base URL based on which relative URLs to hyphenation pattern
- files will be resolved. If not specified, support for user-supplied hyphenation
- patterns remains disabled.
-
-
disabled
-
-
-
Relative URIs for the above three properties are evaluated relative to the base URI of the configuration file. If the configuration is provided programmatically, the base URI can be set with FopFactory.setUserConfigBaseURI; default is the current working directory.
-
-
-
hyphenation-pattern
-
String, attribute lang, attribute country (optional)
-
Register a file name for the hyphenation pattern for the mentioned language and country. Language ll and country CC must both consist of two letters.
-
ll_CC
-
-
-
source-resolution
-
Integer, dpi
-
- Resolution in dpi (dots per inch) which is used internally to determine the pixel
- size for SVG images and bitmap images without resolution information.
-
-
72 dpi
-
-
-
target-resolution
-
Integer, dpi
-
- Resolution in dpi (dots per inch) used to specify the output resolution for bitmap
- images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps
- generated by Apache Batik for filter effects and such.
-
-
72 dpi
-
-
-
strict-configuration
-
Boolean (true, false)
-
- Setting this option to 'true' will cause FOP to strictly verify the contents of the
- FOP configuration file to ensure that defined resources (such as fonts and base
- URLs/directories) are valid and available to FOP. Any errors found will cause FOP to
- immediately raise an exception.
-
false
-
-
-
strict-validation
-
Boolean (true, false)
-
- Setting this option to 'false' causes FOP to be more forgiving about XSL-FO validity,
- for example, you're allowed to specify a border on a region-body which is supported
- by some FO implementations but is non-standard. Note that such a border would
- currently have no effect in Apache FOP.
-
true
-
-
-
break-indent-inheritance
-
Boolean (true, false)
-
- Setting this option to 'true' causes FOP to use an alternative rule set to determine
- text indents specified through margins, start-indent and end-indent. Many commercial
- FO implementations have chosen to break the XSL specification in this aspect. This
- option tries to mimic their behaviour. Please note that Apache FOP may still not
- behave exactly like those implementations either because FOP has not fully matched
- the desired behaviour and because the behaviour among the commercial implementations
- varies. The default for this option (i.e. false) is to behave exactly like the
- specification describes.
-
false
-
-
-
complex-scripts
-
attribute disabled (optional)
-
- If present and if an attribute 'disabled' is specified with the value 'false', then
- complex script features are disabled. The same result can be obtained on an FOP
- per-invocation basis by specifying a '-nocs' command line option when invoking FOP.
- When complex script features are disabled, all bidirectional processing and complex
- character to glyph mapping processing is disabled; in addition, the loading of
- GDEF, GSUB, and GPOS advanced typographic tables is disabled for OpenType and
- TrueType fonts. Unless disabled by this mechanism or by use of the '-nocs' command
- line option, complex script features will be enabled by default.
-
-
n/a
-
-
-
default-page-settings
-
n/a
-
- Specifies the default width and height of a page if "auto" is specified
- for either or both values. Use "height" and "width" attributes on the
- default-page-settings element to specify the two values.
-
"height" 11 inches, "width" 8.26 inches
-
-
-
-
use-cache
-
boolean (true, false)
-
All fonts information that has been gathered as a result of "directory"
- or "auto-detect" font configurations will be cached for future rendering runs.
- This setting should improve performance on systems where
- fonts have been configured using the "directory" or "auto-detect" tag mechanisms.
- By default this option is switched on.
-
true
-
-
-
cache-file
-
String
-
This option specifies the file/directory path of the fop cache file.
- This file is currently only used to cache font triplet information for future reference.
-
${base}/conf/fop.cache
-
-
-
renderers
-
(see text below)
-
Contains the configuration for each renderer. See below.
-
N/A
-
-
-
- This is an excerpt from the example configuration file coming with FOP:
-
-
-
-
- Image Loading Customization
-
- Apache FOP uses the image loading framework from
- Apache XML Graphics Commons 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:
-
-
-
- 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.
-
-
- The second penalty element sets an "infinite" penalty for the TIFF loader using the internal
- TIFF codec. This practically disables that plug-in as it will never be chosen as a possible
- solution.
-
-
- Negative penalties are possible to promote a plug-in but a negative penalty sum will be
- treated as zero penalty in most cases. For more details on the image loading framework,
- please consult the documentation there.
-
-
-
- Renderer configuration
-
- Each Renderer has its own configuration section which is identified by the
- MIME type the Renderer is written for, ex. "application/pdf" for the PDF Renderer.
-
-
- The configuration for the PDF Renderer could look like this:
-
-
-
- The details on the font configuration can be found on the separate Fonts page.
- Note especially the section entitled Register Fonts with FOP.
-
-
- Special Settings for the PDF Renderer
-
- The configuration element for the PDF renderer contains two elements. One is for the font configuration
- (please follow the link above) and one is for the "filter list". The filter list controls how the
- individual objects in a PDF file are encoded. By default, all objects get "flate" encoded (i.e. simply
- compressed with the same algorithm that is also used in ZIP files). Most users don't need to change that
- setting. For debugging purposes, it may be desired not to compress the internal objects at all so the
- generated PDF commands can be read. In that case, you can simply use the following filter list. The
- second filter list (type="image") ensures that all images still get compressed but also ASCII-85 encoded
- so the produced PDF file is still easily readable in a text editor.
-
-
-
- Another (optional) setting specific to the PDF Renderer is an output color profile, an ICC
- color profile which indicates the target color space the PDF file is generated for. This
- setting is mainly used in conjunction with the PDF/X feature.
- An example:
-
-
-
- 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:
-
-
-
-
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.
-
-
- By default FOP produces PDF files of version 1.4, but this can be changed in order to benefit
- from features that appeared in newer versions of PDF. At the moment, only a few features from
- PDF 1.5 have been implemented, but the configuration element will accept any value between
- 1.4 and 1.7. This is the value that will appear in the PDF header, although only features up
- to 1.5 will actually be used.
-
-
-
-
-
- Special Settings for the PostScript Renderer
-
- Besides the normal font configuration (the same "fonts" element as for the PDF renderer) the PostScript
- renderer has an additional setting to force landscape pages to be rotated to fit on a page inserted into
- the printer in portrait mode. Set the value to "true" to activate this feature. The default is "false".
- Example:
-
-
-
-
- Special Settings for the PCL Renderer
-
- Non-standard fonts for the PCL renderer are made available through the Java2D subsystem which means that
- you don't have to do any custom font configuration in this case but you have to use the font names
- offered by Java.
-
-
- Additionally, there are certain settings that control how the renderer handles various elements.
-
-
-
- The default value for the "rendering" setting is "speed" which causes borders
- to be painted as plain rectangles. In this mode, no special borders (dotted,
- dashed etc.) are available. If you want support for all border modes, set the
- value to "quality" as indicated above. This will cause the borders to be painted
- as bitmaps.
-
-
- The default value for the "text-rendering" setting is "auto" which paints the
- base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D.
- If the mix of painting methods results in unwelcome output, you can set this
- to "bitmap" which causes all text to be rendered as bitmaps.
-
-
-
- Special Settings for the AFP Renderer
-
-
-
- Additionally, there are certain settings that control how the renderer handles various elements.
-
-
-
- The default value for the images "mode" setting is "b+w" (black and white). When the images "mode" setting is "b+w" a "bits-per-pixel" setting can be provided to aid the grayscale conversion process. With this setting all images referenced in your source document are converted to an IOCA FS45 grayscale bitmap image form.
- When the setting is "color" all images are converted to an IOCA FS45 color bitmap image form. When "native" setting is "true", all images encountered (TIFF, GIF, JPEG and Encapsulated Postscript etc.) will be embedded directly in the datastream in their native form using a MO:DCA Object Container.
-
-
- The default value for the "renderer-resolution" is 240 dpi.
-
-
- The default line width is device dependent and may need to be fine tuned so that the output matches the expected result. The default correction value is 2.5.
-
-
-
- By default if there is no configuration definition for "resource-group-file", external resources will be placed in a file called resources.afp.
-
-
-
-
-
- When it does not work
-
-
FOP searches the configuration file for the information it
-expects, at the position it expects. When that information is not
-present, FOP will not complain, it will just continue. When there is
-other information in the file, FOP will not complain, it will just
-ignore it. That means that when your configuration information is in
-the file but in a different XML element, or in a different XML path,
-than FOP expects, it will be silently ignored.
-
-
Check the following possibilities:
-
-
-
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?
-
-
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 schema element:
-
-
-
-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.
-
-
Run FOP in debug mode (command line option
--d). This makes FOP report which configuration
-information it finds. Check if FOP finds what you expect.
- Review Running Apache⢠FOP for important information that applies
- to embedded applications as well as command-line use, such as options and performance.
-
-
- To embed Apache⢠FOP in your application, first create a new
- org.apache.fop.apps.FopFactory instance. This object can be used to launch multiple
- rendering runs. For each run, create a new org.apache.fop.apps.Fop instance through
- one of the factory methods of FopFactory. In the method call you specify which output
- format (i.e. MIME type) to use and, if the selected output format requires an
- OutputStream, which OutputStream to use for the results of the rendering. You can
- customize FOP's behaviour in a rendering run by supplying your own FOUserAgent
- instance. The FOUserAgent can, for example, be used to set your own document handler
- instance (details below). Finally, you retrieve a SAX DefaultHandler instance from
- the Fop object and use that as the SAXResult of your transformation.
-
-
-
- The API
-
- FOP has many classes which express the "public" access modifier, however, this is not
- indicative of their inclusion into the public API. Every attempt will be made to keep the
- public API static, to minimize regressions for existing users, however, since the API is not
- clearly defined, the list of classes below are the generally agreed public API:
-
-
-
-
- Basic Usage Pattern
-
- Apache FOP relies heavily on JAXP. It uses SAX events exclusively to receive the XSL-FO
- input document. It is therefore a good idea that you know a few things about JAXP (which
- is a good skill anyway). Let's look at the basic usage pattern for FOP...
-
-
Here is the basic pattern to render an XSL-FO file to PDF:
-
-
-
- Let's discuss these 5 steps in detail:
-
-
-
- Step 1: You create a new FopFactory instance. The FopFactory instance holds
- references to configuration information and cached data. It's important to reuse this
- instance if you plan to render multiple documents during a JVM's lifetime.
-
-
- Step 2: You set up an OutputStream that the generated document
- will be written to. It's a good idea to buffer the OutputStream as demonstrated
- to improve performance.
-
-
- Step 3: You create a new Fop instance through one of the factory
- methods on the FopFactory. You tell the FopFactory what your desired output format
- is. This is done by using the MIME type of the desired output format (ex. "application/pdf").
- You can use one of the MimeConstants.* constants. The second parameter is the
- OutputStream you've setup up in step 2.
-
-
- Step 4 We recommend that you use JAXP Transformers even
- if you don't do XSLT transformations to generate the XSL-FO file. This way
- you can always use the same basic pattern. The example here sets up an
- "identity transformer" which just passes the input (Source) unchanged to the
- output (Result). You don't have to work with a SAXParser if you don't do any
- XSLT transformations.
-
-
- Step 5: Here you set up the input and output for the XSLT
- transformation. The Source object is set up to load the "myfile.fo" file.
- The Result is set up so the output of the XSLT transformation is sent to FOP.
- The FO file is sent to FOP in the form of SAX events which is the most efficient
- way. Please always avoid saving intermediate results to a file or a memory buffer
- because that affects performance negatively.
-
-
- Step 6: Finally, we start the XSLT transformation by starting
- the JAXP Transformer. As soon as the JAXP Transformer starts to send its output
- to FOP, FOP itself starts its processing in the background. When the
- transform() method returns FOP will also have finished converting
- the FO file to a PDF file and you can close the OutputStream.
-
- It's a good idea to enclose the whole conversion in a try..finally statement. If
- you close the OutputStream in the finally section, this will make sure that the
- OutputStream is properly closed even if an exception occurs during the conversion.
-
-
-
-
- If you're not totally familiar with JAXP Transformers, please have a look at the
- Embedding examples below. The section contains examples
- for all sorts of use cases. If you look at all of them in turn you should be able
- to see the patterns in use and the flexibility this approach offers without adding
- too much complexity.
-
-
- This may look complicated at first, but it's really just the combination of an
- XSL transformation and a FOP run. It's also easy to comment out the FOP part
- for debugging purposes, for example when you're tracking down a bug in your
- stylesheet. You can easily write the XSL-FO output from the XSL transformation
- to a file to check if that part generates the expected output. An example for that
- can be found in the Embedding examples (See "ExampleXML2FO").
-
-
- Logging
-
- Logging is now a little different than it was in FOP 0.20.5. We've switched from
- Avalon Logging to Jakarta Commons Logging.
- While with Avalon Logging the loggers were directly given to FOP, FOP now retrieves
- its logger(s) through a statically available LogFactory. This is similar to the
- general pattern that you use when you work with Apache Log4J directly, for example.
- We call this "static logging" (Commons Logging, Log4J) as opposed to "instance logging"
- (Avalon Logging). This has a consequence: You can't give FOP a logger for each
- processing run anymore. The log output of multiple, simultaneously running FOP instances
- is sent to the same logger.
-
-
- By default, Jakarta Commons Logging uses
- JDK logging (available in JDKs 1.4 or higher) as its backend. You can configure Commons
- Logging to use an alternative backend, for example Log4J. Please consult the
- documentation for Jakarta Commons Logging on
- how to configure alternative backends.
-
-
- As a result of the above we differentiate between two kinds of "logging":
-
- The use of "feedback" instead of "logging" is intentional. Most people were using
- log output as a means to get feedback from events within FOP. Therefore, FOP now
- includes an event package which can be used to receive feedback from
- the layout engine and other components within FOP per rendering run.
- This feedback is not just some
- text but event objects with parameters so these events can be interpreted by code.
- Of course, there is a facility to turn these events into normal human-readable
- messages. For details, please read on on the Events page.
- This leaves normal logging to be mostly a thing used by the FOP developers
- although anyone can surely activate certain logging categories but the feedback
- from the loggers won't be separated by processing runs. If this is required,
- the Events subsystem is the right approach.
-
-
-
-
- Processing XSL-FO
-
- Once the Fop instance is set up, call getDefaultHandler() to obtain a SAX
- DefaultHandler instance to which you can send the SAX events making up the XSL-FO
- document you'd like to render. FOP processing starts as soon as the DefaultHandler's
- startDocument() method is called. Processing stops again when the
- DefaultHandler's endDocument() method is called. Please refer to the basic
- usage pattern shown above to render a simple XSL-FO document.
-
-
-
-
- Processing XSL-FO generated from XML+XSLT
-
- If you want to process XSL-FO generated from XML using XSLT we recommend
- again using standard JAXP to do the XSLT part and piping the generated SAX
- events directly through to FOP. The only thing you'd change to do that
- on the basic usage pattern above is to set up the Transformer differently:
-
-
-
-
-
- Input Sources
-
- The input XSL-FO document is always received by FOP as a SAX stream (see the
- Parsing Design Document for the rationale).
-
-
- However, you may not always have your input document available as a SAX stream.
- But with JAXP it's easy to convert different input sources to a SAX stream so you
- can pipe it into FOP. That sounds more difficult than it is. You simply have
- to set up the right Source instance as input for the JAXP transformation.
- A few examples:
-
-
-
- URL:Source src = new StreamSource("http://localhost:8080/testfile.xml");
-
-
- File:Source src = new StreamSource(new File("C:/Temp/myinputfile.xml"));
-
-
- String:Source src = new StreamSource(new StringReader(myString)); // myString is a String
-
-
- InputStream:Source src = new StreamSource(new MyInputStream(something));
-
-
- Byte Array:Source src = new StreamSource(new ByteArrayInputStream(myBuffer)); // myBuffer is a byte[] here
-
-
- DOM:Source src = new DOMSource(myDocument); // myDocument is a Document or a Node
-
-
- Java Objects: Please have a look at the Embedding examples which contain an example for this.
-
-
-
- There are a variety of upstream data manipulations possible.
- For example, you may have a DOM and an XSL stylesheet; or you may want to
- set variables in the stylesheet. Interface documentation and some cookbook
- solutions to these situations are provided in
- Xalan Basic Usage Patterns.
-
-
-
- Configuring Apache FOP Programmatically
-
- Apache FOP provides two levels on which you can customize FOP's
- behaviour: the FopFactory and the user agent.
-
-
- Customizing the FopFactory
-
- The FopFactory holds configuration data and references to objects which are reusable over
- multiple rendering runs. It's important to instantiate it only once (except in special
- environments) and reuse it every time to create new FOUserAgent and Fop instances.
-
-
- You can set all sorts of things on the FopFactory:
-
-
-
-
- The font base URL to use when resolving relative URLs for fonts. Example:
-
-
-
-
-
- The hyphenation base URL to use when resolving relative URLs for
- hyphenation patterns. Example:
-
-
-
-
-
- Disable strict validation. When disabled FOP is less strict about the rules
- established by the XSL-FO specification. Example:
-
-
-
-
-
- Enable an alternative set of rules for text indents that tries to mimic the behaviour of many commercial
- FO implementations, that chose to break the specification in this respect. The default of this option is
- 'false', which causes Apache FOP to behave exactly as described in the specification. To enable the
- alternative behaviour, call:
-
-
-
-
-
- Set the source resolution for the document. This is used internally to determine the pixel
- size for SVG images and bitmap images without resolution information. Default: 72 dpi. Example:
-
-
-
-
-
- Manually add an ElementMapping instance. If you want to supply a special FOP extension
- you can give the instance to the FOUserAgent. Normally, the FOP extensions can be automatically detected
- (see the documentation on extension for more info). Example:
-
-
-
-
-
- Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add
- custom URI resolution functionality to FOP. For example, you can use
- Apache XML Commons Resolver to make use of XCatalogs. Example:
-
-
-
- Both the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FopFactory
- is primarily used to resolve URIs on factory-level (hyphenation patterns, for example) and it is always used
- if no other URIResolver (for example on the FOUserAgent) resolved the URI first.
-
-
-
-
-
- Customizing the User Agent
-
- The user agent is the entity that allows you to interact with a single rendering run, i.e. the processing of a single
- document. If you wish to customize the user agent's behaviour, the first step is to create your own instance
- of FOUserAgent using the appropriate factory method on FopFactory and pass that
- to the factory method that will create a new Fop instance:
-
-
-
- You can do all sorts of things on the user agent:
-
-
-
-
- The base URL to use when resolving relative URLs. Example:
-
-
-
-
-
- Set the producer of the document. This is metadata information that can be used for certain output formats such as PDF. The default producer is "Apache FOP". Example:
-
-
-
-
-
- Set the creating user of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Set the author of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Override the creation date and time of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Set the title of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Set the keywords of the document. This is metadata information that can be used for certain output formats such as PDF. Example:
-
-
-
-
-
- Set the target resolution for the document. This is used to
- specify the output resolution for bitmap images generated by bitmap renderers
- (such as the TIFF renderer) and by bitmaps generated by Apache Batik for filter
- effects and such. Default: 72 dpi. Example:
-
-
-
-
-
- Set your own Document Handler. This feature can be used for several purposes, the most likey usage of which would probably be
- binding a MIME type when the output is Intermediate Format (see Document Handlers). This also allows advanced
- users to create their own implementation of the document handler.
-
-
-
-
-
- Set your own FOEventHandler instance. If you want to supply your own FOEventHandler or
- configure an FOEventHandler subclass in a special way you can give the instance to the FOUserAgent. Normally,
- the FOEventHandler instance is created by FOP. Example:
-
-
-
-
-
- Set a URIResolver for custom URI resolution. By supplying a JAXP URIResolver you can add
- custom URI resolution functionality to FOP. For example, you can use
- Apache XML Commons Resolver to make use of XCatalogs. Example:
-
-
-
- Both the FopFactory and the FOUserAgent have a method to set a URIResolver. The URIResolver on the FOUserAgent is
- used for resolving URIs which are document-related. If it's not set or cannot resolve a URI, the URIResolver
- from the FopFactory is used.
-
-
-
-
- You should not reuse an FOUserAgent instance between FOP rendering runs although you can. Especially
- in multi-threaded environment, this is a bad idea.
-
-
-
-
- Using a Configuration File
-
- Instead of setting the parameters manually in code as shown above you can also set
- many values from an XML configuration file:
-
-
-
- The layout of the configuration file is described on the Configuration page.
-
-
-
- Document Handlers
-
- The document handlers are classes that inherit from org.apache.fop.render.intermediate.IFDocumentHandler. This
- is an interface for which a MIME type specific implementation can be created. This same handler is used either when XSL-FO
- is used as the input or when Intermediate Format is used. Since IF is output format agnostic, if custom fonts or other
- configuration information that affect layout (specific to a particular MIME type) are given then FOP needs that contextual
- information. The document handler provides that context so that when the IF is rendered, it is more visually consistent with
- FO rendering. The code below shows an example of how a document handler can be used to provide PDF configuration data to the
- IFSerializer.
-
- The rest of the code is the same as in Basic Usage Patterns.
-
-
-
- Hints
-
- Object reuse
-
- Fop instances shouldn't (and can't) be reused. Please recreate
- Fop and FOUserAgent instances for each rendering run using the FopFactory.
- This is a cheap operation as all reusable information is held in the
- FopFactory. That's why it's so important to reuse the FopFactory instance.
-
-
-
- AWT issues
-
- If your XSL-FO files contain SVG then Apache Batik will be used. When Batik is
- initialised it uses certain classes in java.awt that
- intialise the Java AWT classes. This means that a daemon thread
- is created by the JVM and on Unix it will need to connect to a
- DISPLAY.
-
-
- The thread means that the Java application may not automatically quit
- when finished, you will need to call System.exit(). These
- issues should be fixed in the JDK 1.4.
-
-
- If you run into trouble running FOP on a head-less server, please see the
- notes on Batik.
-
-
-
- Getting information on the rendering process
-
- To get the number of pages that were rendered by FOP you can call
- Fop.getResults(). This returns a FormattingResults object
- where you can look up the number of pages produced. It also gives you the
- page-sequences that were produced along with their id attribute and their
- numbers of pages. This is particularly useful if you render multiple
- documents (each enclosed by a page-sequence) and have to know the number of
- pages of each document.
-
-
-
-
- Improving performance
-
- There are several options to consider:
-
-
-
- Whenever possible, try to use SAX to couple the individual components involved
- (parser, XSL transformer, SQL datasource etc.).
-
-
- Depending on the target OutputStream (in case of a FileOutputStream, but not
- for a ByteArrayOutputStream, for example) it may improve performance considerably
- if you buffer the OutputStream using a BufferedOutputStream:
- out = new java.io.BufferedOutputStream(out);
-
- Make sure you properly close the OutputStream when FOP is finished.
-
-
- Cache the stylesheet. If you use the same stylesheet multiple times
- you can set up a JAXP Templates object and reuse it each time you do
- the XSL transformation. (More information can be found
- here.)
-
-
- Use an XSLT compiler like XSLTC
- that comes with Xalan-J.
-
-
- Fine-tune your stylesheet to make the XSLT process more efficient and to create XSL-FO that can
- be processed by FOP more efficiently. Less is more: Try to make use of property inheritance where possible.
-
-
- You may also wish to consider trying to reduce memory usage.
-
-
-
-
- Multithreading FOP
-
- Apache FOP may currently not be completely thread safe.
- The code has not been fully tested for multi-threading issues, yet.
- If you encounter any suspicious behaviour, please notify us.
-
-
- There is also a known issue with fonts being jumbled between threads when using
- the Java2D/AWT renderer (which is used by the -awt and -print output options).
- In general, you cannot safely run multiple threads through the AWT renderer.
-
-
-
- Examples
-
- The directory "{fop-dir}/examples/embedding" contains several working examples.
-
-
- ExampleFO2PDF.java
-
This
-
- example
-demonstrates the basic usage pattern to transform an XSL-FO
-file to PDF using FOP.
-
-
-
-
- ExampleXML2FO.java
-
This
-
- example
-has nothing to do with FOP. It is there to show you how an XML
-file can be converted to XSL-FO using XSLT. The JAXP API is used to do the
-transformation. Make sure you've got a JAXP-compliant XSLT processor in your
-classpath (ex. Xalan).
-
-
-
-
- ExampleXML2PDF.java
-
This
-
- example
-demonstrates how you can convert an arbitrary XML file to PDF
-using XSLT and XSL-FO/FOP. It is a combination of the first two examples
-above. The example uses JAXP to transform the XML file to XSL-FO and FOP to
-transform the XSL-FO to PDF.
-
-
-
-The output (XSL-FO) from the XSL transformation is piped through to FOP using
-SAX events. This is the most efficient way to do this because the
-intermediate result doesn't have to be saved somewhere. Often, novice users
-save the intermediate result in a file, a byte array or a DOM tree. We
-strongly discourage you to do this if it isn't absolutely necessary. The
-performance is significantly higher with SAX.
-
-
-
- ExampleObj2XML.java
-
This
-
- example
-is a preparatory example for the next one. It's an example that
-shows how an arbitrary Java object can be converted to XML. It's an often
-needed task to do this. Often people create a DOM tree from a Java object and
-use that. This is pretty straightforward. The example here, however, shows how
-to do this using SAX, which will probably be faster and not even more
-complicated once you know how this works.
-
-
-
-For this example we've created two classes: ProjectTeam and ProjectMember
-(found in xml-fop/examples/embedding/java/embedding/model). They represent
-the same data structure found in
-xml-fop/examples/embedding/xml/xml/projectteam.xml. We want to serialize to XML a
-project team with several members which exist as Java objects.
-Therefore we created the two classes: ProjectTeamInputSource and
-ProjectTeamXMLReader (in the same place as ProjectTeam above).
-
-
-The XMLReader implementation (regard it as a special kind of XML parser) is
-responsible for creating SAX events from the Java object. The InputSource
-class is only used to hold the ProjectTeam object to be used.
-
-
-Have a look at the source of ExampleObj2XML.java to find out how this is
-used. For more detailed information see other resources on JAXP (ex.
-An older JAXP tutorial).
-
-
-
- ExampleObj2PDF.java
-
This
-
- example
-combines the previous and the third to demonstrate
-how you can transform a Java object to a PDF directly in one smooth run
-by generating SAX events from the Java object that get fed to an XSL
-transformation. The result of the transformation is then converted to PDF
-using FOP as before.
-
-
-
-
- ExampleDOM2PDF.java
-
This
-
- example
-has FOP use a DOMSource instead of a StreamSource in order to
-use a DOM tree as input for an XSL transformation.
-
-This can be found in the embedding.intermediate package within the
-examples and describes how IF can be concatenated to produce a document. Because
-IF has been through FOPs layout engine, it should be visually consistent with FO
-rendered documents while allowing the user to merge numerous documents together.
-
-
-
- Final notes
-
-These examples should give you an idea of what's possible. It should be easy
-to adjust these examples to your needs. Also, if you have other examples that you
-think should be added here, please let us know via either the fop-users or fop-dev
-mailing lists. Finally, for more help please send your questions to the fop-users
-mailing list.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1/events.xml b/src/documentation/content/xdocs/1.1/events.xml
deleted file mode 100644
index 27daad59b..000000000
--- a/src/documentation/content/xdocs/1.1/events.xml
+++ /dev/null
@@ -1,449 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Events/Processing Feedback
- $Revision$
-
-
-
- Introduction
-
- In versions until 0.20.5, Apache⢠FOP used
- Avalon-style Logging where
- it was possible to supply a logger per processing run. During the redesign
- the logging infrastructure was switched over to
- Commons Logging which is (like Log4J or
- java.util.logging) a "static" logging framework (the logger is accessed through static
- variables). This made it very difficult in a multi-threaded system to retrieve information
- for a single processing run.
-
-
- With FOP's event subsystem, we'd like to close this gap again and even go further. The
- first point is to realize that we have two kinds of "logging". Firstly, we have the logging
- infrastructure for the (FOP) developer who needs to be able to enable finer log messages
- for certain parts of FOP to track down a certain problem. Secondly, we have the user who
- would like to be informed about missing images, overflowing lines or substituted fonts.
- These messages (or events) are targeted at less technical people and may ideally be
- localized (translated). Furthermore, tool and solution builders would like to integrate
- FOP into their own solutions. For example, an FO editor should be able to point the user
- to the right place where a particular problem occurred while developing a document template.
- Finally, some integrators would like to abort processing if a resource (an image or a font)
- has not been found, while others would simply continue. The event system allows to
- react on these events.
-
-
- On this page, we won't discuss logging as such. We will show how the event subsystem can
- be used for various tasks. We'll first look at the event subsystem from the consumer side.
- Finally, the production of events inside FOP will be discussed (this is mostly interesting
- for FOP developers only).
-
-
-
- The consumer side
-
- The event subsystem is located in the org.apache.fop.events package and its
- base is the Event class. An instance is created for each event and is sent
- to a set of EventListener instances by the EventBroadcaster.
- An Event contains:
-
-
-
an event ID,
-
a source object (which generated the event),
-
a severity level (Info, Warning, Error and Fatal Error) and
-
a map of named parameters.
-
-
- The EventFormatter class can be used to translate the events into
- human-readable, localized messages.
-
-
- A full example of what is shown here can be found in the
- examples/embedding/java/embedding/events directory in the FOP distribution.
- The example can also be accessed
- via the web.
-
-
- Writing an EventListener
-
- 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.
-
-
-
- You can see that for every event the method processEvent of the
- EventListener will be called. Inside this method you can do whatever
- processing you would like including throwing a RuntimeException, if you want
- to abort the current processing run.
-
-
- The code above also shows how you can turn an event into a human-readable, localized
- message that can be presented to a user. The EventFormatter class does
- this for you. It provides additional methods if you'd like to explicitly specify
- the locale.
-
-
- It is possible to gather all events for a whole processing run so they can be
- evaluated afterwards. However, care should be taken about memory consumption since
- the events provide references to objects inside FOP which may themselves have
- references to other objects. So holding on to these objects may mean that whole
- object trees cannot be released!
-
-
-
- Adding an EventListener
-
- To register the event listener with FOP, get the EventBroadcaster which
- is associated with the user agent (FOUserAgent) and add it there:
-
-
-
- Please note that this is done separately for each processing run, i.e. for each
- new user agent.
-
-
-
- An additional listener example
-
- Here's an additional example of an event listener:
-
-
- By default, FOP continues processing even if an image wasn't found. If you have
- more strict requirements and want FOP to stop if an image is not available, you can
- do something like the following in the simplest case:
-
-
-
- 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.
-
-
- You can also customize the exception to throw (you can may throw a RuntimeException
- or subclass yourself) and/or which event to respond to:
-
-
-
- This throws a RuntimeException with the FileNotFoundException
- as the cause. Further processing effectively stops in FOP. You can catch the exception
- in your code and react as you see necessary.
-
-
-
-
- The producer side (for FOP developers)
-
- This section is primarily for FOP and FOP plug-in developers. It describes how to use
- the event subsystem for producing events.
-
-
- The event package has been designed in order to be theoretically useful for use cases
- outside FOP. If you think this is interesting independently from FOP, please talk to
- us.
-
-
- Producing and sending an event
-
- The basics are very simple. Just instantiate an Event object and fill
- it with the necessary parameters. Then pass it to the EventBroadcaster
- which distributes the events to the interested listeneners. Here's a code example:
-
-
-
- The Event.paramsBuilder() is a
- fluent interface
- to help with the build-up of the parameters. You could just as well instantiate a
- Map (Map<String, Object>) and fill it with values.
-
-
-
- The EventProducer interface
-
- To simplify event production, the event subsystem provides the EventProducer
- interface. You can create interfaces which extend EventProducer. These
- interfaces will contain one method per event to be generated. By contract, each event
- method must have as its first parameter a parameter named "source" (Type Object) which
- indicates the object that generated the event. After that come an arbitrary number of
- parameters of any type as needed by the event.
-
-
- The event producer interface does not need to have any implementation. The implementation
- is produced at runtime by a dynamic proxy created by DefaultEventBroadcaster.
- The dynamic proxy creates Event instances for each method call against
- the event producer interface. Each parameter (except "source") is added to the event's
- parameter map.
-
-
- To simplify the code needed to get an instance of the event producer interface it is
- suggested to create a public inner provider class inside the interface.
-
-
- Here's an example of such an event producer interface:
-
-
-
- To produce the same event as in the first example above, you'd use the following code:
-
-
-
-
- The event model
-
- 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 Event's
- parameter map we need to know the parameter names. These are retrieved from an
- event object model. This is found in the org.apache.fop.events.model
- 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 (ant resourcegen). The Ant task (found in
- src/codegen/java/org/apache/fop/tools/EventProducerCollectorTask.java)
- scans FOP's sources for descendants of the EventProducer interface and
- uses QDox to parse these interfaces.
-
-
- The event model XML files are generated during build by the Ant task mentioned above when
- running the "resourcegen" task. So just run "ant resourcegen" if you receive
- a MissingResourceException at runtime indicating that
- "event-model.xml" is missing.
-
-
- Primarily, the QDox-based collector task records the parameters' names and types.
- Furthermore, it extracts additional attributes embedded as Javadoc comments from
- the methods. At the moment, the only such attribute is "@event.severity" which indicates
- the default event severity (which can be changed by event listeners). The example event
- producer above shows the Javadocs for an event method.
-
-
- There's one more information that is extracted from the event producer information for
- the event model: an optional primary exception. The first exception in the "throws"
- declaration of an event method is noted. It is used to throw an exception from
- the invocation handler if the event has an event severity of "FATAL" when all
- listeners have been called (listeners can update the event severity). Please note
- that an implementation of
- org.apache.fop.events.EventExceptionManager$ExceptionFactory has to be
- registered for the EventExceptionManager to be able to construct the
- exception from an event.
-
-
- For a given application, there can be multiple event models active at the same time.
- In FOP, each renderer is considered to be a plug-in and provides its own specific
- event model. The individual event models are provided through an
- EventModelFactory. This interface is implemented for each event model
- and registered through the service provider mechanism
- (see the plug-ins section for details).
-
-
-
- Event severity
-
- Four different levels of severity for events has been defined:
-
-
-
INFO: informational only
-
WARN: a Warning
-
ERROR: an error condition from which FOP can recover. FOP will continue processing.
-
FATAL: a fatal error which causes an exception in the end and FOP will stop processing.
-
-
- Event listeners can choose to ignore certain events based on their event severity.
- Please note that you may recieve an event "twice" in a specific case: if there is
- a fatal error an event is generated and sent to the listeners. After that an exception
- is thrown with the same information and processing stops. If the fatal event is
- shown to the user and the following exception is equally presented to the user it
- may appear that the event is duplicated. Of course, the same information is just
- published through two different channels.
-
-
-
- Plug-ins to the event subsystem
-
- The event subsystem is extensible. There are a number of extension points:
-
-
-
- org.apache.fop.events.model.EventModelFactory: Provides
- an event model to the event subsystem.
-
-
- org.apache.fop.events.EventExceptionManager$ExceptionFactory:
- Creates exceptions for events, i.e. turns an event into a specific exception.
-
-
-
- The names in bold above are used as filenames for the service provider files that
- are placed in the META-INF/services directory. That way, they are
- automatically detected. This is a mechanism defined by the
- JAR file specification.
-
-
-
- Localization (L10n)
-
- One goal of the event subsystem was to have localized (translated) event messages.
- The EventFormatter class can be used to convert an event to a
- human-readable message. Each EventProducer can provide its own XML-based
- translation file. If there is none, a central translation file is used, called
- "EventFormatter.xml" (found in the same directory as the EventFormatter
- class).
-
-
- The XML format used by the EventFormatter is the same as
- Apache Cocoon's catalog format. Here's an example:
-
-
-
- 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
- org.apache.fop.util.text.AdvancedMessageFormat which is more powerful
- than the MessageFormat classes provided by the Java class library
- (java.util.text package).
-
-
- "locator" is a template that is reused by the other message templates
- by referencing it through "{{locator}}". This is some kind of include command.
-
-
- Normal event parameters are accessed by name inside single curly braces, for example:
- "{node}". For objects, this format just uses the toString() method to turn
- the object into a string, unless there is an ObjectFormatter registered
- for that type (there's an example for org.xml.sax.Locator).
-
-
- 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).
-
-
- Additional such modifiers can be added by implementing the
- AdvancedMessageFormat$Part and AdvancedMessageFormat$PartFactory
- interfaces.
-
-
- 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).
-
-
- Developers can also register a function (in the above example:
- {#gatherContextInfo})
- to do more complex information rendering. These functions are implementations of the
- AdvancedMessageFormat$Function interface. Please take care that this is
- done in a locale-independent way as there is no locale information available, yet.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1/extensions.xml b/src/documentation/content/xdocs/1.1/extensions.xml
deleted file mode 100644
index 02d83db96..000000000
--- a/src/documentation/content/xdocs/1.1/extensions.xml
+++ /dev/null
@@ -1,339 +0,0 @@
-
-
-
-
-
-
- Standard Apache⢠FOP Extensions
- $Revision$
-
-
-
- By "extension", we mean any data that can be placed in the input XML document that
- is not addressed by the XSL-FO standard.
- By having a mechanism for supporting extensions, Apache⢠FOP is able to add features that
- are not covered in the specification.
-
-
- The extensions documented here are included with FOP, and are automatically available
- to you. If you wish to add an extension of your own to FOP, please see the
- Developers' Extension Page.
-
- All extensions require the correct use of an appropriate namespace in your input document.
-
- SVG
-
- By convention, FO extensions in FOP use the "fox" namespace prefix.
- To use any of the FO extensions, add a namespace entry for
- http://xmlgraphics.apache.org/fop/extensions to the root element:
-
-
-
-
- PDF Bookmarks
-
- In old versions of Apache FOP there was a fox:outline element
- which was used to create outlines in PDF files. The redesigned code makes use
- of the bookmark feature defined in the W3C XSL 1.1 standard.
-
-
-
- Anchors or Named Destinations
-
Use the fox:destination element to define "named destinations" inside a PDF document.
-These are useful as fragment identifiers, e.g. "http://server/document.pdf#anchor-name".
-fox:destination elements can be placed almost anywhere in the fo document, including a child of
-root, a block-level element, or an inline-level element.
-For the destination to actually work, it must correspond to an "id" attribute on some fo element
-within the document. In other words, the "id" attribute actually creates the "view" within the
-PDF document. The fox:destination simply gives that view an independent name.
-
-
- It is possible that in some future release of FOP, all elements with
-"id" attributes will generate named-destinations, which will eliminate the need for
-fox:destination.
-
-
- Table Continuation Label
-
This extension element hasn't been reimplemented for the redesigned code, yet.
-
-
-
- fox:orphan-content-limit and fox:widow-content-limit
-
- The two proprietary extension properties, fox:orphan-content-limit and
- fox:widow-content-limit, are used to improve the layout of list-blocks and tables.
- If you have a table with many entries, you don't want a single row to be left over
- on a page. You will want to make sure that at least two or three lines are kept
- together. The properties take an absolute length which specifies the area at the
- beginning (fox:widow-content-limit) or at the end (fox:orphan-content-limit) of a
- table or list-block. The properties are inherited and only have an effect on fo:table
- and fo:list-block. An example: fox:widow-content-limit="3 * 1.2em" would make sure
- the you'll have at least three lines (assuming line-height="1.2") together on a table
- or list-block.
-
-
-
- fox:external-document
-
- This feature is incomplete. Support for multi-page documents will be added shortly.
- At the moment, only single-page images will work. And this will not work with RTF output.
-
-
- This is a proprietary extension element which allows to add whole images as pages to
- an FO document. For example, if you have a scanned document or a fax as multi-page TIFF
- file, you can append or insert this document using the fox:external-document
- element. Each page of the external document will create one full page in the target
- format.
-
-
- The fox:external-document element is structurally a peer to
- fo:page-sequence, so wherever you can put an fo:page-sequence
- you could also place a fox:external-document.
- Therefore, the specified contents for fo:root change to:
-
- The fox:external-document extension formatting object is used to specify
- how to create a (sub-)sequence of pages within a document. The content of these pages
- comes from the individual subimages/pages of an image or paged document (for example:
- multi-page TIFF in the form of faxes or scanned documents, or PDF files). The
- formatting object creates the necessary areas to display one image per page.
-
-
- In terms of page numbers, the behaviour is the same as for
- fo:page-sequence. The placement of the image inside the page is similar
- to that of fo:external-graphic or fo:instream-foreign-object,
- i.e. the viewport (and therefore the page size) is defined by either the intrinsic
- size of the image or by the size properties that apply to this formatting object.
-
-
Content: EMPTY
-
The following properties apply to this formatting object:
pages: <page-set> (see below) (not implemented, yet)
-
reference-orientation
-
scaling
-
scaling-method
-
src
-
text-align
-
width
-
-
- Datatype "page-set": Value: auto | <integer-range>,
- Default: "auto" which means all pages/subimages of the document.
- <integer-range> allows values such as "7" or "1-3"
-
-
- fox:external-document is not suitable for concatenating FO documents.
- For this, XInclude is recommended.
-
-
-
-
- Free-form Transformation for fo:block-container
-
- For fo:block-container elements whose absolute-position set to
- "absolute" or "fixed" you can use the extension attribute fox:transform
- to apply a free-form transformation to the whole block-container. The content of the
- fox:transform attribute is the same as for
- SVG's transform attribute.
- The transformation specified here is performed in addition to other implicit
- transformations of the block-container (resulting from top, left and other properties)
- and after them.
-
-
- Examples: fox:transform="rotate(45)" would rotate the block-container
- by 45 degrees clock-wise around its upper-left corner.
- fox:transform="translate(10000,0)" would move the block-container to the
- right by 10 points (=10000 millipoints, FOP uses millipoints internally!).
-
-
- This extension attribute doesn't work for all output formats! It's currently only
- supported for PDF, PS and Java2D-based renderers.
-
-
-
- Color functions
-
- XSL-FO supports specifying color using the rgb(), rgb-icc() and system-color() functions.
- Apache FOP provides additional color functions for special use cases. Please note that
- using these functions compromises the interoperability of an FO document.
-
-
- cmyk()
-
color cmyk(numeric, numeric, numeric, numeric)
-
- This function will construct a color in device-specific CMYK color space. The numbers
- must be between 0.0 and 1.0. For output formats that don't support device-specific
- color space the CMYK value is converted to an sRGB value.
-
-
-
- #CMYK pseudo-profile
-
color rgb-icc(numeric, numeric, numeric, #CMYK, numeric, numeric, numeric, numeric)
-
- The rgb-icc function will respond to a pseudo-profile called "#CMYK"
- which indicates a device-specific CMYK color space. The "#CMYK" profile is implicitely
- available and doesn't have to be (and cannot be) defined through an
- fo:color-profile element. It is provided for compatibility with certain
- commercial XSL-FO implementations. Please note that this is not part of the official
- specification but rather a convention. The following two color specifications are
- equivalent:
-
-
-
cmyk(0%,0%,20%,40%)
-
rgb-icc(153, 153, 102, #CMYK, 0, 0, 0.2, 0.4)
-
-
-
-
- Prepress Support
-
-
- This section defines a number of extensions related to
- prepress support.
- fox:scale defines a general scale factor for the generated pages.
- fox:bleed defines the
- bleed area for a page.
- fox:crop-offset defines the outer edges of the area in which crop marks,
- registration marks, color bars and page information are placed.
- For details, please read on below.
-
-
- Those extensions have been implemented in the PDF and Java2D renderers only.
-
-
-
- fox:scale
-
Value: <number>{1,2}
-
Initial: 1
-
Applies to: fo:simple-page-master
-
- This property specifies a scale factor along resp. the x and y axes. If only one number
- is provided it is used for both the x and y scales. A scale factor smaller than 1
- shrinks the page. A scale factor greater than 1 enlarges the page.
-
-
-
- fox:bleed
-
- Value: <length>{1,4}
-
-
- Initial: 0pt
-
-
Applies to: fo:simple-page-master
-
- If there is only one value, it applies to all sides. If there are two values, the top and bottom
- bleed widths are set to the first value and the right and left bleed widths are set to the second.
- If there are three values, the top is set to the first value, the left and right are set to the second,
- and the bottom is set to the third. If there are four values, they apply to the top, right, bottom, and
- left, respectively.
- (Corresponds to the definition of
- padding).
-
-
- This extension indirectly defines the BleedBox and is calculated by expanding the TrimBox by
- the bleed widths. The lengths must be non-negative.
-
-
-
- fox:crop-offset
-
- Value: <length>{1,4}
-
-
- Initial: bleed (see below)
-
-
Applies to: fo:simple-page-master
-
- Same behaviour as with fox:bleed. The initial value is set to the same values as the
- fox:bleed property.
-
-
- This extension indirectly defines the MediaBox and is calculated by expanding
- the TrimBox by the crop offsets. The lengths must be non-negative.
-
-
-
- fox:crop-box
-
- Value: [trim-box | bleed-box | media-box]
-
-
- Initial: media-box
-
-
Applies to: fo:simple-page-master
-
- 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.
-
-
- If requested in the future, we could offer to specify the CropBox in absolute coordinates rather
- than just by referencing another box.
-
The following table summarizes the font capabilities of the various Apache� FOP renderers:
-
-
-
Renderer
-
Base-14
-
AWT/OS
-
Custom
-
Custom Embedding
-
-
-
PDF
-
yes
-
no
-
yes
-
yes
-
-
-
PostScript
-
yes
-
no
-
yes
-
yes
-
-
-
PCL
-
yes (modified)
-
yes (painted as bitmaps)
-
yes (painted as bitmaps)
-
no
-
-
-
AFP
-
no
-
no
-
yes
-
yes
-
-
-
Java2D/AWT/Bitmap
-
if available from OS
-
yes
-
yes
-
n/a (display only)
-
-
-
Print
-
if available from OS
-
yes
-
yes
-
controlled by OS printer driver
-
-
-
RTF
-
n/a (font metrics not needed)
-
n/a
-
n/a
-
n/a
-
-
-
TXT
-
yes (used for layout but not for output)
-
no
-
yes (used for layout but not for output)
-
no
-
-
-
-
-
XML
-
yes
-
no
-
yes
-
n/a
-
-
-
-
- Base-14 Fonts
-
- The Adobe PostScript and PDF Specification specify a set of 14 fonts that must be
- available to every PostScript interpreter and PDF reader:
- Helvetica (normal, bold, italic, bold italic),
- Times (normal, bold, italic, bold italic),
- Courier (normal, bold, italic, bold italic),
- Symbol and ZapfDingbats.
-
-
- The following font family names are hard-coded into FOP for the Base-14 font set:
-
-
-
-
Base-14 font
-
font families
-
-
-
Helvetica
-
Helvetica, sans-serif, SansSerif
-
-
-
Times
-
Times, Times Roman, Times-Roman, serif, any
-
-
-
Courier
-
Courier, monospace, Monospaced
-
-
-
Symbol
-
Symbol
-
-
-
ZapfDingbats
-
ZapfDingbats
-
-
-
- Please note that recent versions of Adobe Acrobat Reader replace
- "Helvetica" with "Arial" and "Times" with "Times New Roman" internally.
- GhostScript replaces "Helvetica" with "Nimbus Sans L" and "Times" with
- "Nimbus Roman No9 L". Other document viewers may do similar font
- substitutions. If you need to make sure that there are no such
- substitutions, you need to specify an explicit font and embed it in
- the target document.
-
-
-
- Missing Fonts
-
- When FOP does not have a specific font at its disposal (because it's
- not installed in the operating system or set up in FOP's configuration),
- the font is replaced with "any". "any" is internally mapped to the
- Base-14 font "Times" (see above).
-
-
-
- Missing Glyphs
-
- Every font contains a particular set of
- glyphs. If no glyph can be found for
- a given character, FOP will issue a warning and use the glpyh for "#" (if available)
- instead. Before it does that, it consults a (currently hard-coded) registry of
- glyph substitution groups (see Glyphs.java in Apache XML Graphics Commons).
- This registry can supply alternative glyphs in some cases (like using space when a no-break
- space is requested). But there's no guarantee that the result will be as expected (for
- example, in the case of hyphens and similar glyphs). A better way is to use a font that
- has all the necessary glyphs. This glyph substitution is only a last resort.
-
-
-
- Java2D/AWT/Operating System Fonts
-
- The Java2D family of renderers (Java2D, AWT, Print, TIFF, PNG), use the
- Java AWT subsystem for font metric information. Through operating system
- registration, the AWT subsystem knows what fonts are available on the system,
- and the font metrics for each one.
-
-
- When working with one of these output formats and you're missing a font, just
- install it in your operating system and they should be available for these
- renderers. Please note that this is not true for other output formats such as
- PDF or PostScript.
-
-
-
- Custom Fonts
-
- Support for custom fonts is highly output format dependent (see above table).
- This section shows how to add Type 1 and TrueType fonts to the PDF, PostScript and
- Java2D-based renderers. Other renderers (like AFP) support other font formats. Details
- in this case can be found on the page about output formats.
-
-
- In earlier FOP versions, it was always necessary to create an XML font metrics file
- if you wanted to add a custom font. This unconvenient step has been removed and in
- addition to that, FOP supports auto-registration of fonts, i.e. FOP can find fonts
- installed in your operating system or can scan user-specified directories for fonts.
- Font registration via XML font metrics file is still supported and may still be necessary
- for some very special cases as fallback variant while we stabilize font auto-detection.
-
-
- Basic information about fonts can be found at:
-
- 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.
-
-
-
- Review the documentation for FOP Configuration
- for instructions on making the FOP configuration available to FOP when it runs.
- Otherwise, FOP has no way of finding your custom font information. It is currently
- not possible to easily configure fonts from Java code.
-
-
-
- Advanced font configuration
-
- The instructions found above should be sufficient for most users. Below are some
- additional instructions in case the basic font configuration doesn't lead to
- the desired results.
-
-
- Type 1 Font Metrics
-
FOP includes PFMReader, which reads the PFM file that normally comes with a Type 1 font, and generates an appropriate font metrics file for it.
- To use it, run the class org.apache.fop.fonts.apps.PFMReader:
-
Windows:
-
-
Unix:
-
-
PFMReader [options]:
-
-
-fn <fontname> By default, FOP uses the fontname from the
- .pfm file when embedding the font. Use the "-fn" option to override this name with one you have
- chosen. This may be useful in some cases to ensure that applications using the output document
- (Acrobat Reader for example) use the embedded font instead of a local font with the same
- name.
-
- The classpath in the above example has been simplified for readability.
- You will have to adjust the classpath to the names of the actual JAR files in the lib directory.
- xml-apis.jar, xercesImpl.jar, xalan.jar and serializer.jar are not necessary for JDK version 1.4 or later.
- The tool will construct some values (FontBBox, StemV and ItalicAngle) based on assumptions and calculations which are only an approximation to the real values.
- FontBBox and Italic Angle can be found in the human-readable part of the PFB file or in the AFM file.
- The PFMReader tool does not yet interpret PFB or AFM files, so if you want to be correct, you may have to adjust the values in the XML file manually.
- The constructed values however appear to have no visible influence.
-
-
- TrueType Font Metrics
-
FOP includes TTFReader, which reads the TTF file and generates an appropriate font metrics file for it.
- Use it in a similar manner to PFMReader.
- For example, to create such a metrics file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:
-
-
TTFReader [options]:
-
-
-d <DEBUG | INFO > Sets the debug level (default is
- INFO).
-
-fn <fontname> Same as for PFMReader.
-
-ttcname <fontname> If you're reading data from a
- TrueType Collection (.ttc file) you must specify which font from the collection you will read
- metrics from.
- If you read from a .ttc file without this option, the fontnames will be listed for you.
-
-enc ansi Creates a WinAnsi-encoded font metrics file.
- Without this option, a CID-keyed font metrics file is created.
- The table below summarizes the differences between these two encoding options as currently
- used within FOP.
- Please note that this information only applies to TrueType fonts and TrueType collections:
-
-
-
-
Issue
-
WinAnsi
-
CID-keyed
-
-
-
Usable Character Set
-
Limited to WinAnsi character set, which is roughly equivalent to iso-8889-1.
-
Limited only by the characters in the font itself.
-
-
-
Embedding the Font
-
Optional.
-
Mandatory. Not embedding the font produces invalid PDF documents.
-
-
-
- You may experience failures with certain TrueType fonts, especially if they don't contain
- the so-called Unicode "cmap" table. TTFReader can currently not deal with font like this.
-
-
-
- TrueType Collections
-
TrueType collections (.ttc files) contain more than one font.
- To create metrics files for these fonts, you must specify which font in the collection should be generated, by using the "-ttcname" option with the TTFReader.
-
To get a list of the fonts in a collection, just start the TTFReader as if it were a normal TrueType file (without the -ttcname option).
- It will display all of the font names and exit with an Exception.
-
Here is an example of generating a metrics file for a .ttc file:
-
-
- 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:
-
-
-
-
- Register Fonts with FOP
-
You must tell FOP how to find and use the font metrics files by registering them in the FOP Configuration. Add entries for your custom fonts, regardless of font type, to the configuration file in a manner similar to the following:
-
-
-
- URLs are used to access the font metric and font files.
- Relative URLs are resolved relative to the font-base property (or base) if available.
- See FOP: Configuration for more information.
-
-
The "metrics-url" attribute is generally not necessary except if you run into problems with certain fonts.
-
Either an "embed-url" or a "metrics-url" must be specified for font tag configurations.
-
The font "kerning" attribute is optional. Default is "true".
-
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.
-
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.
-
The attribute "encoding-mode" is optional an may have the following values:
-
-
auto: default font encoding mode ("cid" for Truetype, "single-byte" for Type 1)
-
single-byte: use single-byte encodings in the target format (if applicable)
-
cid: encode as CID-keyed font (currently only supported for PDF output with TrueType fonts)
-
-
-
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.
-
The fonts "auto-detect" tag can be used to automatically register fonts that are found to be installed on the native operating system.
-
Fonts registered with "font" tag configurations override fonts found by means of "directory" tag definitions.
-
Fonts found as a result of a "directory" tag configuration override fonts found as a result of the "auto-detect" tag being specified.
-
- If relative URLs are specified, they are evaluated relative to the value of the
- "font-base" setting. If there is no "font-base" setting, the fonts are evaluated
- relative to the base directory.
-
-
-
-
-
- Auto-Detect and auto-embed feature
-
When the "auto-detect" flag is set in the configuration, FOP will automatically search for fonts in the default paths for your operating system.
-
FOP will also auto-detect fonts which are available in the classpath, if they are described as "application/x-font" in the MANIFEST.MF file. For example, if your .jar file contains font/myfont.ttf:
-
-
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.
-
- The font cache
-
- Apache FOP maintains a cache file that is used to speed up auto-detection. This file
- is usually found in the ".fop" directory under the user's home directory. It's called
- "fop-fonts.cache". When the user's home directory is not writable, the font cache file
- is put in the directory for temporary files.
-
-
- If there was a problem loading a particular font, it is flagged in the cache file so
- it is not loaded anymore. So, if a font is actually around but is still not found
- by Apache FOP, it's worth a try to delete the font cache file which forces Apache FOP
- to reparse all fonts.
-
-
-
-
- Embedding
-
- By default, all fonts are embedded if an output format supports font embedding. In some
- cases, however, it is preferred that some fonts are only referenced. When working
- with referenced fonts it is important to be in control of the target environment where
- the produced document is consumed, i.e. the necessary fonts have to be installed there.
-
-
- There are two different ways how you can specify that a font should be referenced:
-
-
-
- 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.
-
-
- 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:
-
-
-
-
- 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
- java.util.regex package.
- 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 font-family=".*".
-
-
- The referenced-fonts element can be placed either inside the general
- fonts element (right under the root) or in the fonts 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.
-
-
- Various notes related to embedded fonts:
-
-
-
The PostScript renderer does not yet support TrueType fonts, but can embed Type 1 fonts.
-
The font is simply embedded into the PDF file, it is not converted.
-
When FOP embeds a font, it adds a prefix to the fontname to ensure that the name will not match the fontname of an installed font.
- This is helpful with older versions of Acrobat Reader that preferred installed fonts over embedded fonts.
-
When embedding PostScript fonts, the entire font is always embedded.
-
When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a subset of the
- original font, containing only the glyphs used, is embedded in the output document.
- That's the default, but if you specify encoding-mode="single-byte" (see above), the
- complete font is embedded.
-
-
-
- Substitution
-
When a <substitutions/> section is defined in the configuration, FOP will re-map any font-family references found in your FO input to a given substitution font.
-
-
If a <substitution/> is declared, it is mandatory that both a <from/> and <to/> child element is declared with a font-family attribute.
-
Both font-weight and font-style are optional attributes, if they are provided then a value of 'normal' is assumed.
-
-
For example you could make all FO font-family references to 'Arial' with weights between 700 and 900 reference the normal 'Arial Black' font.
-
-
-
-
-
- Font Selection Strategies
-
- There are two font selection strategies: character-by-character or auto. The default is auto.
-
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):
-
-
aaa lll xxx would be displayed in fonts A A B
-
aaaxx would be displayed in font A
-
aaaxxx would be displayed in font A
-
aaaxxxx would be displayed in font B
-
-
Character-by-Character is NOT yet supported!
-
-
- Font List Command-Line Tool
-
- FOP contains a small command-line tool that lets you generate a list of all configured
- fonts. Its class name is: org.apache.fop.tools.fontlist.FontListMain.
- Run it with the "-?" parameter to get help for the various options.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1/fotree/disabled-testcases.xml b/src/documentation/content/xdocs/1.1/fotree/disabled-testcases.xml
deleted file mode 100644
index 196eafcc4..000000000
--- a/src/documentation/content/xdocs/1.1/fotree/disabled-testcases.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
- demo test failure
- demo-test-failure.fo
-
-
-
- Markers and core function evaluation
- from-table-column_marker.fo
- The code currently evaluates this function according to the column in which the
- marker appears in the source document, rather than the column it is retrieved in.
-
-
diff --git a/src/documentation/content/xdocs/1.1/graphics.xml b/src/documentation/content/xdocs/1.1/graphics.xml
deleted file mode 100644
index b1653443a..000000000
--- a/src/documentation/content/xdocs/1.1/graphics.xml
+++ /dev/null
@@ -1,590 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Graphics Formats
- $Revision$
-
-
-
- Introduction
-
- Some noteworthy features of the image handling subsystem are:
-
-
-
- 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.
-
-
- Some bitmap images are not converted to a standardized 24 bit RGB image but are
- instead handled in their native format.
-
-
- A plug-in mechanism offers a possibility to add support for new formats without changing
- the FOP's source code.
-
- The table below summarizes the theoretical support for graphical formats
- within FOP. In other words, within the constraints of the limitations listed here,
- these formats should work. However, many of them have not been tested,
- and there may be limitations that have not yet been discovered or documented.
- The packages needed to support some formats are not included in the FOP distribution
- and must be installed separately. Follow the links in the "Support Through" columns
- for more details.
-
"(X)" means restricted support. Please see the details below.
-
- [1]: Requires the presence of JAI Image I/O Tools
- (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.
-
-
-
- JAI Image I/O Tools is not the same as the
- JAI library! The
- former simply exposes JAI's codecs using the Image I/O API but does not include all
- the image manipulation functionality.
-
-
- Map of supported image formats by output format
-
- 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:
-
- XML Graphics Commons supports a number
- of graphic file formats natively as basic functionality: all bitmap formats for which
- there are Image I/O codecs available (JPEG, PNG, GIF, TIFF, etc.), EPS and EMF.
-
-
-
- FOP Native
-
- FOP has no native image plug-ins for the image loading framework of its own but currently
- hosts the Batik-dependent SVG and WMF plug-ins until they can be moved to
- Apache Batik.
-
-
-
- Apache Batik
-
- Apache Batik will later receive the
- SVG and WMF plug-ins for the image loading framework that are currently hosted inside
- FOP.
-
-
- Current FOP distributions include a distribution of the
- Apache Batik.
- Because Batik's API changes frequently, it is highly recommended that you use the
- version that ships with FOP, at least when running FOP.
-
- Batik must be run in a graphical environment.
-
- Batik must be run in a graphical environment.
- It uses AWT classes for rendering SVG, which in turn require an X server on Unixish
- systems. If you run a server without X, or if you can't connect to the X server due to
- security restrictions or policies (a so-called "headless" environment), SVG rendering
- will fail.
-
-
Here are some workarounds:
-
-
- Start Java with the -Djava.awt.headless=true command line option.
-
-
- Install an X server which provides an in-memory framebuffer without actually using a
- screen device or any display hardware. One example is Xvfb.
-
-
- Install a toolkit which emulates AWT without the need for an underlying X server. One
- example is the PJA toolkit, which is free
- and comes with detailed installation instructions.
-
-
-
-
- Image I/O
-
- The image loading framework in XML Graphics Commons
- provides a wrapper to load images through the
- JDK's Image I/O API (JSR 015).
- Image I/O allows to dynamically add additional image codecs. An example of such an
- add-on library are the
- JAI Image I/O Tools
- available from Sun.
-
-
-
-
- Details on image formats
-
- BMP
-
- BMP images are supported through an Image I/O codec. There may be limitations of the
- codec which are outside the control of Apache FOP.
-
-
-
- EMF
-
- Windows Enhanced Metafiles (EMF) are only supported in RTF output where they are
- embedded without decoding.
-
-
-
- EPS
-
Apache FOP allows to use EPS files when generating PostScript output only.
-
- Other output targets can't be supported at the moment because
- FOP lacks a PostScript interpreter. Furthermore, FOP is currently not able
- to parse the preview bitmaps sometimes contained in EPS files.
-
-
-
- GIF
-
- GIF images are supported through an Image I/O codec. Transparency is supported but
- not guaranteed to work with every output format.
-
-
-
- JPEG
-
- FOP native support (i.e. the handling of undecoded images) of JPEG does not include all
- variants, especially those containing unusual color lookup tables and color profiles.
- If you have trouble with a JPEG image in FOP, try opening it with an image processing
- program (such as Photoshop or Gimp) and then saving it. Specifying 24-bit color output
- may also help. For the PDF and PostScript renderers most JPEG images can be passed
- through without decompression. User reports indicate that grayscale, RGB, and
- CMYK color spaces are all rendered properly. However, for other output formats, the
- JPEG images have to be decompressed. Tests have shown that there are some limitation
- in some Image I/O codecs concerning images in the CMYK color space. Work-arounds are
- in place but may not always work as expected.
-
-
-
- PNG
-
- PNG images are supported through an Image I/O codec. Transparency is supported but
- not guaranteed to work with every output format.
-
-
-
- SVG
-
- Introduction
-
FOP uses Apache Batik for SVG support.
- This format can be handled as an fo:instream-foreign-object or in a separate
- file referenced with fo:external-graphic.
-
- Batik's SVG Rasterizer utility may also be used to convert standalone SVG
- documents into PDF. For more information please see the
- SVG Rasterizer documentation
- on the Batik site.
-
-
-
- Placing SVG Graphics into PDF
-
- The SVG is rendered into PDF by using PDF commands to draw and fill
- lines and curves. This means that the graphical objects created with
- this remain as vector graphics. The same applies to PostScript output.
- For other output formats the SVG graphic may be converted to a bitmap
- image.
-
-
- There are a number of SVG things that cannot be converted directly into
- PDF. Parts of the graphic such as effects, patterns and images are inserted
- into the PDF as a raster graphic. The resolution of these raster images can
- be controlled through the "target resolution" setting in the
- configuration.
-
- Currently transparency is limited in PDF so some SVG images that
- contain effects or graphics with transparent areas may not be displayed
- correctly.
-
-
-
- Placing SVG Text into PDF and PostScript
-
If possible, Batik will use normal PDF or PostScript text when inserting text. It does
- this by checking if the text can be drawn normally and the font is
- supported. This example svg text.svg /
- text.pdf / text.png
- shows how various types and effects with text are handled.
- Note that SVG font support is not yet implemented. Furthermore, text handling in
- PostScript output is inferior to PDF output - more text will be painted as shapes in
- PS than in PDF.
-
-
- When there's no support to paint text using native text operations,
- text is converted and drawn as a set of shapes by Batik, using the
- stroking text painter. This means that a typical character will
- have about 10 curves (each curve consists of at least 20 characters).
- This can make the output files large and when it is viewed the
- viewer may not normally draw those fine curves very well (In Adobe Acrobat, turning on
- "Smooth Line Art" in the preferences will fix this). Copy/paste functionality
- will not be supported in this case.
- If the text is inserted into the output file using the inbuilt text commands
- it will use a single character.
-
-
- Note that because SVG text can be rendered as either text or a vector graphic, you
- may need to consider settings in your viewer for both. The Acrobat viewer has both
- "smooth line art" and "smooth text" settings that may need to be set for SVG images
- to be displayed nicely on your screen (see Edit / Preferences / Display).
- This setting will not affect the printing of your document, which should be OK in
- any case, but will only affect the quality of the screen display.
-
-
-
- Font selection notes
-
- Apache Batik uses the AWT/Java2D subsystem as font source while FOP has its own font
- subsystem. Great care has been taken that font selection does the best possible choices.
- But it must be noted when creating PDF or PostScript that a font used in SVG graphics
- needs to be registered with the operating system as well as in FOP's configuration.
- By using FOP's font auto-detection, you simply have to install the font in the operating
- system and not care about anything else. This is less of an issue if you create
- formats like TIFFs, PNGs or PCL because in these cases SVG graphics are usually rendered
- to bitmaps which means that on both sides (Batik and FOP), AWT/Java2D is used as the
- single font source.
-
-
- Whenever an SVG is converted into a PDF or PostScript file, the font that has been used
- inside Batik has to be mapped to a font used by the actual output format. Features like
- font substitution in FOP may need to be taken into account but can also be an advantage
- when working around font mapping issues. Like for XSL-FO content, you'll get a warning
- if a particular font could not be found and had to be substituted, or if a particular
- glyph is missing in a font.
-
-
-
- Scaling
-
- Currently, SVG images are rendered with the dimensions specified in the SVG
- file, within the viewport specified in the fo:external-graphic element.
- For everything to work properly, the two should be equal. The SVG standard leaves
- this issue as an implementation detail. Additional scaling options are available
- through XSL-FO means.
-
-
- If you use pixels to specify the size of an SVG graphic the "source resolution" setting
- in the configuration will be used to determine the
- size of a pixel. The use of pixels to specify sizes is discouraged as they may
- be interpreted differently in different environments.
-
-
-
- Known Problems
-
-
- Soft mask transparency is combined with white so that it looks better
- on PDF 1.3 viewers but this causes the soft mask to be slightly lighter
- or darker on PDF 1.4 viewers.
-
-
- There is some problem with a gradient inside a pattern which may cause a PDF
- error when viewed in Acrobat 5.
-
-
- Text is not always handled correctly, it may select the wrong font
- especially if characters have multiple fonts in the font list.
-
-
- Uniform transparency for images and other SVG elements that are converted
- into a raster graphic are not drawn properly in PDF. The image is opaque.
-
-
-
-
-
- TIFF
-
- FOP can embed TIFF images without decompression into PDF, PostScript and AFP if they
- have either CCITT T.4, CCITT T.6, or JPEG compression. Otherwise, a TIFF-capable
- Image I/O codec is necessary for decoding the image.
-
-
- There may be some limitation concerning images in the CMYK color space.
-
-
-
- WMF
-
- Windows Metafiles (WMF) are supported through classes in
- Apache Batik. At the moment, support
- for this format is experimental and may not always work as expected.
-
-
-
-
- Graphics Resolution
-
- Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution
- values. FOP tries to use this resolution information whenever possible to determine
- the image's intrinsic size. This size is used during the layout process when it is not
- superseded by an explicit size on fo:external-graphic (content-width and content-height
- properties).
-
-
- Please note that not all images contain resolution information. If it's not available
- the source resolution set on the FopFactory (or through the user configuration XML) is used.
- The default here is 72 dpi.
-
-
- Bitmap images are generally embedded into the output format at their original resolution
- (as is). No resampling of the image is performed. Explicit resampling is on our wishlist,
- but hasn't been implemented, yet. Bitmaps included in SVG graphics may be resampled to
- the resolution specified in the "target resolution" setting in the
- configuration if SVG filters are applied. This can be
- used as a work-around to resample images in FO documents.
-
-
-
- Page selection for multi-page formats
-
- 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:
- <uri>#page=<nr>
- (for example: http://localhost/images/myimage.tiff#page=3)
-
-
-
- Image caching
-
- FOP caches images between runs. There is one cache per FopFactory instance. The URI is
- used as a key to identify images which means that when a particular URI appears again,
- the image is taken from the cache. If you have a servlet that generates a different
- image each time it is called with the same URI you need to use a constantly
- changing dummy parameter on the URI to avoid caching.
-
-
- The image cache has been improved considerably in the redesigned code. Therefore,
- resetting the image cache should be a thing of the past. If you
- still experience OutOfMemoryErrors, please notify us.
-
-
- If all else fails, the image cache can be cleared like this:
- fopFactory.getImageManager().getCache().clearCache();
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1/hyphenation.xml b/src/documentation/content/xdocs/1.1/hyphenation.xml
deleted file mode 100644
index e6f666826..000000000
--- a/src/documentation/content/xdocs/1.1/hyphenation.xml
+++ /dev/null
@@ -1,237 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Hyphenation
- $Revision$
-
-
-
- Hyphenation Support
-
- Introduction
-
Apache⢠FOP uses Liang's hyphenation algorithm, well known from TeX. It needs
- language specific pattern and other data for operation.
- If you have made improvements to an existing Apache⢠FOP hyphenation pattern,
- or if you have created one from scratch, please consider contributing these
- to OFFO so that they can benefit other FOP users as well.
- Please inquire on the FOP User
- mailing list.
-
-
- License Issues
-
Many of the hyphenation files distributed with TeX and its offspring are
- licenced under the LaTeX
- Project Public License (LPPL), which prevents them from being
- distributed with Apache software. The LPPL puts restrictions on file names
- in redistributed derived works which we feel can't guarantee. Some
- hyphenation pattern files have other or additional restrictions, for
- example against use for commercial purposes.
-
Although Apache FOP cannot redistribute hyphenation pattern files that do
- not conform with its license scheme, that does not necessarily prevent users
- from using such hyphenation patterns with FOP. However, it does place on
- the user the responsibility for determining whether the user can rightly use
- such hyphenation patterns under the hyphenation pattern license.
- The user is responsible to settle license issues for hyphenation
- pattern files that are obtained from non-Apache sources.
-
-
- Sources of Custom Hyphenation Pattern Files
-
The most important source of hyphenation pattern files is the
- CTAN TeX
- Archive.
-
-
- Installing Custom Hyphenation Patterns
-
To install a custom hyphenation pattern for use with FOP:
-
-
Convert the TeX hyphenation pattern file to the FOP format. The FOP
- format is an xml file conforming to the DTD found at
- {fop-dir}/hyph/hyphenation.dtd.
-
Name this new file following this schema:
- languageCode_countryCode.xml. The country code is
- optional, and should be used only if needed. For example:
-
-
en_US.xml would be the file name for American
- English hyphenation patterns.
-
it.xml would be the file name for Italian
- hyphenation patterns.
-
- The language and country codes must match the XSL-FO input, which
- follows ISO
- 639 (languages) and ISO
- 3166 (countries). NOTE: The ISO 639/ISO 3166 convention is that
- language names are written in lower case, while country codes are written
- in upper case. FOP does not check whether the language and country specified
- in the FO source are actually from the current standard, but it relies
- on it being two letter strings in a few places. So you can make up your
- own codes for custom hyphenation patterns, but they should be two
- letter strings too (patches for proper handling extensions are welcome)
-
There are basically three ways to make the FOP-compatible hyphenation pattern
- file(s) accessible to FOP:
-
-
Download the precompiled JAR from OFFO
- and place it either in the {fop-dir}/lib directory, or
- in a directory of your choice (and append the full path to the JAR to
- the environment variable FOP_HYPHENATION_PATH).
-
Download the desired FOP-compatible hyphenation pattern file(s) from
- OFFO,
- and/or take your self created hyphenation pattern file(s),
-
-
place them in the directory {fop-dir}/hyph,
-
or place them in a directory of your choice and set the Ant variable
- user.hyph.dir to point to that directory (in
- build-local.properties),
-
- and run Ant with build target
- jar-hyphenation. This will create a JAR containing the
- compiled patterns in {fop-dir}/build that will be added to the
- classpath on the next run.
- (When FOP is built from scratch, and there are pattern source file(s)
- present in the directory pointed to by the
- user.hyph.dir variable, this JAR will automatically
- be created from the supplied pattern(s)).
-
Put the pattern source file(s) into a directory of your choice and
- configure FOP to look for custom patterns in this directory, by setting the
- <hyphenation-base>
- configuration option.
-
-
-
-
- Either of these three options will ensure hyphenation is working when using
- FOP from the command-line. If FOP is being embedded, remember to add the location(s)
- of the hyphenation JAR(s) to the CLASSPATH (option 1 and 2) or to set the
- <hyphenation-dir>
- configuration option programmatically (option 3).
-
-
-
-
- Hyphenation Patterns
-
If you would like to build your own hyphenation pattern files, or modify
- existing ones, this section will help you understand how to do so. Even
- when creating a pattern file from scratch, it may be beneficial to start
- with an existing file and modify it. See
- OFFO's Hyphenation page for examples.
- Here is a brief explanation of the contents of FOP's hyphenation patterns:
- The remaining content of this section should be considered "draft"
- quality. It was drafted from theoretical literature, and has not been
- tested against actual FOP behavior. It may contain errors or omissions.
- Do not rely on these instructions without testing everything stated here.
- If you use these instructions, please provide feedback on the
- FOP User mailing list, either
- confirming their accuracy, or raising specific problems that we can
- address.
-
-
The root of the pattern file is the <hyphenation-info> element.
-
<hyphen-char>: its attribute "value" contains the character signalling
- a hyphen in the <exceptions> section. It has nothing to do with the
- hyphenation character used in FOP, use the XSLFO hyphenation-character
- property for defining the hyphenation character there. At some points
- a dash U+002D is hardwired in the code, so you'd better use this too
- (patches to rectify the situation are welcome). There is no default,
- if you declare exceptions with hyphenations, you must declare the
- hyphen-char too.
-
<hyphen-min> contains two attributes:
-
-
before: the minimum number of characters in a word allowed to exist
- on a line immediately preceding a hyphenated word-break.
-
after: the minimum number of characters in a word allowed to exist
- on a line immediately after a hyphenated word-break.
-
- This element is unused and not even read. It should be considered a
- documentation for parameters used during pattern generation.
-
-
<classes> contains whitespace-separated character sets. The members
- of each set should be treated as equivalent for purposes of hyphenation,
- usually upper and lower case of the same character. The first character
- of the set is the canonical character, the patterns and exceptions
- should only contain these canonical representation characters (except
- digits for weight, the period (.) as word delimiter in the patterns and
- the hyphen char in exceptions, of course).
-
<exceptions> contains whitespace-separated words, each of which
- has either explicit hyphen characters to denote acceptable breakage
- points, or no hyphen characters, to indicate that this word should
- never be hyphenated, or contain explicit <hyp> elements for specifying
- changes of spelling due to hyphenation (like backen -> bak-ken or
- Stoffarbe -> Stoff-farbe in the old german spelling). Exceptions override
- the patterns described below. Explicit <hyp> declarations don't work
- yet (patches welcome). Exceptions are generally a bit brittle, test
- carefully.
-
<patterns> includes whitespace-separated patterns, which are what
- drive most hyphenation decisions. The characters in these patterns are
- explained as follows:
-
-
non-numeric characters represent characters in a sub-word to be
- evaluated
-
the period character (.) represents a word boundary, i.e. either
- the beginning or ending of a word
-
numeric characters represent a scoring system for indicating the
- acceptability of a hyphen in this location. Odd numbers represent an
- acceptable location for a hyphen, with higher values overriding lower
- inhibiting values. Even numbers indicate an unacceptable location, with
- higher values overriding lower values indicating an acceptable position.
- A value of zero (inhibiting) is implied when there is no number present.
- Generally patterns are constructed so that valuse greater than 4 are rare.
- Due to a bug currently patterns with values of 8 and greater don't
- have an effect, so don't wonder.
-
- Here are some examples from the English patterns file:
-
-
Knuth (The TeXBook, Appendix H) uses the example hach4, which indicates that it is extremely undesirable to place a hyphen after the substring "hach", for example in the word "toothach-es".
-
.leg5e indicates that "leg-e", when it occurs at the beginning of a word, is a very good place to place a hyphen, if one is needed. Words like "leg-end" and "leg-er-de-main" fit this pattern.
-
- Note that the algorithm that uses this data searches for each of the word's substrings in the patterns, and chooses the highest value found for letter combination.
-
-
-
If you want to convert a TeX hyphenation pattern file, you have to undo
- the TeX encoding for non-ASCII text. FOP uses Unicode, and the patterns
- must be proper Unicode too. You should be aware of the XML encoding issues,
- preferably use a good Unicode editor.
-
Note that FOP does not do Unicode character normalization. If you use
- combining chars for accents and other character decorations, you must
- declare character classes for them, and use the same sequence of base character
- and combining marks in the XSLFO source, otherwise the pattern wouldn't match.
- Fortunately, Unicode provides precomposed characters for all important cases
- in common languages, until now nobody run seriously into this issue. Some dead
- languages and dialects, especially ancient ones, may pose a real problem
- though.
-
If you want to generate your own patterns, an open-source utility called
- patgen can be used to assist in creating pattern files from dictionaries.
- It is available in many Unix/Linux distributions and every TeX distribution.
- Pattern creation for languages like english or german is an art. Read
- Frank Liang's original paper "Word
- Hy-phen-a-tion by Com-pu-ter" (yes, with hyphens) for details.
- The original patgen.web source, included in the TeX source distributions,
- contains valuable comments, unfortunately technical details often obscure the
- high level issues. Another important source of information is
- The
- TeX Book, appendix H (either read the TeX source, or run it through
- TeX to typeset it). Secondary articles, for example the works by Petr Sojka,
- may also give some much needed insight into problems arising in automated
- hyphenation.
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1/index.xml b/src/documentation/content/xdocs/1.1/index.xml
deleted file mode 100644
index 737203aa9..000000000
--- a/src/documentation/content/xdocs/1.1/index.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP Version 1.1
- $Revision$
-
-
-
- Introduction
-
- This is Version 1.1 of Apache FOP. FOP 1.1 contains many bug
- fixes and a number of improvements, including
- important features such as support for Complex Scripts
- (e.g., Arabic, Hebrew, Indic, and Southeast Asian scripts). To see what has changed since the last release,
- please visit Release Notes.
-
-
- This release implements a substantial subset of the W3C XSL-FO 1.1
- Recommendation. For a detailed overview of FOP's
- compliance with this recommendation, see Compliance.
-
-
-
- Upgrading from an earlier version
-
- If you're upgrading to this version from an earlier version of FOP, please read the
- information on Upgrading!
-
-
-
- Download
-
- To download this version, please visit Downloading.
-
-
-
-
diff --git a/src/documentation/content/xdocs/1.1/intermediate.xml b/src/documentation/content/xdocs/1.1/intermediate.xml
deleted file mode 100644
index 171ae4e6a..000000000
--- a/src/documentation/content/xdocs/1.1/intermediate.xml
+++ /dev/null
@@ -1,331 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Intermediate Format
- $Revision$
-
-
-
- Please note that the intermediate formats described here are
- advanced features and can be ignored by most users of Apache FOP.
-
-
- Introduction
-
- 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
- XSL-FO specification in chapter 1.1.2.
- 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).
-
-
- 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.
-
-
- 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.
-
-
-
- Which Intermediate Format to choose?
-
- 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:
-
-
- Area Tree XML (AT XML)
-
-
1:1 representation of FOP's area tree in XML.
-
Contains more structure information than the new intermediate format.
-
Used in FOP's layout engine test suite for regression testing.
-
-
-
- Intermediate Format (IF)
-
-
Highly optimized for speed.
-
Smaller XML files.
-
Easier to post-process.
-
XML Schema is available.
-
- Recommended for use cases where documents are formatted concurrently and later
- concatenated to a single print job.
-
-
-
-
- More technical information about the two formats can be found on the
- FOP Wiki.
-
-
-
- Architectural Overview
-
-
-
- Usage of the Area Tree XML format (AT XML)
-
- As already mentioned, the area tree XML format is generated by using the
- XMLRenderer (MIME type: application/X-fop-areatree).
- So, you basically set the right MIME type for the output format and process your FO files
- as if you would create a PDF file.
-
-
- However, there is an important detail to consider: The
- various Renderers don't all use the same font sources. To be able to create the right
- area tree for the ultimate output 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.
-
-
- The second step is to reparse the file using the AreaTreeParser 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
- examples/embedding
- directory in the FOP distribution.
-
-
- The basic pattern to parse the area tree XML format looks like this:
-
-
-
- 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
- endDocument() on the AreaTreeModel. This lets the Renderer know that the processing
- is now finished.
-
-
- The area tree XML format can also be used from the command-line
- by using the "-atin" parameter for specifying the area tree XML as input file. You can also
- specify a "mimic renderer" by inserting a MIME type between "-at" and the output file.
-
-
- Concatenating Documents
-
- This initial example is obviously not very useful. It would be faster to create the PDF file
- directly. As the ExampleConcat.java
- example shows you can easily parse multiple 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.
-
-
-
- Modifying Documents
-
- 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.
-
-
- The area tree XML format is sensitive to changes in whitespace. If you're not careful,
- the modified file may not render correctly.
-
-
-
- Advanced Use
-
- 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 setTransformerHandler() on
- XMLRenderer to give the XMLRenderer your own TransformerHandler instance in case you would like to
- do custom serialization (to a W3C DOM, for example) and/or to directly modify the area tree using
- XSLT. The AreaTreeParser on the other side allows you to retrieve a ContentHandler instance where
- you can manually send SAX events to to start the parsing process (see getContentHandler()).
-
-
-
-
- Usage of the Intermediate Format (IF)
-
- The Intermediate Format (IF) is generated by the IFSerializer
- (MIME type: application/X-fop-intermediate-format).
- 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.
-
-
- The IFSerializer is an implementation of the IFDocumentHandler and
- IFPainter interfaces. The IFRenderer class is responsible
- for converting FOP's area tree into calls against these two interfaces.
-
-
-
- IFDocumentHandler: This interface is used on the document-level and defines the
- overall structure of the Intermediate Format.
-
-
- IFPainter: This interface is used to generate graphical page content like text, images
- and borders.
-
-
-
- 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.
-
-
- The second step is to reparse the file using the IFParser 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
- examples/embedding
- directory in the FOP distribution.
-
-
- The basic pattern to parse the intermediate format looks like this:
-
-
-
- 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.
-
-
- Concatenating Documents
-
- This initial example is obviously not very useful. It would be faster to create the PDF file
- directly (without the intermediate step). As the
- ExampleConcat.java
- 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.
-
-
-
- Modifying Documents
-
- 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.
-
- 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.
-
-
-
- Advanced Use
-
- 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 getContentHandler()).
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1/known-issues.xml b/src/documentation/content/xdocs/1.1/known-issues.xml
deleted file mode 100644
index c0107317d..000000000
--- a/src/documentation/content/xdocs/1.1/known-issues.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
- Support for Unicode characters outside of the Base Multilingual Plane (BMP), i.e., characters
- whose code points are greater than 65535, is not yet implemented.
- See bug 51843.
-
-
- The writing-mode property does not produce the expected behavior when specified on
- fo:simple-page-master or fo:region-* elements.
- See bug 53276.
-
-
- Support for Devanagari and other Indic scripts is not yet complete.
-
-
- Use of Unicode U+200C ZERO WIDTH NON-JOINER (ZWNJ) or U+200D ZERO WIDTH JOINER (ZWJ)
- does not prevent or force contextual substitution, respectively, when used with Arabic script.
-
-
- Use of Unicode U+200C ZERO WIDTH NON-JOINER (ZWNJ) or U+200D ZERO WIDTH JOINER (ZWJ)
- does not affect conjunct formation or other special behavior prescribed when used with Indic scripts.
-
-
- Support for automatic line breaking at orthographic syllable segment boundaries in Indic
- or Southeast Asian scripts is not yet available. In the mean time, use U+200B ZERO WIDTH SPACE (ZWSP).
-
-
- Complex script content is presently supported only with AT, IF, and PDF output formats.
-
-
- When complex script text encounters an fo:inline or fo:character boundary,
- contextual substitution and ligature formation will not occur across the boundary. This prevents,
- for example, applying a different color to an Arabic Letter within an Arabic word, unless that letter
- is a non-joining letter (on both sides).
-
-
diff --git a/src/documentation/content/xdocs/1.1/knownissues_overview.xml b/src/documentation/content/xdocs/1.1/knownissues_overview.xml
deleted file mode 100644
index a8b9e9b94..000000000
--- a/src/documentation/content/xdocs/1.1/knownissues_overview.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Known Issues
- $Revision$
-
-
-
- Known issues
-
- This page lists currently known issues in the current release.
-
-
-
- For additional information on known issues in Apache⢠FOP, please have a look at the following pages, too:
-
- Apache⢠FOP has an extensive automated testing infrastructure. Parts of this infrastructure are several
- sets of test cases. When a test case is listed in disabled-testcases.xml it is disabled in the JUnit
- tests during the normal build process. This indicates a problem in the current codebase. When a bug is
- fixed or a missing feature is added the entry for the relevant test case(s) are removed.
-
-
- FO Tree
-
- This section lists disabled test cases in the test suite for the FO tree tests, at the time
- of the release.
-
-
-
-
- Layout Engine
-
- This section lists disabled test cases in the test suite for the layout engine tests, at the
- time of the release.
-
-
-
-
- Other known issues
-
This section lists some other issues that post-date the release of FOP 1.0. For known issues that pre-date FOP 1.0, see
- older bugs that remain open.
- For all open issues that post-date FOP 1.0, see
- newer bugs that remain open.
-
-
-
-
-
-
-
diff --git a/src/documentation/content/xdocs/1.1/layoutengine/disabled-testcases.xml b/src/documentation/content/xdocs/1.1/layoutengine/disabled-testcases.xml
deleted file mode 100644
index 5208fa91d..000000000
--- a/src/documentation/content/xdocs/1.1/layoutengine/disabled-testcases.xml
+++ /dev/null
@@ -1,223 +0,0 @@
-
-
-
-
-
-
-
- Auto-height block-containers produce fences
- block-container_space-before_space-after_3.xml
- Block-containers with no height currently don't
- create a fence for spaces as they should (they behave like a
- normal block).
-
-
- font-stretch NYI
- block_font-stretch.xml
- Font-stretch is not implemented, yet.
-
-
- linefeed-treatment
- block_linefeed-treatment.xml
- Preserved linefeeds in a fo:character are not handled
- correctly.
-
-
- white-space-treatment
- block_white-space-treatment_3.xml
- White space handling incorrectly stops at fo:inline
- boundaries when it comes to formatter generated line breaks.
-
-
- Empty blocks produce fences
- block_space-before_space-after_8.xml
- An empty block currently produces a fence for
- stacking constraints which it shouldn't.
-
-
- block white-space nbsp 2
- block_white-space_nbsp_2.xml
- The nbsp given as an fo:character is not adjustable and therefore
- the justification does not work in this case.
-
-
- block word-spacing
- block_word-spacing.xml
- Word-spacing may not work as expected.
-
-
- block word-spacing text-align justify
- block_word-spacing_text-align_justify.xml
- Word-spacing may not work as expected.
-
-
- external-graphic don't shrink
- external-graphic_oversized.xml
- Images currently don't shrink so they fit on a page
- when they are too big and shrinking is allowed to
- happen (min/opt/max).
-
-
- Test case with HTTP URL
- external-graphic_src_uri.xml
- Doesn't work behind a proxy which requires
- authorization.
-
-
- Space Resolution in foot note area
- footnote_space-resolution.xml
- Space resolution does not work between footnote
- regions.
-
-
- NPE for table inside an inline
- inline_block_nested_3.xml
- Placing a table as a child of an fo:inline produces a
- NullPointerException.
-
-
- inline-container is not implemented, yet.
- inline-container_block_nested.xml
- inline-container is not implemented, yet. Content of an
- inline-container will get swallowed. The test case contains no checks.
-
-
- inline-container is not implemented, yet.
- inline-container_border_padding.xml
- inline-container is not implemented, yet. Content of an
- inline-container will get swallowed.
-
-
- inline letter-spacing
- inline_letter-spacing.xml
- Letter-spacing may not work as
- expected within fo:inline.
-
-
- inline word-spacing
- inline_word-spacing.xml
- Word-spacing may not work as expected within
- fo:inline.
-
-
- inline word-spacing text-align justify
- inline_word-spacing_text-align_justify.xml
-
-
-
- leader-alignment NYI
- leader-alignment.xml
- Leader-alignment is not yet
- implemented.
-
-
- leader-pattern="use-content": Problem with line height
- leader_leader-pattern_use-content_bug.xml
- Line height is not correctly calculated for
- use-content leaders whose height is larger than the rest of the
- line.
- http://www.nabble.com/leaders-with-leader-pattern%3D%22use-content%22-t546244.html
-
-
- Page breaking doesn't deal with IPD changes
- page-breaking_4.xml
- Page breaking currently doesn't support changing available IPD
- between pages of a single page-sequence. Element list generation has to be reset to
- redetermine line breaks in this case.
-
-
- Overflow handing is incomplete
- page-breaking_6.xml
- Line breaking is not 100% correct when there's too little space.
- Overflows are not detected and warned.
-
-
- Indefinite page height handling is imcomplete
- page-height_indefinite_simple.xml
- A RuntimeException is thrown for a page of indefinite height. Lots of warnings.
-
-
- page-number-citation: Problem with background-image
- page-number-citation_background-image.xml
- Background-images on page-number-citations are not
- placed correctly.
-
-
- IDs are not working on all FO elements
- page-number-citation_complex_1.xml
- The "id" attributes are not properly handled for all block-level FO elements.
-
-
- IDs are not working on all FO elements
- page-number-citation_complex_2.xml
- The "id" attributes are not properly handled for all inline-level FO elements.
-
-
- Footnotes in multi-column documents
- region-body_column-count_footnote.xml
- Footnotes may overlap with text of the region-body in
- multi-column documents.
-
-
- Column Balancing problems
- region-body_column-count_balance_4col.xml
- Situation in a 4-column document where the column balancing doesn't work and even causes some
- content to disappear.
-
-
- Column Balancing problems
- region-body_column-count_bug36356.xml
- Column balancing doesn't work as expected.
-
-
- table-cell empty area with marker.xml
- table-cell_empty_area_with_marker.xml
- A table-cell producing an empty area does currently not add any markers to a page.
- See TODO entry in AreaAdditionUtil.
-
-
- Border conditionality on table
- table_border-width_conditionality.xml
- The code should be ok, but the test case uses shorthands and therefore
- is probably not expressing the indended outcome according to the spec. The test
- case should be revisited.
-
-
- Soft hyphen with normal hyphenation enabled
- block_shy_linebreaking_hyph.xml
- A soft hyphen should be a preferred as break compared to a
- normal hyphenation point but is not.
-
-
- Page-keep not respected in multi-column layout
- keep_within-page_multi-column_overflow.xml
- The block should cause overflow in the
- last column on the page, rather than be broken.
-
-
- Block Container Reference Orientation Bug
- block-container_reference-orientation_bug36391.xml
- An assert is failing
-
-
- Writing mode problems
- simple-page-master_writing-mode_rl_region-body_writing-mode-lr.xml
- Test erroneously depends upon incorrect implementation of writing-mode trait
- derivation on fo:region-*.
-
-
diff --git a/src/documentation/content/xdocs/1.1/metadata.xml b/src/documentation/content/xdocs/1.1/metadata.xml
deleted file mode 100644
index 5d4185533..000000000
--- a/src/documentation/content/xdocs/1.1/metadata.xml
+++ /dev/null
@@ -1,243 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Metadata
-
-
-
- Overview
-
- 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
- XMP (eXtensible Metadata Platform, specified by Adobe).
- 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.
-
-
-
- Embedding XMP in an XSL-FO document
-
- 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.
-
-
- Document-level metadata can be specified in the fo:declarations element.
- XMP specification recommends to use x:xmpmeta, rdf:RDF, and
- rdf:Description elements as shown in example below. Both
- x:xmpmeta and rdf:RDF elements are recognized as the top-level
- element introducing an XMP fragment (as per the XMP specification).
-
-
- Example
-
-
- fo:declarationsmust be declared after
- fo:layout-master-set and before the first page-sequence.
-
-
-
-
- Implementation in Apache FOP
-
- Currently, XMP support is only available for PDF output.
-
-
- 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.
-
-
- 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.
-
-
- The mapping between the Info and the Metadata object used by Apache FOP comes from
- the PDF/A-1 specification.
- For convenience, here's the mapping table:
-
-
-
-
Document information dictionary
-
XMP
-
-
-
Entry
-
PDF type
-
Property
-
XMP type
-
Category
-
-
-
Title
-
text string
-
dc:title
-
Text
-
External
-
-
-
Author
-
text string
-
dc:creator
-
seq Text
-
External
-
-
-
Subject
-
text string
-
dc:description["x-default"]
-
Text
-
External
-
-
-
Keywords
-
text string
-
pdf:Keywords
-
Text
-
External
-
-
-
Creator
-
text string
-
xmp:CreatorTool
-
Text
-
External
-
-
-
Producer
-
text string
-
pdf:Producer
-
Text
-
Internal
-
-
-
CreationDate
-
date
-
xmp:CreationDate
-
Date
-
Internal
-
-
-
ModDate
-
date
-
xmp:ModifyDate
-
Date
-
Internal
-
-
-
- "Internal" in the Category column means that the user should not set this value.
- It is set by the application.
-
-
- The "Subject" used to be mapped to dc:subject in the initial publication of
- PDF/A-1 (ISO 19005-1). In the
- Technical Corrigendum 1
- this was changed to map to dc:description["x-default"].
-
-
- Namespaces
-
- Metadata is made of property sets where each property set uses a different namespace URI.
-
-
- 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:
-
-
-
-
Set/Schema
-
Namespace Prefix
-
Namespace URI
-
-
-
Dublin Core
-
dc
-
http://purl.org/dc/elements/1.1/
-
-
-
XMP Basic
-
xmp
-
http://ns.adobe.com/xap/1.0/
-
-
-
Adobe PDF Schema
-
pdf
-
http://ns.adobe.com/pdf/1.3/
-
-
-
- Please refer to the XMP Specification
- for information on other metadata namespaces.
-
-
- 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.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1/output.xml b/src/documentation/content/xdocs/1.1/output.xml
deleted file mode 100644
index cabbbb0fa..000000000
--- a/src/documentation/content/xdocs/1.1/output.xml
+++ /dev/null
@@ -1,1401 +0,0 @@
-
-
-
-
-
-
-
- Apache⢠FOP Output Formats
- $Revision$
-
-
-
-
-
-
-
-
- Apache⢠FOP supports multiple output formats by using a different renderer for each format.
- The renderers do not all have the same set of capabilities, sometimes because of
- the output format itself, sometimes because some renderers get more development
- attention than others.
-
-
- General Information
-
- Fonts
-
- Most FOP renderers use a FOP-specific system for font registration.
- However, the Java2D/AWT and print renderers use the Java AWT package, which gets its
- font information from the operating system registration.
- This can result in several differences, including actually using different fonts,
- and having different font metrics for the same font.
- The net effect is that the layout of a given FO document can be quite different between
- renderers that do not use the same font information.
-
-
- 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.
-
-
- 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
- intermediate format. 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):
-
-
-
- Produce an IF file: fop -fo myfile.fo -at application/pdf myfile.at.xml
- 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.
-
-
Render to a PDF file: fop -atin myfile.at.xml -pdf myfile.pdf
-
Render to a Java2D-based renderer:
-
-
fop -atin myfile.at.xml -print
-
fop -atin myfile.at.xml -awt
-
fop -atin myfile.at.xml -tiff myfile.tiff
-
-
-
-
-
- Output to a Printer or Other Device
-
- The most obvious way to print your document is to use the FOP
- print renderer, which uses the Java2D API (AWT).
- However, you can also send output from the Postscript renderer directly to a Postscript
- device, or output from the PCL renderer directly to a PCL device.
-
-
- Here are Windows command-line examples for Postscript and PCL:
-
-
-
-
- Here is some Java code to accomplish the task in UNIX:
-
-
-
- Set the output MIME type to "application/x-pcl" (MimeConstants.MIME_PCL) and
- it happily sends the PCL to the UNIX printer queue.
-
-
-
-
- PDF
-
- PDF is the best supported output format. It is also the most accurate
- with text and layout. This creates a PDF document that is streamed out
- as each page is rendered. This means that the internal page index
- information is stored near the end of the document.
- The PDF version supported is 1.4. PDF versions are forwards/backwards
- compatible.
-
-
- Note that FOP does not currently support PDF/A-1a.
- Support for Tagged PDF, PDF/A-1b
- and PDF/X has recently been added, however.
-
-
- Fonts
-
- PDF has a set of fonts that are always available to all PDF viewers;
- to quote from the PDF Specification:
-
- "PDF prescribes a set of 14 standard fonts that can be used without prior
- definition.
- These include four faces each of three Latin text typefaces (Courier,
- Helvetica, and Times), as well as two symbolic fonts (Symbol and ITC Zapf
- Dingbats). These fonts, or suitable substitute fonts with the same metrics, are
- guaranteed to be available in all PDF viewer applications."
-
-
-
- Post-processing
-
- FOP does not currently support several desirable PDF features: 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.
-
-
- Another popular post-processing tool is iText,
- which has tools for adding security features, document properties, watermarks, and many
- other features to PDF files.
-
-
- Caveat: iText may swallow PDF bookmarks. But
- Jens Stavnstrup tells us
- that this doesn't happen if you use iText's PDFStamper.
-
-
- Here is some sample code that uses iText to encrypt a FOP-generated PDF. (Note that FOP now
- supports PDF encryption. However the principles for using
- iText for other PDF features are similar.)
-
-
-
- Check the iText tutorial and documentation for setting access flags, password,
- encryption strength and other parameters.
-
-
-
- Watermarks
-
- In addition to the PDF Post-processing options, consider the following workarounds:
-
-
-
- Use a background image for the body region.
-
-
- (submitted by Trevor Campbell) Place an image in a
- region that overlaps the flowing text. For example, make
- region-before large enough to contain your image. Then include a
- block (if necessary, use an absolutely positioned block-container)
- containing the watermark image in the static-content for the
- region-before. Note that the image will be drawn on top of the
- normal content.
-
-
-
-
- Extensions
-
The PDF Renderer supports some PDF specific extensions which can be embedded
- into the input FO document. To use the extensions the appropriate namespace must
- be declared in the fo:root element like this:
-
-
- Embedded Files
-
- It is possible to attach/embed arbitrary files into a PDF file. You can give a name and
- a description of the file. Example:
-
-
-
- pdf:embedded-file must be a child of fo:declarations.
- The "src" property is used to reference the file that is to be embedded. This property
- uses the "uri-specification" datatype from the XSL-FO specification.
- The "filename" property is optional. If it is missing the filename is automatically set
- from the URI/IRI of the "src" property. An optional description can also be added to
- further describe the file attachment.
-
-
- It is also possible to reference an embedded file from an fo:basic-link.
- Use the special "embedded-file:" URI scheme with the filename as single argument after
- the URI scheme. Example:
-
-
-
- Note: Not all PDF Viewers (including some Acrobat Versions) will open the embedded file
- when clicking on the link. In that case, the user will have to open he attachment via
- the separate list of file attachments.
-
-
-
-
-
- PostScript
-
- The PostScript renderer has been brought up to a similar quality as the
- PDF renderer, but may still be missing certain features. It provides good
- support for most text and layout.
- Images and SVG are not fully supported, yet. Currently, the PostScript
- renderer generates PostScript Level 3 with most DSC comments. Actually,
- the only Level 3 features used are the FlateDecode and DCTDecode
- filter (the latter is used for 1:1 embedding of JPEG images), everything
- else is Level 2.
-
-
- Configuration
-
- The PostScript renderer configuration currently allows the following settings:
-
-
-
- The default value for the "auto-rotate-landscape" setting is "false". Setting it
- to "true" will automatically rotate landscape pages and will mark them as landscape.
-
-
- The default value for the "language-level" setting is "3". This setting specifies
- the PostScript language level which should be used by FOP. Set this to "2"
- only if you don't have a Level 3 capable interpreter.
-
-
- The default value for the "optimize-resources" setting is "false". Setting it
- to "true" will produce the PostScript file in two steps. A temporary file will be
- written first which will then be processed to add only the fonts which were really
- used and images are added to the stream only once as PostScript forms. This will
- reduce file size but can potentially increase the memory needed in the interpreter
- to process.
-
-
- 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.
-
-
- 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.
-
-
- The default value for the "rendering" setting is "quality". Setting it to "size"
- optimizes rendering for smaller file sizes which can involve minor compromises in
- rendering quality. For example, solid borders are then painted as plain rectangles
- instead of the elaborate painting instructions required for mixed-color borders.
-
-
-
- Limitations
-
-
Images and SVG may not be displayed correctly. SVG support is far from being complete. No image transparency is available.
-
Only Type 1 fonts are supported.
-
Multibyte characters are not supported.
-
PPD support is still missing.
-
-
-
-
- PCL
-
- This format is for the Hewlett-Packard PCL printers and other printers
- supporting PCL. It should produce output as close to identical as possible
- to the printed output of the PDFRenderer within the limitations of the
- renderer, and output device.
-
-
- The output created by the PCLRenderer is generic PCL 5, HP GL/2 and PJL.
- This should allow any device fully supporting PCL 5 to be able to
- print the output generated by the PCLRenderer. PJL is used to control the
- print job and switch to the PCL language. PCL 5 is used for text, raster
- graphics and rectangular fill graphics. HP GL/2 is used for more complex
- painting operations. Certain painting operations are done off-screen and
- rendered to PCL as bitmaps because of limitations in PCL 5.
-
- Text or graphics outside the left or top of the printable area are not
- rendered properly. This is a limitation of PCL, not FOP. In general,
- things that should print to the left of the printable area are shifted
- to the right so that they start at the left edge of the printable area.
-
-
- The Helvetica and Times fonts are not well supported among PCL printers
- so Helvetica is mapped to Arial and Times is mapped to Times New. This
- is done in the PCLRenderer, no changes are required in the FO's. The
- metrics and appearance for Helvetica/Arial and Times/Times New are
- nearly identical, so this has not been a problem so far.
-
-
For the non-symbol fonts, the ISO 8859-1 symbol set is used (PCL set "0N").
-
- All fonts available to the Java2D subsystem are usable. The texts are
- painted as bitmap much like the Windows PCL drivers do.
-
-
Multibyte characters are not supported.
-
- At the moment, only monochrome output is supported. PCL5c color extensions
- will only be implemented on demand. Color and grayscale images are converted
- to monochrome bitmaps (1-bit). Dithering only occurs if the JAI image library
- is available.
-
-
- Images are scaled up to the next resolution level supported by PCL (75,
- 100, 150, 200, 300, 600 dpi). For color and grayscale images an even
- higher PCL resolution is selected to give the dithering algorithm a chance
- to improve the bitmap quality.
-
-
- Currently, there's no support for clipping and image transparency, largely
- because PCL 5 has certain limitations.
-
-
-
-
- Configuration
-
- The PCL renderer configuration currently allows the following settings:
-
-
-
- The default value for the "rendering" setting is "speed" which causes borders
- to be painted as plain rectangles. In this mode, no special borders (dotted,
- dashed etc.) are available. If you want support for all border modes, set the
- value to "quality" as indicated above. This will cause the borders to be painted
- as bitmaps.
-
-
- The default value for the "text-rendering" setting is "auto" which paints the
- base fonts using PCL fonts. Non-base fonts are painted as bitmaps through Java2D.
- If the mix of painting methods results in unwelcome output, you can set this
- to "bitmap" which causes all text to be rendered as bitmaps.
-
-
- 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".
-
-
- 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
- supported PCL resolution. Currently, only 300 and 600 dpi are supported which
- should be enough for most use cases. Note that this setting directly affects
- the size of the output file and the print quality.
-
-
-
- Extensions
-
The PCL Renderer supports some PCL specific extensions which can be embedded
- into the input FO document. To use the extensions the appropriate namespace must
- be declared in the fo:root element like this:
-
-
- Page Source (Tray selection)
-
- The page-source extension attribute on fo:simple-page-master allows to
- select the paper tray the sheet for a particular simple-page-master is
- to be taken from. Example:
-
-
-
- Note: the tray number is a positive integer and the value depends on
- the target printer. Not all PCL printers support the same paper trays.
- Usually,
- "1" is the default tray,
- "2" is the manual paper feed,
- "3" is the manual envelope feed,
- "4" is the "lower" tray and
- "7" is "auto-select".
- Consult the technical reference for your printer for all available values.
-
-
-
- Output Bin
-
- The output-bin extension attribute on fo:simple-page-master allows to
- select the output bin into which the printed output should be fed. Example:
-
-
-
- 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.
-
-
-
- Page Duplex Mode
-
- 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:
-
-
-
- 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.
-
-
-
-
-
- AFP
-
- 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).
-
-
- The mapping of XSL-FO elements to the major MO:DCA structures is as follows:
-
-
-
-
XSL-FO element
-
MO:DCA-P object
-
-
-
fo:root
-
Document
-
-
-
fo:page-sequence
-
Page Group
-
-
-
fo:simple-page-master
-
Page
-
-
-
- FOP creates exactly one Document per Printfile with an optional Resource Group at the
- beginning. FOP does not create document indices.
-
- Clipping of text and graphics is not supported.
-
-
- Only IBM outline and raster fonts and to a limited extend the original fonts built into FOP are supported.
- Support for TrueType fonts may be added later.
-
-
-
-
- Deployment in older environments
-
- 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.
-
-
-
- Configuration
-
- Fonts
-
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
- looks like:
-
-
There are 4 font configuration variants supported:
-
-
IBM Raster fonts
-
IBM Outline fonts
-
IBM CID-keyed (Type 0) fonts
-
FOP built-in Base14 fonts
-
-
A typical raster font configuration looks like:
-
-
An outline font configuration is simpler as the individual font size entries are not required.
- However, the characterset definition is now required within the afp-font element.
-
-
- 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).
-
-
- 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.
-
-
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.
-
-
-Note that the value of the encoding attribute in the example is the double-byte encoding 'UnicodeBigUnmarked' (UTF-16BE).
-
-
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 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.
-
-
- By default, all manually configured fonts are embedded, unless they are matched in the
- referenced-fonts section of the configuration file.
- However, the default fonts shown above will not be embedded.
-
-
- For double byte EBCDIC encoded character sets, there is an optional tag that must be set to prevent
- characters from being miscoded. This defaults to "false" if not specified.
-
-
-
- Output Resolution
-
By default the AFP Renderer creates output with a resolution of 240 dpi.
- This can be overridden by the <renderer-resolution/> configuration element. Example:
-
-
-
- Line Width Correction
-
The default line width in AFP is device dependent. This means that a line width specified in, say,
- a SVG source file may not render the way it was intended. The output AFP line with can be corrected
- by the <line-width-correction/> configuration element. Example:
-
-
-
- Images
-
By default the AFP Renderer converts all images to 8 bit grey level.
- This can be overridden by the <images/> configuration element. Example:
-
-
This will put images as RGB images into the AFP output stream. The default setting is:
-
-
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.
-
-
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".
-
- Setting cmyk="true" on the images element will enable CMYK
- colors. This will only have an effect if the color mode is set to "color". Example:
-
-
-
- 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.
-
-
-
- When the boolean attribute pseg (default false) is set to true, non-inline FS11 and FS45 IOCA images are wrapped in page segment.
- This option is provided to support printers/print servers that require this MO:DCA structure.
-
-
-
- Setting the boolean attribute fs45 to true (default false) will force all images to FS45.
-
-
-
- By default, JPEG images are rasterized to a bitmap and the bitmap is included in the AFP doc.
- However it is possible to encode in a lossless way to maintain maximum quality. But due
- to lack of support for compression schemes like LZW (patent concerns), bitmap data is currently
- not compressed resulting in large AFP files. Using the "allow-embedding" attribute on jpeg child
- element allows the user to pass the JPEG as is in the document. The default is set to "false" since
- there are compatibility concerns as some AFP printers don't support JPEG decoding. Using the
- "bitmap-encoding-quality" attribute it is possible to enable lossy compression (JPEG baseline
- DCT). The default is "1.0" which means lossless encoding. Setting a value lower than 1.0, JPEG
- compression is enabled and the setting is used as the quality setting when encoding bitmap data.
- Note that this setting does not always have an effect. Bi-level (1 bit) bitmaps are not compressed
- using JPEG. Example:
-
-
-
-
- GOCA (Vector Graphics)
-
- Not all AFP implementations support GOCA. Some also have bugs related to GOCA. Therefore,
- it is desirable to have some control over the generation of GOCA graphics.
-
-
- GOCA is enabled by default. You can disable GOCA entirely in which case the AFP support
- falls back to generating bitmaps for vector graphics. Example:
-
-
-
- Some AFP implementations have trouble rendering text in GOCA. You can instruct the AFP
- support to render text as shapes (i.e. use vector graphics to paint text). Example:
-
-
-
- If you disable GOCA or let text render as shapes, the size of the generated AFP usually
- increases considerably.
-
-
-
- Shading
-
- 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:
-
-
-
-
- Resource Group File
-
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 <resource-group-file/> configuration element. Example:
-
- Be careful when using this option not to overwrite existing resource files from previous rendering runs.
-
-
- Resource Level Defaults
-
- 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.
-
-
- It is possible to override these defaults, either per image (see the
- afp:resource-level
- extension attribute below) or by specifying different defaults in the configuration:
-
-
-
- "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.
-
-
-
-
- Extensions
-
The AFP Renderer supports some AFP specific extensions which can be embedded into the input
- fo document. To use the extensions the appropriate namespace must be declared in the fo:root element like this:
-
-
- Page Overlay (IPO) Extension
-
The include-page-overlay extension element allows to define on a per simple-page-master basis a page overlay resource. Example:
-
-
The mandatory name attribute must refer to an 8 character (space padded) resource name that
- 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.
-
-
- Page Segment (IPS) Extension
-
The include-page-segment extension element allows to define resource substitution for fo:external-graphics elements.
- Example:
-
-
The include-page-segment extension element can only occur within a simple-page-master.
- Multiple include-page-segment extension elements within a simple-page-master are allowed.
- The mandatory name attribute must refer to an 8 character
- (space padded) resource name that must be known in the AFP processing environment.
- The value of the mandatory src attribute is compared against the value of the src attribute in
- 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.
-
-
- 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.
-
-
- The include-page-segment extension element has the optional attribute
- resource-file. The value of this is a URI to a resource containing a page
- segment with the declared name. In this case FOP embeds the page segment into the
- generated document so that the external resource does not have to be supplied in the
- print job.
-
-
-
- Tag Logical Element (TLE) Extension
-
The tag-logical-element extension element allows to injects TLEs into the AFP output stream. Example:
-
-
- 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.
-
-
-
- No Operation (NOP) Extension
-
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:
-
-
The no-operation extension element can appear as child of
- simple-page-master (appears after "Begin Page" BPG),
- page-sequence (appears after "Begin Named Page Group" BNG
- and declarations (appears after "Begin Document" BDT).
- Multiple no-operation extension elements inside the same formatting object are allowed.
- Each NOP will appear right after the respective "Begin" field indicated above even if it
- is specified as the last child under its parent. The order inside the parent
- will be maintained.
- The "placement" attribute can be used to have the NOP appear before
- the "End" field of the object rather than after the "Begin" field. Specify
- placement="before-end" to do that. Please note that, at the moment, this only
- has an effect for NOPs that are children of the page-sequence formatting
- object.
- The "name" attribute is mandatory but will not appear inside the AFP stream.
-
-
-
- Invoke Medium Map (IMM) Extension
-
- The invoke-medium-map extension allows to generate IMM fields (Invoke Medium Map) in the
- generated AFP output. Example:
-
-
-
- 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.
-
-
-
- Form Maps/Defs
-
- Apache FOP supports embedding an external form map resource in the
- generated AFP output. This is done using the afp:include-form-map
- extension. An example:
-
-
-
- The afp:include-form-map is to be placed as a direct child of
- fo:declarations. The name is an AFP resource name
- (max. 8 characters) and the src attribute is the URI identifying the
- external form map resource. When such a form map is embedded, you can use the
- afp:invoke-medium-map extension (described above) to invoke any medium
- map included in the form map.
-
-
- 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.
-
-
-
-
- Foreign Attributes
-
- Resource
-
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 <fo:external-graphic/> and <instream-foreign-object/>.
- Example:
-
-
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 Resource Level Defaults
- above to see what is used if the resource-level attribute is not specified.
-
-
-
-
-
-
- RTF
-
- JFOR, an open source XSL-FO to RTF converter has been integrated into Apache FOP.
- This will create an RTF (rich text format) document that will
- attempt to contain as much information from the 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.
-
-
- The RTF output follows Microsoft's RTF specifications
- and produces best results on Microsoft Word.
-
- 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.
-
- These are some known restrictions compared to other supported output formats (not a complete list):
-
-
-
- Not supported/implemented:
-
-
break-before/after (supported by the RTF library but not tied into the RTFHandler)
-
fo:page-number-citation-last
-
keeps (supported by the RTF library but not tied into the RTFHandler)
-
region-start/end (RTF limitation)
-
multiple columns
-
-
-
Only a single page-master is supported
-
Not all variations of fo:leader are supported (RTF limitation)
-
percentages are not supported everywhere
-
-
-
- XML (Area Tree XML)
-
- This is primarily for testing and verification. The XML created is simply
- a representation of the internal area tree put into XML. We use that to verify
- the functionality of FOP's layout engine.
-
-
- The other use case of the Area Tree XML is as FOP's "intermediate format". More information
- on that can be found on the page dedicated to the Intermediate Format.
-
-
-
- Java2D/AWT
-
- The Java2DRenderer provides the basic functionality for all
- Java2D-based output formats (AWT viewer, direct print, PNG, TIFF).
-
-
- The AWT viewer shows a window with the pages displayed inside a
- Java graphic. It displays one page at a time.
- The fonts used for the formatting and viewing depend on the fonts
- available to your JRE.
-
-
-
- Print
-
- It is possible to directly print the document from the command line.
- This is done with the same code that renders to the Java2D/AWT renderer.
-
-
- Known issues
-
- 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.
-
-
-
-
- Bitmap (TIFF/PNG)
-
- It is possible to directly create bitmap images from the individual
- pages generated by the layout engine.
- This is done with the same code that renders to the Java2D/AWT renderer.
-
-
- Currently, two output formats are supported: PNG and TIFF. TIFF produces
- one file with multiple pages, while PNG output produces one file per
- page. Note: FOP can only produce multiple files (with PNG output) if
- you can set a java.io.File indicating the primary PNG file
- using the FOUserAgent.setOutputFile(File) method.
-
-
- The quality of the bitmap depends on the target resolution setting
- on the FOUserAgent and on further settings described below.
-
-
- Configuration
-
- The TIFF and PNG renderer configuration currently allows the following settings:
-
-
-
- The default value for the "color-mode" setting is "rgba" which
- is equivalent to a 24bit RGB image with an 8bit alpha channel for transparency.
- Valid values are:
-
-
-
rgba: RGB with alpha channel (24bit + 8bit = 32bit)
-
rgb: RGB (24bit)
-
gray: gray (8bit)
-
bi-level (or binary): bi-level (1bit)
-
-
- Please note that there is currently no dithering or error diffusion available for bi-level
- bitmap output.
-
-
- 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",
- no such background will be painted and you will get a transparent image if
- an alpha channel is available in the output format.
-
-
- The default value for the "background-color" setting is "white".
- The color specifies in which color the page background is painted. It will only be
- painted if "transparent-page-background" is not set to "true".
- All XSL-FO colors (including color functions) can be used.
-
-
- The default value for the "anti-aliasing" setting is "true".
- You can set this value to "false" to disable anti-aliasing and
- thus improve rendering speeds a bit at the loss of some image quality.
-
-
- The default value for the "rendering" setting is "true".
- You can set this value to "false" 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.
-
-
-
- TIFF-specific Configuration
-
- In addition to the above values the TIFF renderer configuration allows some additional
- settings:
-
-
-
- The default value for the "compression" setting is "PackBits" which
- which is a widely supported RLE compression scheme for TIFF. The set of compression
- names to be used here matches the set that the Image I/O API uses. Note that
- not all compression schemes may be available during runtime. This depends on the
- actual codecs being available. Here is a list of possible values:
-
-
-
NONE (no compression)
-
PackBits (RLE, run-length encoding)
-
JPEG
-
Deflate
-
LZW
-
ZLib
-
CCITT T.4 (Fax Group 3)
-
CCITT T.6 (Fax Group 4)
-
-
- This setting may override any setting made using the "color-mode". For example, if
- "CCITT T.6" is selected, the color mode is automatically forced to "bi-level" because
- this compression format only supports bi-level images.
-
-
- If you want to use CCITT compression, please make sure you've got
-
- Java Advanced Imaging Image I/O Tools
-
- in your classpath. The Sun JRE doesn't come with a TIFF codec built in, so it has to be
- added separately. The internal TIFF codec from XML Graphics Commons only supports PackBits,
- Deflate and JPEG compression for writing.
-
-
-
- Runtime Rendering Options
-
- 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:
-
-
-
-
-
- TXT
-
- The text renderer produces plain ASCII text output
- that attempts to match the output of the PDFRenderer as closely as
- possible. This was originally developed to accommodate an archive system
- that could only accept plain text files, and is primarily useful for getting
- a quick-and-dirty view of the document text. The renderer is very limited,
- so do not be surprised if it gives unsatisfactory results.
-
-
-
- Because FOP lays the text onto a grid during layout, there are frequently
- extra or missing spaces between characters and lines, which is generally
- unsatisfactory.
- Users have reported that the optimal settings to avoid such spacing problems are:
-
-
-
font-family="Courier"
-
font-size="10pt"
-
line-height="10pt"
-
-
-
- Output Formats in the Sandbox
-
- Due to the state of certain renderers we moved some of them to a "sandbox" area until
- they are ready for more serious use. The renderers and FOEventHandlers in the sandbox
- can be found under src/sandbox and are compiled into build/fop-sandbox.jar during the
- main build. The output formats in the sandbox are marked as such below.
-
-
- MIF
- The MIF handler is in the sandbox and not yet functional in FOP Trunk!!! Please help us ressurrect this feature.
-
- This format is the Maker Interchange Format which is used by
- Adobe Framemaker.
-
-
-
- SVG
- The SVG renderer is in the sandbox and may not work as expected in FOP Trunk!!! Please help us improve this feature.
-
- This format creates an SVG document that has links between the pages.
- This is primarily for slides and creating svg images of pages.
- Large documents will create SVG files that are far too large for
- an SVG viewer to handle. Since FO documents usually have text the
- SVG document will have a large number of text elements.
- The font information for the text is obtained from the JVM in the
- same way as for the AWT viewer. If the SVG is viewed on a
- system where the fonts are different, such as another platform,
- then the page may look wrong.
-
-
-
-
- Wish list
-
- Apache FOP is easily extensible and allows you to add new output formats to enhance FOP's functionality. There's a number of output formats
- which are on our wish list. We're looking for volunteers to help us implement them.
-
- PDF/A is a standard which turns PDF into an "electronic document file
- format for long-term preservation". PDF/A-1 is the first part of the
- standard and is documented in
- ISO 19005-1:2005(E).
- Work on PDF/A-2 is in progress at
- AIIM.
-
-
- Design documentation on PDF/A can be found on FOP's Wiki on the
- PDFA1ConformanceNotes page.
-
-
-
- Implementation Status
-
- PDF/A-1b is implemented to the degree that FOP supports
- the creation of the elements described in ISO 19005-1.
-
-
- Tests have been performed against jHove and Adobe Acrobat 7.0.7 (Preflight function).
- FOP does not validate completely against Apago's PDF Appraiser. Reasons unknown due to
- lack of a full license to get a detailed error protocol.
-
-
- PDF/A-1a is based on PDF-A-1b and adds accessibility features
- (such as Tagged PDF). This format is available within the limitation described on
- the Accessibility page.
-
-
-
- Usage (command line)
-
- To activate PDF/A-1b from the command-line, specify "-pdfprofile PDF/A-1b"
- 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.
-
-
- PDF/A-1a is enabled by specifying "-pdfprofile PDF/A-1a".
-
-
-
- Usage (embedded)
-
- When FOP is embedded in another Java application you can set a special option
- on the renderer options in the user agent to activate the PDF/A-1b profile.
- Here's an example:
-
-
-
- If one of the validation rules of PDF/A is violated, an PDFConformanceException
- (descendant of RuntimeException) is thrown.
-
-
- For PDF/A-1a, just use the string "PDF/A-1a" instead of "PDF/A-1b".
-
-
-
- PDF/A in Action
-
- There are a number of things that must be looked after if you activate a PDF/A
- profile. If you receive a PDFConformanceException, have a look at the following
- list (not necessarily comprehensive):
-
-
-
- Make sure all (!) fonts are embedded. If you use base 14 fonts (like Helvetica)
- you need to obtain a license for them and embed them like any other font.
-
-
- Don't use PDF encryption. PDF/A doesn't allow it.
-
-
- Don't use CMYK images without an ICC color profile. PDF/A doesn't allow mixing
- color spaces and FOP currently only properly supports the sRGB color space. Please
- note that FOP embeds a standard sRGB ICC profile (sRGB IEC61966-2.1) as the
- primary output intent for the PDF if no other output intent has been specified
- in the configuration.
-
-
- Don't use non-RGB colors in SVG images. Same issue as with CMYK images.
-
-
- Don't use EPS graphics with fo:external-graphic. Embedding EPS graphics in PDF
- is deprecated since PDF 1.4 and prohibited by PDF/A.
-
-
- PDF is forced to version 1.4 if PDF/A-1 is activated.
-
-
- No filter must be specified explicitely for metadata objects. Metadata must be
- embedded in clear text so non-PDF-aware applications can extract the XMP metadata.
-
-
-
- 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 Accessibility page for details.
-
-
-
- PDF profile compatibility
-
- 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.
-
-
-
- Interoperability
-
- There has been some confusion about the namespace for the PDF/A indicator in the XMP
- metadata. At least three variants have been seen in the wild:
-
-
-
-
http://www.aiim.org/pdfa/ns/id.html
-
obsolete, from an early draft of ISO-19005-1, used by Adobe Acrobat 7.x
-
-
-
http://www.aiim.org/pdfa/ns/id
-
obsolete, found in the original ISO 19005-1:2005 document
-
-
-
http://www.aiim.org/pdfa/ns/id/
-
correct, found in the technical corrigendum 1 of ISO 19005-1:2005
-
-
-
- If you get an error validating a PDF/A file in Adobe Acrobat 7.x it doesn't mean that
- FOP did something wrong. It's Acrobat that is at fault. This is fixed in Adobe Acrobat 8.x
- which uses the correct namespace as described in the technical corrigendum 1.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1/pdfencryption.xml b/src/documentation/content/xdocs/1.1/pdfencryption.xml
deleted file mode 100644
index 2d8fdfb10..000000000
--- a/src/documentation/content/xdocs/1.1/pdfencryption.xml
+++ /dev/null
@@ -1,301 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: PDF encryption.
- $Revision$
-
-
-
-
-
-
-
- Overview
-
- Apache⢠FOP supports encryption of PDF output, thanks to Patrick
- C. Lankswert. This feature is commonly used to prevent
- unauthorized viewing, printing, editing, copying text from the
- document and doing annotations. It is also possible to ask the
- user for a password in order to view the contents. Note that
- there already exist third party applications which can decrypt
- an encrypted PDF without effort and allow the aforementioned
- operations, therefore the degree of protection is limited.
-
-
- For further information about features and restrictions regarding PDF
- encryption, look at the documentation coming with Adobe Acrobat or the
- technical documentation on the Adobe web site.
-
-
-
- Usage (command line)
-
- Encryption is enabled by supplying any of the encryption related
- options.
-
-
- An owner password is set with the -o option. This
- password is actually used as encryption key. Many tools for
- PDF processing ask for this password to disregard any
- restriction imposed on the PDF document.
-
-
- If no owner password has been supplied but FOP was asked to apply some
- restrictions, a random password is used. In this case it is obviously
- impossiible to disregard restrictions in PDF processing tools.
-
-
- A user password, supplied with the -u option, will
- cause the PDF display software to ask the reader for this password in
- order to view the contents of the document. If no user password was
- supplied, viewing the content is not restricted.
-
-
- Further restrictions can be imposed by using the following command-line options:
-
-
-
Option
-
Description
-
-
-
-noprint
-
disable printing
-
-
-
-nocopy
-
disable copy/paste of content
-
-
-
-noedit
-
disable editing in Adobe Acrobat
-
-
-
-noannotations
-
disable editing of annotations
-
-
-
-nofillinforms
-
disable filling in forms
-
-
-
-noaccesscontent
-
disable text and graphics extraction for accessibility purposes
-
-
-
-noassembledoc
-
disable assembling documents
-
-
-
-noprinthq
-
disable high quality printing
-
-
-
-
-
- Usage (embedded)
-
- When FOP is embedded in another Java application you need to set an
- options map on the renderer. These are the supported options:
-
-
-
-
Option
-
Description
-
Values
-
Default
-
-
-
encryption-length
-
The encryption length in bit
-
Any multiple of 8 between 40 and 128
-
40
-
-
-
ownerPassword
-
The owner password
-
String
-
-
-
-
userPassword
-
The user password
-
String
-
-
-
-
allowPrint
-
Allows/disallows printing of the PDF
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
allowCopyContent
-
Allows/disallows copy/paste of content
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
allowEditContent
-
Allows/disallows editing in Adobe Acrobat
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
allowEditAnnotations
-
Allows/disallows editing of annotations
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
allowFillInForms
-
Allows/disallows filling in forms
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
allowAccessContent
-
Allows/disallows text and graphics extraction for accessibility purposes
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
allowAssembleDocument
-
Allows/disallows assembling document
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
allowPrintHq
-
Allows/disallows high quality printing
-
"TRUE" or "FALSE"
-
"TRUE"
-
-
-
- Encryption is enabled as soon as one of these options is set.
-
-
- An example to enable PDF encryption in Java code:
-
-
-
- The parameters for the constructor of PDFEncryptionParams are:
-
-
-
userPassword: String, may be null
-
ownerPassword: String, may be null
-
allowPrint: true if printing is allowed
-
allowCopyContent: true if copying content is allowed
-
allowEditContent: true if editing content is allowed
-
allowEditAnnotations: true if editing annotations is allowed
-
allowFillInForms: true if filling in forms is allowed.
-
allowAccessContent: true if extracting text and graphics is allowed
-
allowAssembleDocument: true if assembling document is allowed
-
allowPrintHq: true if printing to high quality is allowed
-
-
- Alternatively, you can set each value separately in the Map provided by
- FOUserAgent.getRendererOptions() by using the following keys:
-
-
-
user-password: String
-
owner-password: String
-
noprint: Boolean or "true"/"false"
-
nocopy: Boolean or "true"/"false"
-
noedit: Boolean or "true"/"false"
-
noannotations: Boolean or "true"/"false"
-
nofillinforms: Boolean or "true"/"false"
-
noaccesscontent: Boolean or "true"/"false"
-
noassembledoc: Boolean or "true"/"false"
-
noprinthq: Boolean or "true"/"false"
-
-
-
- Environment
-
- In order to use PDF encryption, FOP has to be compiled with
- cryptography support. Currently, only JCE
- is supported. JCE is part of JDK 1.4. For earlier JDKs, it can
- be installed separately. The build process automatically
- detects JCE presence and installs PDF encryption support if
- possible, otherwise a stub is compiled in.
-
-
- Cryptography support must also be present at run time. In particular, a
- provider for the RC4 cipher is needed. Unfortunately, the sample JCE
- provider in Sun's JDK 1.4 does not provide RC4. If you
- get a message saying
-
-
-
- then you don't have the needed infrastructure.
-
-
- There are several commercial and a few Open Source packages which
- provide RC4. A pure Java implementation is produced by The Legion of the Bouncy
- Castle. Mozilla
- JSS is an interface to a native implementation.
-
-
-
- Installing a crypto provider
-
- The pure Java implementation from Bouncy Castle is easy to
- install.
-
-
-
- Download the binary distribution for your JDK version.
-
-
- Unpack the distribution. Add the jar file to your classpath. A
- convenient way to use the jar on Linux is to simply drop it into the
- FOP lib directory, it will be automatically picked up by
- fop.sh.
-
-
- Open the java.security file and add
- security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider,
- preferably at the end of the block defining the other crypto
- providers. For JDK 1.4 this is detailed on Sun's web site.
-
-
-
- If you have any experience with Mozilla JSS or any other
- cryptography provider, please post it to the fop-user list.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1/pdfx.xml b/src/documentation/content/xdocs/1.1/pdfx.xml
deleted file mode 100644
index bef2fce2a..000000000
--- a/src/documentation/content/xdocs/1.1/pdfx.xml
+++ /dev/null
@@ -1,136 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: PDF/X (ISO 15930)
- $Revision$
-
-
-
-
-
-
- Overview
-
- 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.
-
-
- PDF/X is a standard which faciliates prepress digital data exchange using PDF.
- Currently, only PDF/X-3:2003 is implemented out of the many different flavours of PDF/X
- profiles. PDF/X-3:2003 is documented in
- ISO 15930-6:2003(E).
- More info on PDF/X can be found on the
- PDF/X info site.
-
-
-
- Implementation Status
-
- PDF/X-3:2003 is implemented to the degree that FOP supports
- the creation of the elements described in ISO 15930-6.
-
-
- An important restriction of the current implementation is that all normal
- RGB colors specified in XSL-FO and SVG are left unchanged in the sRGB color
- space (XSL-FO and SVG both use sRGB as their default color space).
- There's no conversion to a CMYK color space. Although sRGB is a
- calibrated color space, its color space has a different size than a CMYK
- color space which makes the conversion a lossy conversion and can lead to
- unwanted results. Although the use of the calibrated sRGB has been promoted
- for years, print shops usually prefer to convert an sRGB PDF to CMYK prior
- to production. Until there's full CMYK support in FOP you will have to
- work closely with your print service provider to make sure you get the
- intended result.
-
-
- Tests have been performed against Adobe Acrobat 7.0.7 (Preflight function).
- Note that there are bugs in Adobe Acrobat which cause false alarms if both
- PDF/A-1b and PDF/X-3:2003 are activated at the same time.
-
-
-
- Usage (command line)
-
- To activate PDF/X-3:2003 from the command-line, specify "-pdfprofile PDF/X-3:2003"
- as a parameter. If there is a violation of one of the validation rules for
- PDF/X, an error message is presented and the processing stops.
-
-
-
- Usage (embedded)
-
- When FOP is embedded in another Java application you can set a special option
- on the renderer options in the user agent to activate the PDF/A-1b profile.
- Here's an example:
-
-
-
- If one of the validation rules of PDF/X is violated, an PDFConformanceException
- (descendant of RuntimeException) is thrown.
-
-
-
- PDF/X in Action
-
- There are a number of things that must be looked after if you activate a PDF/X
- profile. If you receive a PDFConformanceException, have a look at the following
- list (not necessarily comprehensive):
-
-
-
- Make sure all (!) fonts are embedded. If you use base 14 fonts (like Helvetica)
- you need to obtain a license for them and embed them like any other font.
-
-
- Don't use PDF encryption. PDF/X doesn't allow it.
-
-
- Don't use CMYK images without an ICC color profile. PDF/X doesn't allow mixing
- color spaces and FOP currently only properly supports the sRGB color space. However,
- you will need to specify an
- output device profile
- (usually a CMYK profile) in the configuration. sRGB won't work here since it's a
- display device profile, not an output device profile.
-
-
- Don't use non-RGB colors in SVG images. Same issue as with CMYK images.
-
-
- Don't use EPS graphics with fo:external-graphic. Embedding EPS graphics in PDF
- is deprecated since PDF 1.4 and prohibited by PDF/X-3:2003.
-
-
- PDF is forced to version 1.4 if PDF/X-3:2003 is activated.
-
-
-
-
- PDF profile compatibility
-
- The PDF profiles "PDF/X-3:2003" and "PDF/A-1b" are compatible and can both be
- activated at the same time.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1/running.xml b/src/documentation/content/xdocs/1.1/running.xml
deleted file mode 100644
index 5e30bb25e..000000000
--- a/src/documentation/content/xdocs/1.1/running.xml
+++ /dev/null
@@ -1,370 +0,0 @@
-
-
-
-
-
-
- Running Apache⢠FOP
- $Revision$
-
-
-
-
- System Requirements
-
The following software must be installed:
-
-
- Java 1.4.x or later Runtime Environment.
-
-
- 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.
-
-
-
-
- Apache⢠FOP. The FOP distribution 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:
-
The following software is optional, depending on your needs:
-
-
- Graphics libraries. Generally, FOP contains direct support for the most important
- bitmap image formats (including PNG, JPEG and GIF). See
- FOP: Graphics Formats for details.
-
In addition, the following system requirements apply:
-
-
- If you will be using FOP to process SVG, you must do so in a graphical environment.
- See FOP: Graphics (Batik) for details.
-
-
-
-
- Installation
-
- Instructions
-
- Basic FOP installation consists of first unzipping the .gz file that is the
- distribution medium, then unarchiving the resulting .tar file in a
- directory/folder that is convenient on your system. Please consult your operating system
- documentation or Zip application software documentation for instructions specific to your
- site.
-
-
-
- Problems
-
- Some Mac OSX users have experienced filename truncation problems using Stuffit to unzip
- and unarchive their distribution media. This is a legacy of older Mac operating systems,
- which had a 31-character pathname limit. Several Mac OSX users have recommended that
- Mac OSX users use the shell command tar -xzf instead.
-
-
-
-
- Starting FOP as a Standalone Application
-
- Using the fop script or batch file
-
- 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
- the path to use in this case is /Library/Java/Home. Caveat:
- We suspect that, as Apple releases new Java environments and as FOP upgrades the minimum
- Java requirements, the two will inevitably not match on some systems. Please see
- Java on Mac OSX FAQ for information as
- it becomes available.
-
-
-
- PDF encryption is only available if FOP was compiled with encryption support
- and if compatible encryption support is available at run time.
- Currently, only the JCE is supported. Check the Details.
-
-
-
- Writing your own script
-
FOP's entry point for your own scripts is the class
-org.apache.fop.cli.Main. The general pattern for the
- command line is: java -classpath <CLASSPATH>
- org.apache.fop.cli.Main <arguments>. 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.
-
-
-
- Running with java's -jar option
-
- As an alternative to the start scripts you can run java
- -jar path/to/build/fop.jar <arguments>, relying on
- FOP to build the classpath for running FOP dynamically, see below. If you use hyphenation,
- you must put fop-hyph.jar in the lib
- directory.
-
-
-
You can also run java -jar path/to/fop.jar
- <arguments>, relying on the Class-Path
- entry in the manifest file. This works if you put
- fop.jar and all jar files from the lib
- directory in a single directory. If you use hyphenation, you
- must also put fop-hyph.jar in that directory.
-
-
In both cases the arguments consist of the options and
- infile and outfile specifications as shown above for the
- standard scripts.
-
-
- FOP's dynamical classpath construction
-
-
If FOP is started without a proper classpath, it tries to
- add its dependencies dynamically. If the system property
- fop.home 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 build,
- then its parent directory becomes the base directory.
-
-
FOP expects to find fop.jar in the
- build subdirectory of the base directory, and
- adds it to the classpath. Subsequently FOP adds all
- jar files in the lib directory to the
- classpath. The lib directory is either the lib
- subdirectory of the base directory, or, if that does not
- exist, the base directory itself.
-
-
If the system property fop.optional.lib
- contains the name of a directory, then all jar
- files in that directory are also added to the classpath. See
- the methods getJARList and
- checkDependencies in
- org.apache.fop.cli.Main.
-
-
-
-
- Using Xalan to Check XSL-FO Input
-
- FOP sessions that use -xml and -xsl input instead of -fo input are actually
- controlling two distinct conversions: Tranforming XML to XSL-FO, then formatting
- the XSL-FO to PDF (or another FOP output format).
- Although FOP controls both of these processes, the first is included merely as
- a convenience and for performance reasons.
- Only the second is part of FOP's core processing.
- If a user has a problem running FOP, it is important to determine which of these
- two processes is causing the problem.
- If the problem is in the first process, the user's stylesheet is likely the cause.
- The FOP development team does not have resources to help with stylesheet issues,
- although we have included links to some useful
- Specifications and
- Books/Articles.
- If the problem is in the second process, FOP may have a bug or an unimplemented
- feature that does require attention from the FOP development team.
-
- The user is always responsible to provide correct XSL-FO code to FOP.
-
- In the case of using -xml and -xsl input, although the user is responsible for
- the XSL-FO code that is FOP's input, it is not visible to the user. To make the
- intermediate FO file visible, the FOP distribution includes the "-foout" option
- which causes FOP to run only the first (transformation) step, and write the
- results to a file. (See also the Xalan command-line below)
-
-
- When asking for help on the FOP mailing lists, never attach XML and
- XSL to illustrate the issue. Always run the XSLT step (-foout) and send the
- resulting XSL-FO file instead. Of course, be sure that the XSL-FO file is
- correct before sending it.
-
-
- The -foout option works the same way as if you would call the
- Xalan command-line:
-
- Note that there are some subtle differences between the FOP and Xalan command-lines.
-
-
-
- Memory Usage
-
- FOP can consume quite a bit of memory, even though this has been continually improved.
- This is partly inherent to the formatting process and partly caused by implementation choices.
- All FO processors currently on the market have memory problems with certain layouts.
-
-
- If you are running out of memory when using FOP, here are some ideas that may help:
-
-
-
- Increase memory available to the JVM. See
- the -Xmx option
- for more information.
-
- It is usually unwise to increase the memory allocated to the JVM beyond the amount of
- physical RAM, as this will generally cause significantly slower performance.
-
-
-
- Avoid forward references.
- Forward references are references to some later part of a document.
- Examples include page number citations which refer to pages which follow the citation,
- tables of contents at the beginning of a document, and page numbering schemes that
- include the total number of pages in the document
- ("page N of TOTAL").
- Forward references cause all subsequent pages to be held in memory until the reference
- can be resolved, i.e. until the page with the referenced element is encountered.
- Forward references may be required by the task, but if you are getting a memory
- overflow, at least consider the possibility of eliminating them.
- A table of contents could be replaced by PDF bookmarks instead or moved to the end of
- the document (reshuffle the paper could after printing).
-
-
- Avoid large images, especially if they are scaled down.
- If they need to be scaled, scale them in another application upstream from FOP.
- For many image formats, memory consumption is driven mainly by the size of the image
- file itself, not its dimensions (width*height), so increasing the compression rate
- may help.
-
-
- Use multiple page sequences.
- FOP starts rendering after the end of a page sequence is encountered.
- While the actual rendering is done page-by-page, some additional memory is
- freed after the page sequence has been rendered.
- This can be substantial if the page sequence contains lots of FO elements.
-
-
-
-
diff --git a/src/documentation/content/xdocs/1.1/servlets.xml b/src/documentation/content/xdocs/1.1/servlets.xml
deleted file mode 100644
index dd2df4351..000000000
--- a/src/documentation/content/xdocs/1.1/servlets.xml
+++ /dev/null
@@ -1,325 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP: Servlets
- How to use Apache⢠FOP in a Servlet
- $Revision$
-
-
-
- Overview
-
- This page discusses topic all around using Apache⢠FOP in a servlet environment.
-
-
-
- Example Servlets in the FOP distribution
-
- In the directory {fop-dir}/src/java/org/apache/fop/servlet, you'll find a working example
- of a FOP-enabled servlet.
-
-
- The servlet is automatically built when you build Apache FOP using the supplied Ant script. After building
- the servlet, drop fop.war into the webapps directory of Apache Tomcat (or any other web container). Then, you can use
- URLs like the following to generate PDF files:
-
The source code for the servlet can be found under {fop-dir}/src/java/org/apache/fop/servlet/FopServlet.java.
-
- This example servlet should not be used on a public web server connected to the Internet as it does not contain
- any measures to prevent Denial-of-Service-Attacks. It is provided as an example and as a starting point for
- your own servlet.
-
-
-
- Create your own Servlet
-
- This section assumes you are familiar with embedding FOP.
-
-
- A minimal Servlet
-
- Here is a minimal code snippet to demonstrate the basics:
-
-
-
- There are numerous problems with the code snippet above.
- Its purpose is only to demonstrate the basic concepts.
- See below for details.
-
-
-
- Adding XSL tranformation (XSLT)
-
- A common requirement is to transform an XML source to
- XSL-FO using an XSL transformation. It is recommended to use
- JAXP for this task. The following snippet shows the basic
- code:
-
-
-
- Buffering the generated PDF in a ByteArrayOutputStream is done to avoid potential
- problems with the Acrobat Reader Plug-in in Microsoft Internet Explorer.
-
-
- The Source instance used above is simply an
- example. If you have to read the XML from a string, supply
- a new StreamSource(new
- StringReader(xmlstring)). Constructing and reparsing
- an XML string is generally less desirable than using a
- SAXSource if you generate your XML. You can alternatively
- supply a DOMSource as well. You may also use dynamically
- generated XSL if you like.
-
-
- Because you have an explicit Transformer object, you can also use it to
- explicitely set parameters for the transformation run.
-
-
-
- Custom configuration
-
- You can easily set up your own FOUserAgent as demonstrated on the Embedding page.
-
-
-
- Improving performance
-
- There are several options to consider:
-
-
-
- Instead of java.io.ByteArrayOutputStream consider using the ByteArrayOutputStream
- implementation from the Jakarta Commons IO project which allocates less memory.
- The full class name is: org.apache.commons.io.output.ByteArrayOutputStream
-
-
- In certain cases it can help to write the generated PDF to a temporary file so
- you can quickly reuse the file. This is especially useful, if Internet Explorer
- calls the servlet multiple times with the same request or if you often generate
- equal PDFs.
-
-
-
- Accessing resources in your web application
-
- Often, you will want to use resources (stylesheets, images etc.) which are bundled with
- your web application. FOP provides a URIResolver implementation that lets you access
- files via the Servlet's ServletContext. The class is called
- org.apache.fop.servlet.ServletContextURIResolver.
-
-
- Here's how to set it up in your servlet. Instantiate a new instance in the servlet's
- init() method:
-
-
-
- The ServletContextURIResolver reacts on URIs beginning with "servlet-context:". If you
- want to access an image in a subdirectory of your web application, you could, for
- example, use: "servlet-context:/images/myimage.png". Don't forget the leading slash
- after the colon!
-
-
- Further down, you can use the URIResolver for various things:
-
-
-
- With the Transformer (JAXP/XSLT) so things like document() functions can resolver
- "servlet-context:" URIs.
-
-
- With the FopFactory so every resource FOP loads can be loaded using a "servlet-context:"
- URI.
-
-
- You can the ServletContextURIResolver yourself in your servlet code to access
- stylesheets or XML files bundled with your web application.
-
-
-
- Here are some example snippets:
-
-
-
-
-
- Notes on Microsoft Internet Explorer
-
- Some versions of Internet Explorer will not automatically show the PDF or call the servlet multiple times.
- These are well-known limitations of Internet Explorer and are not a problem of the servlet.
- However, Internet Explorer can still be used to download the PDF so that it can be viewed later.
- Here are some suggestions in this context:
-
-
-
- Use an URL ending in .pdf, like
- http://myserver/servlet/stuff.pdf. Yes, the servlet can
- be configured to handle this. If the URL has to contain parameters,
- try to have both the base URL as well as the last parameter end in
- .pdf, if necessary append a dummy parameter, like
- http://myserver/servlet/stuff.pdf?par1=a&par2=b&d=.pdf. The
- effect may depend on IEx version.
-
-
- Give IEx the opportunity to cache. In particular, ensure the
- server does not set any headers causing IEx not to cache the
- content. This may be a real problem if the document is sent
- over HTTPS, because most IEx installations will by default
- not cache any content retrieved over HTTPS.
- Setting the Expires header entry may help in
- this case: response.setDateHeader("Expires",
- System.currentTimeMillis() + cacheExpiringDuration *
- 1000); Consult your server manual and the
- relevant RFCs for further details on HTTP headers and
- caching.
-
-
- Cache in the server. It may help to include a parameter in
- the URL which has a timestamp as the value min order to
- decide whether a request is repeated. IEx is reported to
- retrieve a document up to three times, but never more often.
-
-
-
-
- Servlet Engines
-
- When using a servlet engine, there are potential CLASSPATH issues, and potential conflicts
- with existing XML/XSLT libraries. Servlet containers also often use their own classloaders
- for loading webapps, which can cause bugs and security problems.
-
-
- Tomcat
-
- Check Tomcat's documentation for detailed instructions about installing FOP and Cocoon.
- There are known bugs that must be addressed, particularly for Tomcat 4.0.3.
-
-
-
- WebSphere 3.5
-
- Put a copy of a working parser in some directory where WebSphere can access it.
- For example, if /usr/webapps/yourapp/servlets is the CLASSPATH for your servlets,
- copy the Xerces jar into it (any other directory would also be fine).
- Do not add the jar to the servlet CLASSPATH, but add it to the CLASSPATH of the
- application server which contains your web application.
- In the WebSphere administration console, click on the "environment" button in the
- "general" tab. In the "variable name" box, enter "CLASSPATH".
- In the "value" box, enter the correct path to the parser jar file
- (/usr/webapps/yourapp/servlets/Xerces.jar in our example here).
- Press "OK", then apply the change and restart the application server.
-
-
-
-
- Handling complex use cases
-
- Sometimes the requirements for a servlet get quite sophisticated: SQL data sources,
- multiple XSL transformations, merging of several datasources etc. In such a case
- consider using Apache Cocoon instead
- of a custom servlet to accomplish your goal.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/1.1/upgrading.xml b/src/documentation/content/xdocs/1.1/upgrading.xml
deleted file mode 100644
index 1e2136a06..000000000
--- a/src/documentation/content/xdocs/1.1/upgrading.xml
+++ /dev/null
@@ -1,181 +0,0 @@
-
-
-
-
-
-
- Upgrading from an Earlier Version of Apache⢠FOP
- $Revision$
-
-
-
- Upgrading from Version 1.0
-
- You should encounter very few issues in upgrading from FOP 1.0, except as noted in the following:
-
-
-
- The intermediate format (IF) output format has underwent minor modification as follows:
-
-
- In order to track changes to the IF format, a version attribute has been added to the root
- document element. Since no version information was provided previously, the initial
- value of this attribute is 2.0. Future backward compatible changes will update the minor
- version number, while future non-backward compatible changes will update the major version number.
-
-
- On the text element, a new alternate representation is used for adjustments to glyph positions as expressed by a dp
- attribute instead of the dx attribute. For further information, see
- complex
- script patch - intermediate format changes.
-
-
- On the border-rect element, the attributes {before, after, start, end}
- have been renamed to {top, bottom, left, right}, respectively.
- For further information, see
- complex
- script patch - intermediate format changes.
-
-
-
-
- The IFPainter interface (of package org.apache.fop.render.intermediate), specifically the
- drawText and drawBorderRect method signatures, have been modified to express the semantics of the above changes to the IF output format.
-
-
- The area tree (AT) output format has underwent minor modification as follows:
-
-
- In order to track changes to the AT format, a version attribute has been added to the root
- areaTree element. Since no version information was provided previously, the initial
- value of this attribute is 2.0. Future backward compatible changes will update the minor
- version number, while future non-backward compatible changes will update the major version number.
-
-
- An optional level attribute has been added to a number of element types to express resolved bidirectional level.
-
-
- An optional reversed attribute has been added to the word element type to express that the glyphs that
- correspond to the character content of the element should be reversed (in order) in the inline progression dimension when rendering.
-
-
-
-
- Because complex script features are now enabled by default, it is possible that different font specific data will be used for
- kerning than was previously used. This may be the case if a font supports a traditional TrueType kern table and
- also supports the advanced typographic kern feature with a GPOS table. In FOP 1.0, the former is used for kerning,
- while in FOP 1.1 with complex script features enabled, the latter is used. If it is desired to explicitly use the kern table (rather
- than the GPOS table) in such a case, then the -nocs command line option may be used when invoking FOP
- in order to disable complex script features.
-
-
-
-
- Upgrading from Pre-1.0 Versions
-
- If you're planning to upgrade to the latest Apache⢠FOP version from a pre-1.0 version,
- there are a few very important things to consider:
-
-
-
- The API of FOP has changed considerably and is not
- backwards-compatible with versions 0.20.5 and
- 0.91beta. Version 0.92 introduced the new stable
- API.
-
-
- Since version 0.92 some deprecated methods which were part
- of the old API have been removed. If you upgrade from 0.91
- beta, you will need to adjust your Java code. Similarly if
- you upgrade from 0.92 and use deprecated methods.
-
-
- 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 conf/fop.xconf for
- an example configuration file. A XML Schema file can be found under
- src/foschema/fop-configuration.xsd.
-
-
- 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.
-
-
-
- The new code is much more strict about the interpretation of the XSL-FO specification.
- Things that worked fine in version 0.20.5 might start to produce warnings or even errors
- now. FOP 0.20.5 contains many bugs which have been corrected in the new code.
-
-
- While FOP 0.20.5 allowed you to have empty fo:table-cell elements, the new code
- will complain about that (unless relaxed validation is enabled) because the specification
- demands at least one block-level element ((%block;)+, see
- XSL-FO 1.1, 6.7.10)
- inside an fo:table-cell element.
-
-
-
- Extensions and Renderers written for version 0.20.5 will not work with the new code! The new FOP
- extension for Barcode4J is available since
- January 2007.
-
-
- The SVG Renderer and the MIF Handler have not yet been resurrected! They are currently non-functional
- and hope for someone to step up and reimplement them.
-
-
-
- When you use your existing FO files or XML/XSL files which work fine with FOP version
- 0.20.5 against this FOP version some things may not work as expected. The following
- list will hopefully help you to identify and correct those problems.
-
-
-
- Check the Compliance page for the feature causing
- trouble. It may contain the necessary information to understand and resolve the problem.
-
-
- Not all 0.20.5 output formats are supported. PDF and Postscript should be fully supported.
- See Output Targets for a more complete description.
-
-
- As stated above, empty table cells <fo:table-cell></fo:table-cell>
- are not allowed by the specification. The same applies to empty fo:static-content
- and fo:block-container elements, for example.
-
-
- Version 0.20.5 is not XSL-FO compliant with respect to sizing images (external-graphic)
- or instream-foreign-object
- objects. If images or SVGs are sized differently in your outputs with the new FOP version
- check Bug 37136
- as it contains some hints on what to do. The file
-
- "examples/fo/basic/images.fo" has
- a number of good examples that show the correct behaviour.
-
-
- The fox:outline extension is not implemented in the current version:
- it has been superseded by the new bookmark elements from XSL-FO 1.1.
-
- Information on this page applies to enhancement requests and other trackable
-issues as well as bugs.
-
-
- Reported Issues
-
A list of unresolved reported bugs can be found at
-FOP
-Open Bugs (Bugzilla). If you have an interest in an issue already
-reported, please consider the following:
-
-
-
If you have insight that may help developers solve an existing problem,
-please add comments and/or file attachments to the existing issue.
-
If you would like to track the status of the issue, consider adding
-your email address to the list of "CC" recipients, so that you will receive
-an email as changes are made to the issue.
-
-
-
- Unreported Issues (Reporting New Issues)
-
- User reports of bugs and requests for enhancements are extremely
- important parts of FOP development, and we appreciate the time you take to help
- us track these issues down.
-
-
-
- To help us ensure that the bug database is as useful as it should be, please
- use the Getting Help checklist to determine whether a bug report should be entered.
-
-
- Review the Apache Bug
- Writing Guidelines before submitting your report.
-
-
- Enter a new issue report at The
- FOP issue database (Bugzilla). You will be asked to login to an existing Bugzilla account or to
- create a new one. When entering the bug report, please make your description complete and concise.
- If the issue involves a specific input or output file, then you MUST include the
- following information in the bug report (preferably as one or more attachments):
-
-
- an input XSL-FO file (an input XML plus XSLT file is not acceptable, unless and only if the
- issue being reported is related to the built-in XSLT transform processing convenience function provided
- by FOP); this input SHOULD be maximally minimal, which means that it should
- contain nothing more than the minimum needed to demonstrate the problem; if you do not take the effort
- to provide a maximally minimal input FO file, then you will be subsequently asked to do so before the
- bug is processed;
-
-
- a resulting output file, preferably in PDF format; if the issue being reported involves a different output
- format, then provide both a PDF output file and the output file for the output format for which the report
- applies;
-
-
- a copy of the FOP configuration file you used (e.g., fop.xconf);
-
-
- if FOP was invoked using the command line (or an equivalent), then a dump of both the input
- command line and any console output (stderr or stdout) produced; if the report involves an
- exception, then this MUST include the full stack back trace;
-
-
- information describing the version of FOP you are using and the platform (and OS) on which
- you are invoking FOP;
-
-
- if the report applies to the use of a specific font other than one of the built-in, base 14
- fonts, then information that describes where to obtain the font.
-
-
-
-
- After submission, a copy of your bug report will be automatically
- sent to the FOP developer discussion list. If additional information is needed to
- process the bug, then the bug will be set to the NEEDSINFO state, and
- you will be asked to provide the additional information. You can avoid this extra
- step by being diligent about providing all of the information
- indicated above.
-
One of Apache FOP's design goals is conformance to the W3C XSL-FO 1.1 standard, which specifies three
- levels of "conformance": basic, extended, and complete. Although FOP does not currently conform
- to any of these levels, it is nevertheless a useful work-in-progress for many applications. The
- information presented here demonstrates FOP's progress toward the goal of conformance, which
- progress consists of implementation of specific objects and properties in the standard. The
- information presented is useful not only to the developers as a sort of "to do" list, but also
- for setting proper expectations for users and potential users.
-
-
The following table shows the legend used for the tables below:
-
-
-
-
yes
-
indicates conformance
-
-
-
partial
-
indicates partial conformance
-
-
-
no
-
indicates a lack of conformance
-
-
-
na
-
indicates that the item is "not applicable" to FOP usually because FOP supports only
- visual media
[1.0 and later] only has effect in PDF output, for external PDF destinations (links pointing to destinations
- in another PDF), and only works reliably when the PDF is viewed in a standalone PDF viewer.
-
Adobe's browser plugin, for example, ignores the /NewWindow flag.
IDs on table-header, table-footer, table-body, table-row,
- table-and-caption, table-caption, inline-container and bidi-override are not available,
- yet.
Acknowledgement: Some content in this guide was adapted from other Apache⢠projects such as Avalon, Cactus, Turbine and Velocity.
-
- Subversion Repository
-
Conventions in this section apply to Repository content, regardless of type:
-
-
Files checked in must conform to the code conventions for that type of file (java files must conform to java requirements, xml to xml requirements, etc.). If a submitted patch does not conform, it is the responsibility of the committer to bring it into conformance before checking it in. Developers submitting patches are encouraged to follow the code conventions to reduce the work load on the committers.
-
To reduce the amount of spurious deltas, all text (non-binary) files checked into SVN must have Unix-style line endings (LF only). Many IDEs and editors (even on non-Unix platforms) have settings that can facilitate this convention.
-
In order to be able to discern commits from a committer from those where a committer applied a patch from a contributor, the commit message must contain a separate line following this pattern: "Submitted by: [contributor's name] <[contributor's obfuscated e-mail address]>". This also helps doing audits on the repository.
-
-
-
- Java
-
- Java Style
-
- In order to facilitate the human reading of FOP source code,
- reduce churning in code, and prevent disputes, the FOP developers
- have agreed on a set of coding conventions. The basis of these coding
- conventions is documented in the
- Apache XML Project Guidelines,
- which requires that all Java Language source code in the repository
- must be written in conformance to Sun's
- Code Conventions for the Java Programming Language.
- In addition, the FOP developers have agreed to other conventions,
- which are summarized in the following table:
-
-
-
Convention
-
Rationale
-
Enforced By
-
-
-
Every Java source file starts with the Apache licence header.
-
Required by Apache.
-
checkstyle
-
-
-
No tabs in content.
-
Programmers should not have to adjust the tab settings in their editor to be able to read the source code.
-
checkstyle
-
-
-
Indentation of 4 spaces per level.
-
Maximize readability.
-
Not enforced
-
-
-
Comments, identifiers, and project documentation must be in English.
-In general, other languages must not be used, except in translated documentation and language-specific i10n files.
-
-
To avoid the need for everyone to learn all languages, English has become the standard language for many technology projects, and is the only human language that all FOP developers are expected to know.
-
Not enforced
-
-
-
American English spelling should be used. Alternative spelling and idioms are tolerated, but may be changed by anyone to American.
-
Some standard is useful, and American English is widely used and accepted for technology standards and projects.
-
Not enforced.
-
-
-
Fully qualify all import statements (no "import java.util.*")
-
Clarity
-
checkstyle
-
-
-
No underscores in variable names except for static finals.
-
Upper/lower case distinctions can be made in all other variable names, eliminating the need for artificial word boundaries.
-
checkstyle
-
-
-
Opening brace for a block should be on the same line as its control statement (if, while, etc.).
-
Standardization, general preference.
-
checkstyle
-
-
-
Write appropriate javadoc entries for all public and protected classes, methods, and variables.
-
Basic API documentation is needed.
-
checkstyle
-
-
-
By ASF policy, @author tags are officially discouraged.
-However it is permissible to indicate the original author(s) of an entire file or package in a comment provided it follows the copyright and license header.
-
Attribution of subsequent contributions are recorded by the SVN commit history logs, so should not be included.
-
checkstyle
-
-
-
For developers that dislike these conventions, one workaround is to develop using their own style, then use a formatting tool like astyle (Artistic Style) before committing.
-
-
- Checkstyle
-
The java syntax checker "Checkstyle" is used to enforce many of the FOP coding standards.
-The standards enforced through Checkstyle are documented in its configuration file (xml-fop/checkstyle.cfg).
-The conventions defined in the configuration file are an integral part of FOP's coding conventions, and should not be changed without common consent.
-In other words, the configuration file contains additional conventions that are not documented on this page, but are generally accepted as good style within the java community (i.e. they are the default behavior of checkstyle, which the FOP developers have decided to adopt de facto).
-Any apparent contradiction between the configuration file and this document should be raised on the fop-dev mailing list so that it can be clarified.
-
To use the "checkstyle" target in FOP's build process, download the source from the Checkstyle web site, place checkstyle-all-*.jar in the lib directory and call "build checkstyle". Output (in the build directory) includes checkstyle_report.txt and checkstyle_report.xml. If you copy the file contrib/checkstyle-noframes.xsl from Checkstyle into FOP's root directory, you will also get an HTML report.
-
Checkstyle is probably most useful when integrated into your IDE. See the Checkstyle web site for more information about IDE plugins.
-
-
- Java Best Practices
-
The following general principles are a distillation of best practice expectations on the FOP project.
-
-
Apply common sense when coding. When coding keep in mind that others will read your code and have to understand it.
-
Readability comes before performance, at least initially.
-
If you can refactor some code to make it more understandable, please do so.
-
Properly document code, especially where it's important.
-
Use interfaces instead of implementations where possible.
-This favors a clearer design and makes switching between implementations easier (Examples: List instead of ArrayList/Vector, Map instead of HashMap/Hashtable).
-
-
-
Avoid using exceptions for flow control.
-
Try to catch exceptions as much as possible and rethrow higher level exceptions (meaning hiding the low level detailed and putting a message that is more related to the function of your code).
-
It is important not to lose the stack trace which contains important information.
-Use chained exception for that. Avalon Framework provides CascadingException (and similar) for this.
-Exception class names and stack traces must be treated like gold.
-Do whatever is required so that this information is not lost.
-Printing error messages to System.err or System.out is useless in a server-side environment where this info is usually lost.
-
Always log the exception at the higher level (i.e. where it is handled and not rethrown).
-
Try to avoid catching Throwable or Exception and catch specific exceptions instead.
-
-
-
- Resources
-
-
[book on code style] Code Complete by Steve McConnell.
-
[code formatting software] JRefactory.
-
-
-
- Related Links
-
-
Apache XML Graphics Code Repositories
-
Jakarta Code Conventions and Standards (see Coding Conventions and Standards section)
-
-
-
-
- XML
-
-
-
Convention
-
Rationale
-
Enforced By
-
-
-
XML files must always be well-formed. Validation is optional.
-
Document integrity
-
Not enforced
-
-
-
No tabs in content.
-
Users should not have to adjust tab settings in their editor to be able to read the content.
-
Not enforced
-
-
-
Indentation of 2 spaces per level
-
Maximize readability
-
Not enforced
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/design/areas.xml b/src/documentation/content/xdocs/dev/design/areas.xml
deleted file mode 100644
index 6548179de..000000000
--- a/src/documentation/content/xdocs/dev/design/areas.xml
+++ /dev/null
@@ -1,191 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP Design: Area Tree
- $Revision$
-
-
-
-
-
-
- Introduction
-
The Area Tree is an internal representation of the result document, representing pages and their contents.
-To make the concepts clearer and easier to understand, the code to implement the area tree matches the areas defined in the XSL-FO specification.
-
The area tree is created by the layout managers once the layout is decided for a page.
-Once a completed page is finished it can then be added to the area tree.
-From that point forward, the area tree model can then handle the new page.
-The data in the area tree must be minimal and independant.
-This means that the data uses less memory and can be serialized to an output stream if needed.
-
The Area Tree consists of a set of pages, which the actual implemenation places in a set of page sequences.
-
-
- Structure
-
The area tree is a root element that has a list of page-viewport-areas.
-Each page viewport has a page-reference-area which holds the contents of the page.
-To handle the processing better FOP does not maintain a list at the root level but lets the area tree model handle each page as it is added.
-
-
- Page
-
A page consists of a page+viewport pair.
-
The PageViewPort and Page with the regions is created by the
-LayoutMasterSet.
-The contents are then placed by the layout managers.
-Once the layout of a page is complete then it is added to the Area Tree.
-
Inside the page is a set of RegionViewport+Region pairs for each region on
-the page.
-
A page is made up of five area regions.
-These are before, start, body, end and after.
-Each region has a viewport and contains the areas produced from the children in the FO object heirarchy.
-
For the body area there are more subdivisions for before floats, footnotes and the main reference area.
-The main reference area is made from span areas which have normal flow reference areas as children.
-The flow areas are then created inside these normal flow reference areas.
-
Since the layout is done inside a page, the page is created from the pagemaster with all the appropriate areas.
-The layout manager then uses the page to add areas into the normal flow reference areas and floats and footnotes.
-After adding the areas for the body region then the other regions can be done layed out and added.
-
-
- Block Areas
-
Block level areas contain either other blocks or line areas (which is a
-special block area).
-
A block is either positoned or stacked with other block areas.
-
Block areas are created and/or returned by all top level elements in the flow.
-The spacing between block areas is handled by an empty block area.
-A block area is stacked with other block areas in a particular direction, it has a size and it contains line areas made from a group of inline areas and/or block areas.
-
-
- Line Areas
-
A line areas is simply a collection of inline areas that are stacked in the inline progression direction.
-A line area has a height and a start position.
-The line area is rendered by handling each inline area.
-
A line area gets a set of inline areas added until complete then it is justified and vertically alignedi when adding the areas.
-If the line area contains unresolved areas then there will be a line resolver that retains the justification information until all areas in the line are resolved.
-
-
- Inline Areas
-
There are a few different types of inline areas.
-All inline areas have a height and width.
-
Unresolved areas can reserve some space to allow for possible sizes once it is resolved.
-Then the line can be re-justified and finalised.
-
Inline areas are stacked in a line area.
-Inline areas are objects such as character, viewport, inline-container, leader and space.
-A special inline area Word is also used for a group of consecutive characters.
-
The image and instream foreign object areas are placed inside a viewport.
-The leader (with use content) and unresolved page number areas are resolved to other inline areas.
-
Once a LineArea is filled with inline areas then the inline areas need to be aligned and adjusted to fill the line properly.
-
-
- Repeated Areas
-
There are cases where the same subtree could be repeated in the area tree.
-These areas will be returned by the same layout managers.
-So it is possible to put a flag on the created areas so that the subtree data can be cached in the output.
-Examples of this are: static areas, table header/footer, svg.
-
-
- Traits
-
A trait is information associated with an area.
-This could be information such as text colour or is-first.
-
Traits provide information about an area.
-The traits are derived from properties on the formatting object or are generated during the layout
-process.
-Many of the layout traits do not have actual values but can be derived from the Area Tree.
-Other traits that apply when rendering the areas are set on the area.
-Since setting the same value on every area would use a lot of memory then the traits are derived from default or parent values.
-
A dominant trait on a block area is set, for example font colour, so that
-every line area with the same dominant value can derive it.
-The text inline areas then get the font colour set on the inline area or from the line area or from the block area.
-
-
- Classes
-
The following class structure will be used to represent the area tree.
-
- Page Area Classes
-
The page area classes hold the top level layout of a page.
-The areas are created by the page master and should be ready to have flow areas added.
-
-
- Block Area Classes
-
The block areas hold other block areas and/or line areas.
-The child areas are stacked in a particular direction.
-
Areas for tables, lists and block container have their child block areas stacked in different ways.
-These areas a placed with an absolute positioning.
-The absolute positioning is where the blocks are placed with an offset from the parent reference area.
-
-
- Inline Area Classes
-
The inline areas are used to make up a line area.
-An inline area typically has a height, width and some content.
-The inline area is offset from the baseline of the current line area.
-The content of the inline area can be other inline areas or a simple atomic object.
-
-
-
- Forward References
-
The Area Tree maintains a set of mappings from the reference to pages.
-
The PageViewPort holds the list of forward references that need resolving so that if a references is resolved during layout the page can be easily found and then fixed.
-Once all the forward references are resolved then the page is ready to be rendered.
-
To layout a page any areas that cannot be resolved need to reserve space.
-Once the inline area is resolved then the complete line should be adjusted to accomodate any change in space used by the area.
-
-
- Caching
-
We may need to cache pages due to forward references or when keeping all
-pages.
-
This is done by serializing the Page.
-The PageViewport is retained to be used as a key for page references and backward references.
-The Page is serialized to an object stream and then all of the page contents are released.
-The Page is then recoved by reading from the object stream.
-
The PageViewport retains information about id areas for easy access.
-
-
- Extensions
-
The Area Tree holds the Output Document extensions.
-This is information such as pdf bookmarks or other output document specific information that
-is not handled by XSL:FO.
-
It is also possible to create custom areas that extend a normal area.
-The actual data that is rendered could be set in a different way or depend on resolving a forward reference.
-
-
- Area Tree Handlers
-
To handle different situations the handler for the Area Tree handles each
-page as it is added.
-
The RenderPagesModel sends the page directly to the renderer if the page is ready to be rendered. Once a page is rendered it is discarded. The StorePagesModel stores all the pages so that any page can be later accessed.
-
The Area Tree retains the concept of page sequences (this is not in the area tree in the spec) so that this information can be passed to the renderer.
-This is useful for setting the title and organising the groups of page sequences.
-
-
- Status
-
- To Do
-
-
- Work in Progress
-
-
- Completed
-
-
new area tree model
-
changed area tree xml format to match the area tree hierarchy
-As explained in Layout,
-the hierarchy of Layout Managers is responsible for building and placing
-areas. Each Layout Manager is responsible for creating and filling
-areas of a particular type, either inline or block. This document
-explains one potential algorithm for this process. It is based on the
-the generation of break possibilities (BP for short). The
-Layout Managers (LM for short), will generate one or more BP and
-choose the best one. The BP is then used to generate the corresponding
-areas.
-
-
-
- Anatomy of a Break Possibility
-
A break possibility is represented by the BreakPoss class. A
-BreakPoss contains size information in the stacking direction and in
-the
-non-stacking direction (at least for inline areas, it must have both). Flags
-indicating various conditions (ISFIRST, ISLAST, CAN_BREAK_AFTER,
-FORCE_BREAK_AFTER, ANCHORS etc). A BreakPoss contains a reference to
-the top-level LayoutManager which generated it.
-
-
A BreakPoss contains an object implementing
-the BreakPoss.Position interface. This object is specific to the layout
-manager which created the BreakPoss. It should indicate where the
-break occurs and allow the LM to
-create an area corresponding to the BP. A higher level LM Position
-must somehow reference or wrap the Position returned by its child LM in its
-BreakPoss object. The layout manager modifies the flags and dimension
-information in the BP to reflect its own requirements. For example an
-inline FO layout manager might add space-start, space-end, border and
-padding values to the stacking or non-stacking dimensions. It might also
-modify the flags based its on keep properties.
-
-
- Turning Break Possibilities into Areas
-
Once break possibilities have been generated, the galley-level
-layout manager selects the best one
-and passes it back to the LayoutManager which generated it to create
-the area. A LayoutManager is responsible for
-storing enough information in its Position objects to be able to
-create the corresponding areas.
-
-
- A walk-through
-
Layout Managers are created from the top down. First the
-page sequence creates a PageLM and a FlowLM. The PageLM will manage
-finding the right page model (with help from the PageSequenceMaster)
-and managing the balancing act between before-floats, footnotes and
-the normal text flow. The FlowLM will
-manage the normal content in the main flow. We can think of it as a
-galley manager.
-
-
In general, each LM asks its child LMs to return sucessive
-break possibilities. It passes some
-information to the child in a flags object and it gets back
-a break possibility which contains the size in
-the stacking direction as well as information about such things as
-anchors, break conditions and span conditions which can change the
-reference area environment. This process continues down to the lowest
-level of the layout manager hierarchy which corresponds to atomic
-inline-level FOs such as characters or graphics.
-
-
-Each layout manager will repeatedly call getNextBreakPoss on its current
-child LM until the child returns a BP with the ISLAST
-flag set. Then the layout manager moves on to its next child LM (ie,
-it asks the next child FO to generate a layout manager.) Galley level
-layout managers which are Line and Flow will return to their parent
-layout managers either when they have finished their content or when
-they encounter a a BP which will fill one of their areas.
-
-
The break possibilities are generated from the bottom up.
-All inline content must first be broken into
-lines which are then stacked into block areas. This is done by the
-LineLayoutManager, which creates line areas.
-The LineLM asks its child LM to generate a break possibility, which
-represents a place where the line can end. This
-initially means each potential line-end (primarily spaces or forced
-linefeeds and a few other potential line-end characters such as hard
-hyphens.) The text LM returns an object which stores the size in the
-stacking direction as a MinOptMax triplet
-and a cost, which is based on how well this break
-would satisfy the constraints. The Text LM keeps track of its position in
-the text content and returns the total size of the text area it would
-create if it were to break at a given point. The returned BP
-object also contains information about whether the break is forced
-(linefeed) or whether this is the last area which can be generated by
-the LM (ISLAST flag). If a textFO ends on a non-break character, the
-ISLAST flag is set, but the CAN_BREAK_AFTER flag isn't, since we don't
-know if there is any following text in another inline object for
-example.
-
-
Variable size content is taken into account from
-the bottom up. Each LM returns a range of sizes in the stacking
-direction, based on property values. For text, this comes from
-variable word-space values or letter-space values. For other inline
-objects, it may include variable space-start and space-end values
-(after calculation of the entire sequence of space specifiers at a
-particular break possibility.)
-
The main constraint for laying out
-lines is the available inline-progression-dimension (IPD) for the line
-area to be created. This
-depends on the IPD of the reference area ancestor, on the indents of the
-containing fo:block, and on any side-floats which may be intruding on
-this line.
-See below Getting the Reference
-IPD
-for discussion of how the reference area IPD is
-transmitted to the Line LM.
-
For now, let's assume that only the LineLM knows about the IPD
-available to it. Therefore only it can make a decision about which BP
-is the best one; the lower level inline layout managers can only
-return potential break points.
-There are certainly optimizations to this model which can be
-examined later.
-
So the Line LM will ask its child LM(s) for break possibilities until
-it gets back a BP whose stacking dimension could fill the
-line. This means that the BP.stackdim.max >= LineIPD.min. It can look
-for further BP, perhaps one whose stackdim.opt is closer to the
-LineIPD.opt. If it isn't happy with the choice of break possibilities,
-it can go past the end of the line to the next one, and then try to
-find a hyphenation point between the last one which fits and the first
-one which doesn't. If no possibility is found whose min/max values
-enclose the available IPD, some constraint will be violated (and
-reported in the log.) The actual strategy is up to the Line LM and
-should be able to be easily replaced without changing the architecture
-(Strategy pattern).
-
-
The definition of a good break possibility depends on the
-properties at the block and inline level which govern things such as
-wrapping behavior and justification mode. For example, if lines are
-not to be wrapped, only an explicit linefeed can serve as a BP. If
-lines are wrapped but not justified then there is no requirement to
-completely fill the IPD on each line, but a sophisticated layout
-manager will try to achieve "aesthetic rag".
-
-
Note that no areas have actually been created yet. Once the LineLM
-has found a potential break point for the inline content, it can
-calculate the total size of the line area which would be created. The
-size in the IPD is determined by the Line LM based on the chosen BP.
-The size of the line area in the the block-progression-dimension
-depends on the size of the text (or other inline content). These
-values are set by the inline-level LM
-in their returned BP (in terms of ascender and descender heights with
-respect to the baseline). The LineLM adds spacing implied by the
-current line-stacking strategy and line-height property values. It
-stores a reference to the chosen inline BP and "wraps" that in its own
-Position object which it stores in the BP it returns to its parent LM
-(the block layout manager).
-
The block LM now has a potential break position after its
-first line. It assigns that possibility a cost, based on widow, orphan
-and keep properties. It can also calculate the total size of the block
-area it would create, were it to end the area after this line. It does
-this by adding any padding and border (taking into account
-conditionality). It also calculates space-before and space-after
-values, or contributes to building up a sequence of such values.
-With this information, the block LM creates a new BP (or
-updates the existing one). It stores a Position object in this
-BP which wraps the returned BP from its child Line LM.
-It returns the new BP to its parent and so on, back up to the
-FlowLM.
-
Obviously there is more complicated logic involved when dealing
-with lists and tables. These cases need to be walked through in detail.
-
The FlowLM sees if the returned stacking dimension will still
-fit in its available block-progression-dimension (BPD). It repeatedly calls
-getNextBreakPoss on its
-child LMs until it reaches the maximum BPD for the flow reference area
-or until there is no more content to lay out. If one child LM is
-finished, it moves on to the next until the last child LM has returned
-a BP with the ISLAST flag set. If any child LM returns a
-BP with a FORCE_BREAK_BEFORE or SPAN flag set, the FlowLM will
-force layout of any pending break possibilities and return to its
-parent (the PageLM) in order to handle the break or span condition.
-
If the returned BP has any new before-float or footnote anchors in
-it (ANCHOR flag in the
-BP), the FlowLM will also return to the PageLM. The PageLM must then
-try to find space to place the floats, possibly asking the FlowLM for
-help if the body contains multiple columns.
-
-
- Some issues
-
Following are a few remarks on specific issues.
-
- Where Line Layout Managers are created
-
If the first child FO in a block FO is an inline-level FO
-such as text, the block LM creates an intermediate level LineLM
-to layout the
-sequence of inline content into Lines. Note that the whole sequence of
-inline FOs is managed by a single instance of LineLM. The LineLM
-becomes the parent to the various inline-level LM created by each
-individual inline FO.
-Since an fo:block can have both block and inline content, its LM
-may create a sequence of intermixed BlockLM and LineLM.
-
-
- Getting the reference IPD
-
When the layout process starts, with the FlowLM asking its first
-child LM for a break possibility, the IPD isn't known, since we don't
-know whether
-the first FO might be spanning, or on which page it might start. (Of
-course, if all page masters in the sequence have the same region-body IPD
-and all have only a single column, the IPD will never change
-and could already be calculated before starting layout.)
-The FlowLM gets its
-first child LM and calls its getNextBreakPoss method. That is a child LM for
-some block-level FO. For now, suppose it's an fo:block. The BlockLM
-will create its first child LM, which may be another block-level LM in
-the case of nested blocks or a LineLM as explained above. (Question:
-do we need a START flag for layout status?)
-
-
We keep calling getNextBreakPoss on lower level layout managers until we
-get down to the inline level or to a level which cannot have break-before
-properties, such as a list-item-label. At that point, we assume we are
-going to have to layout some actual content. But we can't do that yet
-since we don't know the inline-progression-dimension. So we return a
-BP object which has 0 size in the stacking dimension, but which
-has flags set to signal to
-higher-level layout managers what needs to be done. If it has a break-before
-property or a span property, it stores these in the BP. If
-no reference IPD is yet defined, it sets a flag to get that. It then
-returns to its parent. The parent LM will inspect the BP object
-returned. In general, it "wraps" it with information about its own
-needs. If the returned BP is not actually returning any potential
-areas, the LM can still add information about its own break or span
-requirements. This return path continues back up to the PageLM. It
-will then check break and span requirements and create a new page
-if necessary using the appropriate page-master. At that point, the
-reference IPD for the main
-flow is known and is set in the flags object used for
-the next getNextBreakPoss call to the lower level LM.
-
Using this information, the BlockLM parent can now calculate
-the available IPD for its LineLM child, based on its indents.
-(If there are any
-side-floats information about the intrusion must be passed down by the
-FlowLM to lower level managers.) The LineLM can now generate a series
-of BreakPoss objects, which it passes back to its parent LM.
-
-
-
- Hyphenation
-
-The LineLM is responsible for initiating hyphenation if it is allowed
-by the properties and if no satisfactory BP can be found without
-hyphenating. The hyphenation manager is passed two break
-possibilities, one whose IPD is less than the desired line area IPD
-and one whose IPD is greater. These break possibilities might have
-been generated by different inline-level layout managers (text + a
-wrapper with a color change for example), though
-frequently they represent two positions in a single text run.
-If hyphenation is successful, a new BP is
-returned. The LineLM may look for several intermediate BP
-based on the "cost" of the returned possibilities. If no intermediate
-BP is found, the line will be "short", the white-space stretch will be
-exceeded, or perhaps the content will be overflowed or clipped,
-depending on various property settings.
-
-
- Optimizing
-
It obviously seems inefficient to go down to the lowest level
-LM and back up to the FlowLM for every possible line-break
-decision. It seems like it would be possible to optimize by letting
-the lower level layout managers run until they had exceeded the
-current limit in
-the stacking direction. They would then return control to the "galley"
-level (LineLM or FlowLM) which would fine-tune the break decision by
-asking the lower level LM to find a previous BP which would fit. At
-the inline level, this means hyphenation as described above.
-
Another interesting question is at what point pending break
-possibilities can be turned into areas.The idea is to wait until we
-are sure we won't have to redo the breaking. This depends on the
-sophistication of the layout strategy. For example, if a
-linebreak can be considered final if the line is full and there are no
-anchors on the line, we could create the LineArea at that point. But
-if we are willing to change a previous line-end decision to get a
-better overall composition of a whole group of lines (to prevent multiple
-hyphens for example), we might wait until the LineLM had finished
-laying out all its material and then make all the Lines at once.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/design/configuration.xml b/src/documentation/content/xdocs/dev/design/configuration.xml
deleted file mode 100644
index 64ba74813..000000000
--- a/src/documentation/content/xdocs/dev/design/configuration.xml
+++ /dev/null
@@ -1,205 +0,0 @@
-
-
-
-
-
-
-
-]>
-
-
-
- Apache⢠FOP: Configuration and Logging
- $Revision$
-
-
-
-
-
- Configuration File Basics
-
The Apache⢠FOP configuration file is an XML file containing a
-variety of settings that are useful for controlling FOP's
-behavior, and for helping it find resources that you wish it to
-use.
-
The easiest way to get started using a FOP configuration file
-is to copy the sample found at {fop-dir}/conf/fop.xconf
-to a location of your choice, and then to edit it according to your
-needs. It contains templates for the various configuration options,
-most of which are commented out. Remove the comments and change the
-settings for entries that you wish to use. Be sure to follow any
-instructions, including comments which specify the value range. Also,
-since the configuration file is XML, be sure to keep it
-well-formed.
-
-
-
- Making Configuration Available to FOP
-
After creating your configuration file, you must tell FOP how
-to find it.
-
-
- From the Command Line
-
When you run FOP from the command-line, use the
-“-c” command-line option with the path to the
-configuration file as the option value.
-
-
-
- A Configuration File in an Embedded Application
-
FOP uses the Avalon framework configuration package
-org.apache.avalon.framework.configuration. For detailed
-information, see the documentation of the package.
-
If you want to use a user configuration file with your
-embedded program, you need to build an Avalon configuration
-object from it, and register that with the user agent:
-
-
-
You can find example code in FOP's
-apps.CommandLine class, method
-createUserConfig.
-
-
-
- Programmatically Building the Configuration
-
You can also build the configuration object programmatically,
-instead of building it from an external file. Make sure that the
-configuration object is equivalent to a configuration object that
-would be obtained from a correct configuration file. Register the
-configuration object with the user agent as described above.
-
-
-
-
-
- The Configuration File
-
The top-level element is arbitrary. You may give it any name
-that is useful for you, e.g. <fop-configuration
-version="2">.
-
Inside the top-level element the configuration may contain
-three sections: userAgent, renderers,
-and hyphenation. At the moment of this writing the
-userAgent and hyphenation sections are
-not used by FOP.
-
The renderers section has subsections called
-renderer. There may be one subsection for each type
-of renderer. The renderers are identified by their MIME type,
-which is given in the mime attribute. For example:
-<renderer mime="application/pdf">. The content
-of each renderer subsection depends on the type of
-renderer.
-
The PDF renderer (MIME type application/pdf) has
-several options:
-
-
filterList
-
Contains a number of value elements, whose
-content specify a filter which should be applied. Possible
-filters are: flate, ascii-85,
-ascii-hex. The flate filter is on by
-default.
-
fonts
-
Contains a number of font elements. Each
-font element represents a font file,
-e.g. arial.ttf. It contains a number of
-font-triplet elements, defining the font triplets
-which are provided by this font file. See the example
-configuration file for details.
-
-
The example configuration file provides for details about the
-other renderers.
-
-
-
- Hyphenation
-
When FOP needs to load a hyphenation file for a certain
-language and country combination, it follows these steps.
-
-
FOP searches for the compiled hyphenation file (extension
-hyp in the directory hyph in the
-class path.
-
FOP searches for the compiled or the XML hyphenation file
-in a user directory. At the time of this writing FOP does not
-read the configuration file for the user directory. It always
-uses the directory /hyph.
-
-
It is possible to add user hyphenation files to FOP's
-hyphenation directory when FOP is built. The directory
-containing user hyphenation files must be specified in the
-variable user.hyph.dir in the local build
-properties file. All hyphenation files in the directory are
-compiled, and the compiled files are added to the hyphenation
-directory in the build directory.
-
See FOP: Hyphenation for
-more information on creating and modifying hyphenation within FOP.
-
-
-
- Fonts
-
Font configuration information is included in the FOP
-configuration file as describe above. It is documented in more
-detail at FOP: Fonts. Note
-especially the section entitled Register Fonts with FOP.
-
-
-
- Logging
-
FOP uses the Jakarta Commons logging package
-org.apache.commons.logging. For detailed information, see
-the documentation of the package.
-
Commons logging is entirely configured by the user, using
-Java system properties. Configuration happens in two stages.
-
First you configure which logging implementation you want
-to use. For example:
-
-
SimpleLog is the default logging package on most Java
-systems. On Java 1.4 systems JDK 1.4 is the default.
-
Secondly, you configure the selected logging package. How
-this is done depends on the logging package. The most important
-feature is the log level. The default is level “info”. An
-example configuration file for SimpleLog is:
-
-
FOP uses several named loggers. When you set the logging level
-for all loggers to “info”, you get a decent small amount
-of information
-about application progress. The debugging and especially the trace
-levels produce a lot of output. If you need these logging levels,
-it is wise to switch them on for one or several specific loggers. The
-names of the loggers can be found in the source files. Many loggers
-bear the name of their package, their class or of a superclass.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/design/embedding.xml b/src/documentation/content/xdocs/dev/design/embedding.xml
deleted file mode 100644
index 075e4b152..000000000
--- a/src/documentation/content/xdocs/dev/design/embedding.xml
+++ /dev/null
@@ -1,149 +0,0 @@
-
-
-
-
-
-
-
- Apache⢠FOP Design: Embedding Apache� FOP in Other Applications
- $Revision$
-
-
-
-
-
-
-
- Introduction
-
-This is the design for the external interface when Apache⢠FOP is to be embedded
-inside another java application.
-
-
-Common places where FOP is embedded is in a report production application
-of a server side application such as Cocoon.
-
-
-
- Settings
-
- User Agent
-
-Possible meanings for a user agent:
-
-
-
something that makes decisions where the specifiction indicates
-that the user agent should decide
-
FOP as the user agent, represented by a class that handles
-various setup and decision values
-
an class that handles context for a particular FOP conversion
-that can be configured/overridden when embedding
-
-
-
-The user agent is responsible for supplying user or context
-specific information. The list of user agent values can be found on the
-User Agent page.
-
-
-
- Logging
-
-
logging level
-
logging messages of various levels
-
error handling
-
Logging setup (LogKit, Log4J, JDK14Logging)
-
-
-
- XML input
-
-
various ways to supply FOP with the xsl:fo file, fo, xml+xsl
-
sax handler
-
-
-
- general options
-
-
base url
-
uri resolvers
-
which implementation of a particular LayoutManager to use
-
-
-
- Rendering Options
-
-
embedding fonts
-
compression in pdf
-
image embedding
-
-
-for the PS renderer (eventually):
-
-
-
PostScript Level
-
PPD to use
-
binary/ascii switch
-
-
-
- Render Results
-
-Generate Output statistics from FOP:
-
-
-
Number of pages total
-
Number of pages of each page-sequence
-
page-master used for each page (could be used to control
-the paper bin to get paper from, important for me in conjunction
-with PS Renderer)
-
recoverable errors such as overflow
-
-
-
- Setting Up
-
-The Driver handles the XML input.
-The user agent information is through the FOUserAgent.
-Handle logging through the user agent.
-Options could also be handled through the user agent, using mime type
-selection for renderer options.
-
-
-
- Others
-
-Render to more than one renderer at once (maybe not from the command line).
-For example you could generate a PDF for the archive
-and the PS for the printer in one run. It would probably be faster than
-converting the PDF to PostScript afterwards.
-Make the fo tree reuseable.
-If the fonts are the same then use the
-same area tree to output to different renderers.
-
-
-Several code pieces for resolving URLs and/or
-file locations are scattered all over FOP and Batik. These should
-be replaced with an URIResolver invocation to unify behaviour and
-remove redundancies.
-
-Apache⢠FOP provides an extension mechanism to add extra functionality. There
-are a number of different types of extensions that apply to different
-steps when converting FO into the rendered output.
-
-
-
- Extensions
-
-SVG Graphic - This applies to svg and any other xml document that
-can be converted into svg in the output. All that is required is
-the element mapping for the xml and a converter that changes the
-document into svg. This conversion is done in the FO Tree. The
-conversion is done by the top level element of the namespace
-or in the case of an external image a Converter.
-
-
-XML Document - Instead of converting the document into svg it
-can be passed directly to the renderer. The renderer will need
-to have a handler for the xml document. This handler can add
-information directly to the output document.
-
-
-Output Document - This is used to add document level information
-to the output result. Such an extension will set information that
-is passed to the output document. The area tree handles these
-extensions and passs along the information to the renderer.
-The extension may contain resolveable objects. The extension
-can be passed to the renderer once resolve either immediately,
-after the next page or at the end of the document. This is so that
-the extension can be handled according to other associated data.
-
-
-FO Area - This is where an extension creates an normal or extended
-area in the Area Tree. This is useful when the normal FO objects
-cannot create the area in the way that is needed.
-
-
-Resolveable - In some cases it may require information to be
-resolved for information such as page numbers. This can apply
-to the XML Document, FO Area or output document extensions.
-
-
-
Add a string ['(Continued)'] to a table header if the table spans
-multiple pages. These tables are part of the content and can start
-anywhere in the page.
-
Separate page number display for a subsection. ie. - master document
-is page 4 of 7, but subsection is page 2 of 3.
-
-
-
- Examples
-
-Plan - The plan extension is a simple SVG graphic extension.
-Given a plan document either inside an InstreamForeignObject
-or as an external graphic, it converts the plan document into
-an svg graphic. The svg graphic is then passed through the
-Area Tree to the Renderer. The Renderer then renders the svg
-graphic as normal.
-
-
-PDF Outline - This is output document extension. If rendering to
-pdf and this extensionis used then the bookmark information is
-passed to the pdf document. This information is then set on the
-document.
-
-
-PDF Additions - This can be done with an XML Document extension.
-A simple xml document is defined that provides the appropriate
-information. When the document is rendered a handler converts the
-document into PDF markup.
-
-
-For example:
-
-
-to result in a text box referencing the following PDF action:
-
-
-
-
- Status
-
- To Do
-
-
- Work In Progress
-
-
mathml extension
-
another xml -> svg extension
-
svg text normal text if that can be handled otherwise stroked this is done automatically
-
-
-
- Completed
-
-
svg now in an xml handler, FOP can be used without batik
-
bookmark extension improved a bit - changed bookmark extension, now requires a wrapping element bookmark
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/design/fotree.xml b/src/documentation/content/xdocs/dev/design/fotree.xml
deleted file mode 100644
index 03f98d830..000000000
--- a/src/documentation/content/xdocs/dev/design/fotree.xml
+++ /dev/null
@@ -1,143 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP Design: FO Tree
- $Revision$
-
-
-
-
-
-
- Introduction
-
The FO Tree is an internal hierarchical representation (java objects and properties) of the input XSL-FO document, and is created from the parsing of that XSL-FO document.
-The process of building the FO Tree corresponds to the Objectify step in the XSL-FO spec.
-The FO Tree is an intermediate structure which will later be converted into the area tree.
-
-
- Processing
-
The SAX Events that are fired by the parsing process are caught by the FO Tree system.
-Events for starting an element, ending an element, and text data are assembled by the FO Tree system into a set of objects that represent the input FO document.
-A class exists for each element in the XSL-FO set, and an object in the appropriate class is created for each element in the input XSL-FO.
-
For attributes attached to an XSL-FO element, a property list mapping is used to convert the attribute into properties of the object related to the element.
-
To the extent possible, validation is checked as the FO Tree is built. An appropriate error message is returned to the user, and processing continues if possible.
-
Elements from foreign namespaces that are recognized by FOP fall into the following categories:
-
-
Pass-thru: These are placed into a DOM object, which is then passed through FOP directly to the renderer. SVG is an example.
-
FOP Internal: These are placed into objects that can then be used by FOP. An example of this would be an element that the layout process will use to create an area. Another example would be an element that contains setup information for the renderer.
-
-
For unrecognized namespaces, a dummy object or a generic DOM is created.
-
While the tree building is mainly about creating the FO Tree, some FO Tree events trigger processes in other parts of FOP.
-The end of a page-sequence element triggers the layout process for that page-sequence (see discussion of Recycling).
-Also, the end of the XML document tells the renderer that it can finalize the output document.
-
-
- Recycling FO Tree Memory
-
To minimize the amount of memory used by FOP, we wish to recycle FO Tree memory as much as possible.
-There are at least three possible places that FO Tree fragments could be passed to the Layout process, so that their memory can be reused:
-
-
- fo:block It might be tempting to start laying out pages as soon as the first fo:block object is finished. However, there are many downstream things that can affect the placement of that block on a page, such as graphics and footnotes. So, in order to maintain conformance to the XSL-FO specification, and create high-quality output, we must see more of the document.
-
- fo:root The other extreme is to wait until the entire document is read in before processing any of it. This essentially means that there is no memory recycling. Processing the document correctly is more important than saving memory, so this option would be used if there were no better alternative.
-
- fo:page-sequence The page-sequence object provides a nice clean break in the document. Content from one page-sequence will never interfere with nor affect the placement of the content of another. FOP uses this option as the optimum way to maintain compliance with the standard and to minimize memory consumption.
-
-
-
- FO Tree Serialization
-
This issue is implied by the requirement to process documents of arbitrary size. Unless some arbitrary limit is placed on the size of page-sequence objects, FOP must be able to serialize FO tree fragments as necessary.
-
-
- Notes About Specific Elements
-
- page-master
-
The first elements in a document are the elements for the page master setup.
-This is usually only a small number and will be used throughout the document to create new pages.
-The root element keeps these objects as a factory to create the page and appropriate regions whenever a new page is requested by the layout.
-The objects in the FO Tree that represent these elements are themselves the factory.
-
-
- flow
-
The elements within the flow of a page-sequence are those that are needed for the layout process.
-These element will later be used to create areas in the layout process.
-
-
- Other Elements
-
The remaining FO Objects are things like page-sequence, title and color-profile.
-Each is handled by its parent element.
-The root handles declarations, and declarations maintains a list of colour profiles.
-The page-sequences are direct descendants of root.
-
-
-
- Implementation Notes
-
- FONode
-
The base class for all objects in the tree is FONode. The base class for
-all FO Objects is FObj (which is a subclass of FONode). Other FONode subclasses are for foreign and unknown XML.
-
Each FO in FOP has a parent (except root) and a Vector of children. Java inheritance (superclasses and subclasses) is used to enforce constraints required by the FO hierarchy.
-
FONode, among other things, ensures that each FO has a parent, and provides the mechanism for keeping track of its children.
-
Each xml element is represented by a java object.
-The classes for these objects are grouped into packages for convenience:
-
-
pagination: org.apache.fop.fo.pagination.*
-
flow: org.apache.fop.fo.flow.*
-
other: org.apache.fop.fo.*.
-
-
-
- Creating FO Objects
-
The process of creating an FO Object is as follows (see FOTreeBuilder.startElement() for details):
-
-
An FO maker is selected from a hashmap lookup using the namespace and
-element name.
-
This maker is then used to create the new object that represents the FO element.
-
The new object is given its element name, an FOUserAgent (for resolving properties, etc.), a logger and its attributes.
-
The new object is added to the FO tree as a child of the current parent.
-
Child elements are then processed. This is an iterative process: the child elements go through the same process here documented for their parent.
-
-
-
- Foreign XML
-
For SVG, the DOM needs to be created with Batik, so an element mapping is used to read all elements in the SVG namespace and pass them into the Batik DOM.
-
The base class for foreign XML is XMLObj. This class handles creating a
-DOM Element and the setting of attributes. It also can create a DOM
-Document if it is a top level element, class XMLElement.
-This class must be extended for the namespace of the XML elements. For
-unknown namespaces the class is UnknowXMLObj.
-
If some special processing is needed, then the top level element can extend
-the XMLObj. For example the SVGElement makes the special DOM required for
-batik and gets the size of the svg.
-
Foreign XML will usually be in an fo:instream-foreign-object.
-The XML will be passed to the renderer as a DOM, which is expected to know how to handle it.
-XML from an unknown namespace will be ignored.
-
See Input Parsing Namespaces for more discussion and links to information about using foreign XML in FOP.
-
-
- Unknown Elements
-
If an element is in a known namespace but the element is unknown within that namespace, then an Unknown object is created.
-This generally indicates an input error: perhaps an element from an older version of the XSL-FO standard, or a misspelling.
-The Unknown object is mainly used to provide information to the user.
Images may only be needed to be loaded when the image is rendered to the
-output or to find the dimensions.
-An image url may be invalid, this can be costly to find out so we need to
-keep a list of invalid image urls.
-
We have a number of different caching schemes that are possible.
-
All images are referred to using the url given in the XSL:FO after
-removing "url('')" wrapping. This does
-not include any sort of resolving such as relative -> absolute. The
-external graphic in the FO Tree and the image area in the Area Tree only
-have the url as a reference.
-The images are handled through a static interface in ImageFactory.
-
-
-
- Threading
-
-
In a single threaded case with one document the image should be released
-as soon as the renderer caches it. If there are multiple documents then
-the images could be held in a weak cache in case another document needs to
-load the same image.
-
-
In a multi threaded case many threads could be attempting to get the same
-image. We need to make sure an image will only be loaded once at a
-particular time. Once a particular document is finished then we can move
-all the images to a common weak cache.
-
-
-
- Caches
-
- LRU
-
All images are in a common cache regardless of context. To limit the size
-of the cache the LRU image is removed to keep the amount of memory used
-low. Each image can supply the amount of data held in memory.
-
-
-
- Context
-
Images are cached according to the context, using the FOUserAgent as a key.
-Once the context is finished the images are added to a common weak hashmap
-so that other contexts can load these images or the data will be garbage
-collected if required.
-
If images are to be used commonly then we cannot dispose of data in the
-FopImage when cached by the renderer. Also if different contexts have
-different base directories for resolving relative url's then the loading
-and caching must be separate. We can have a cache that shares images among
-all contexts or only loads an image for a context.
-
-
-
The cache uses an image loader so that it can synchronize the image
-loading on an image by image basis. Finding and adding an image loader to
-the cache is also synchronized to prevent thread problems.
-
-
-
- Invalid Images
-
-
-If an image cannot be loaded for some reason, for example the url is
-invalid or the image data is corrupt or an unknown type. Then it should
-only attempt to load the image once. All other attempts to get the image
-should return null so that it can be easily handled.
-This will prevent any extra processing or waiting.
-
-
-
- Reading
-
Once a stream is opened for the image url then a set of image readers is
-used to determine what type of image it is. The reader can peek at the
-image header or if necessary load the image. The reader can also get the
-image size at this stage.
-The reader then can provide the mime type to create the image object to
-load the rest of the information.
-
-
-
- Data
-
-
The data usually need for an image is the size and either a bitmap or the
-original data. Images such as jpeg and eps can be embedded into the
-document with the original data. SVG images are converted into a DOM which
-needs to be rendered to the PDF. Other images such as gif, tiff etc. are
-converted into a bitmap.
-Data is loaded by the FopImage by calling load(type) where type is the type of data to load.
-
-
-
-
- Rendering
-
-
Different renderers need to have the information in different forms.
-
-
-
- PDF
-
original data
JPG, EPS
-
bitmap
gif, tiff, bmp, png
-
other
SVG
-
-
-
- PS
-
bitmap
JPG, gif, tiff, bmp, png
-
other
SVG
-
-
-
- awt
-
bitmap
JPG, gif, tiff, bmp, png
-
other
SVG
-
-
-
The renderer uses the url to retrieve the image from the ImageFactory and
-then load the required data depending on the image mime type. If the
-renderer can insert the image into the document and use that data for all
-future references of the same image then it can cache the reference in the
-renderer and the image can be released from the image cache.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/design/index.xml b/src/documentation/content/xdocs/dev/design/index.xml
deleted file mode 100644
index 2ea9ee201..000000000
--- a/src/documentation/content/xdocs/dev/design/index.xml
+++ /dev/null
@@ -1,160 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP Design: Introduction
- $Revision$
-
-
-
-
-
- The articles in this section pertain mainly to the redesign or trunk line of development.
-The redesign is mainly focusing on parts of the layout process (converting the FO tree into the Area Tree).
-Therefore other (non-layout) sections in this document are probably largely accurate for the maintenance branch, but should be used with care in that context.
-
- The Black Box View
-
From a user's standpoint, Apache⢠FOP is a black box that an xml file as input, performs some magic, then creates the desired output:
-
-
Apache� FOP from a User's Standpoint
-
-
Process
-
Result
-
-
-
.
-
XSL-FO document
-
-
-
FOP
-
Output: PDF, Postscript, Print, etc.
-
-
-
Although this is simple, it is useful in defining the outer limits of FOP's core processing.
-There may be other things going on under FOP's control that are not really part of FOP.
-For example, FOP provides a convenience mechanism that takes semantic XML + an XSLT transformation as input, instead of XSL-FO.
-This is done outside of FOP's core processing (by Xalan), and it is therefore outside the scope of FOP's design, and outside the scope of the FOP design documents.
-
-
- Primary Design Goals
-
A discussion of project design properly begins with a list of the goals of the project.
-Out of these goals will flow the design issues and details, and eventually, the implementation.
-
- Conformance to the XSL-FO Specification
-
The current design goal is to reach the "basic" level of conformance, and to have enough flexibility in the design to reach "complete" conformance without major rewriting.
-After "basic" conformance is achieved, it is probable that higher levels of conformance will be sought.
-
-
- Process Files of Arbitrary Size
-
Except for user storage limitations, the design goal is to be able to process files of any size. In a separate but related issue, the design goal is to be able to process page-sequence elements of any size. (See Recycling FO Tree Memory for a discussion of the use of page-sequence as a logical subdivided "chunk" on an FO document).
Many FOP design decisions revolve around trying to minimize the use of memory.
-The primary purpose here is to reduce the amount of data that must be serialized to storage during processing.
-Since our primary design goals include the ability to process files of arbitrary size, there is no way to avoid the need to serialize.
-However, many FOP users provide web access to documents that are created in real time.
-Performance is therefore an important issue in these real-world applications.
-To the extent that it can be done so without jeopardizing the primary design goals, FOP developers have identified keeping a small memory footprint as being an important secondary goal.
-
-
-
- The Big Picture View
-
With our design goals outlined, we'll now open the Black Box and look at the major processes inside.
-FOP has adopted the basic structure of the XSL-FO standard itself as a convenient model for the major processes in FOP. The Result in each row is the input for the next.
-
-
FOP's Big Picture Design
-
-
Process
-
Process Result/Input for Next
-
Notes
-
-
-
.
-
XSL-FO document
-
.
-
-
-
Parsing
-
FO Tree
-
.
-
-
-
Refinement
-
Refined FO Tree
-
.
-
-
-
Layout
-
Area Tree
-
Layout and Area Tree are not needed or used for the structural outputs (MIF and RTF), as they are not paginated.
-
-
-
Renderer
-
Output: PDF, Postscript, Print, etc.
-
.
-
-
-
In general, each piece of data will be processed in the same way.
-However, some information may be used more than once, and some may be used out of order.
-To reduce memory, one process may start before the previous process is completed.
-
For a detailed discussion of the design of any component, follow its link in the table above.
-Each component outlines the design issues which have already been addressed.
-These resolution of these design issues is in support of the primary and secondary goals, so they are not necessarily written in stone.
-However, most of them have been discussed at length among the developers, and are reasonably well settled.
-
-
-
-
- Vocabulary
-
This section will attempt to provide information about any jargon used in the design documentation.
-
There is a rough relationship between terms used to describe the various trees in XSL-FO processing, all of which come from the XML and XSL-FO standards. In the table below, the terms (but not the actual items) in each column are roughly equivalent to each other:
-
-
-
Tree Concept
-
Thing (Noun)
-
Descriptive Item (Adjective)
-
-
-
XML
-
Element
-
Attribute
-
-
-
FO Tree
-
Object
-
Property
-
-
-
Area Tree
-
Area
-
Trait
-
-
-
-
LM: Layout Manager.
-
PLB: PropertyListBuilder.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/design/layout.xml b/src/documentation/content/xdocs/dev/design/layout.xml
deleted file mode 100644
index 394fa4763..000000000
--- a/src/documentation/content/xdocs/dev/design/layout.xml
+++ /dev/null
@@ -1,407 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP Design: Layout
- $Revision$
-
-
-
-
-
-
- Introduction
-
The role of the layout managers is to build the Area Tree by using the information from the FO Tree.
-The layout managers decide where information is placed in the area tree.
-
A layout manager is typically associated with an FO Object but not always.
-
The layout managers are in between the FO Tree and the Area Tree.
-They get information from the FO Tree and create areas and build the pages.
-They hold the state of the layout process as it builds up the areas and pages.
-They also manage the handling of breaks and spacing between areas.
-
FO Objects can have two types of properties, ones that relate to the layout and ones that relate to the rendering.
-The layout related properties area used by the layout managers to determine how and where to create the areas.
-The render related properties should be passed through to the renderer in the most efficient way possible.
-
The aim of the layout system is to be self contained and allow for easy changes or extensions for future development.
-For example the line breaking should be decided at a particular point in the process that makes it easier to handle other languages.
-
The layout begins once the hierarchy of FO objects has been constructed.
-Note: it may be possible to start immediately after a block formatting object has been added to the flow but this is not currently in the scope of the layout.
-It is also possible to layout all pages in a page sequence after each page sequence has been added from the xml.
-
The layout process is handled by a set of layout managers.
-The block level layout managers are used to create the block areas which are added to the region area of a page.
-
The traversal is done by the layout or structure process only in the flow elements.
-
-
- Design Issues
-
- Keep Layouts Simple
-
Layout should handle floats, footnotes and keeps in a simple, straightforward way.
The issue here is that we wish to recycle the Area Tree memory as much as possible. The problem is that forward references prevent pages from being resolved until the forward references are resolved. If memory is insufficient to store unresolved pages, Area Tree fragments must be serialized until resolved.
-
FOP developers have discussed adding the capability of using an Area Tree to render to more than one output target in the same run, which would be a complicating factor in disposal of pages as they are rendered.
-
-
-
- Layout Managers
-
The layout managers are set up from the hierarchy of the formatting object tree.
-A manager represents a hierachy of area producing objects.
-A manager is able to handle the block area(s) that it creates and organise or split areas for page breaks.
-
Normally any object that creates a block area will have an associated layout manager.
-Other cases are tables and lists, these objects will also have layout managers that will manager the group of layout managers that make up the object.
-
A layout manager is also able to determine height (min/max/optimum) and keep status.
-This will be used when organising the layout on a page.
-The manager will be able to determine the next place a break can be made and then be able to organise the height.
-
A layout manager is essentially a bridge between the formatting objects and the area tree.
-It will keep a list of line areas inside block areas.
-Each line area will contain a list of inline areas that is able to be adjusted if the need arises.
-
The objects in the area tree that are organised by the manager will mostly contain the information about there layout such as spacing and keeps, this information will be thrown away once the layout for a page is finalised.
-
-
- Creating Managers
-
The managers are created by the page sequence.
-The top level manager is the Page manager.
-This asks the flow to add all managers in this page sequence.
-
For block level objects they have a layout manager.
-Neutral objects don't represent any areas but are used to contain a block level area and as such these objects will ask the appropriate child to create a layout manager.
-
Any nested block areas or inline areas may be handled by the layout manager at a later stage.
-
-
- Using Managers
-
Block area layout managers are used to create a block area, other block level managers may ask their child layout managers to create block areas which are then added to the area tree(subset).
-
A manager is used to add areas to a page until the page is full, then the manages contain all the information necessary to make the decision about page break and spacing.
-A manager can split an area that it has created will keep a status about what has been added to the current area tree.
-
-
- Page Layout
-
Once the Page layout manager, belonging to the page sequence, is ready then we can start laying out each page.
-The page sequence will create the current page to put the page data, the next page and if it exists
-a last page.
-
The current page will have the areas added to it from the block layout
-managers.
-The next page will be used when splitting a block that goes over the page break.
-Note: any page break overrides the layout decided here.
-The last page will be necessary if the last block area is added to this page.
-The size of the last page will be considered and the areas will be added to the last page instead.
-
The first step is to add areas to the current page until the area is full and the lines of the last block area contain at least n(orphans) and at least n(orphans) + n(widows) in total.
-This will only be relevant for areas at the start or end of a particular reference area.
-
-
The spacing between the areas (including spacing in block areas inside an inline-container) will be set to the minimum values.
-This will allow the page to have at least all the information it needs to organise the page properly.
-
This should handle the situation where there are keeps on some block areas that go over the end of the page better.
-It is possible that fitting the blocks on the page using a spacing between min and optimum would give a closer value to the optimum than putting the blocks on the next page and the spacing being between optimum and max.
-So if the objects are placed first at optimum then you will need to keep going to see if there is a lower keep further on that has a spacing that is closer to the optimum.
-
The spacing and keep information is stored so that the area positions
-and sizes can be adjusted.
-
-
- Balancing Page
-
The page is vertically justified so that it distributes the areas on the page for the best result when considering keeps and spacing.
-
-
- Finding Break
-
First the keeps are checked.
-The available space on the page may have changed due to the presence of before floats or footnotes.
-The page break will need to be at a height <= the available space on the page.
-
A page break should be made at the first available position that has the lowest keep value when searching from the bottom.
-Once the first possible break is found then the next possible break, with equally low keep value, is considered.
-If the height of the page is closer to the optimal spacing then this break will be used instead.
-
Keep values include implicit and explicit values when trying to split a block area into more than one area.
-Implicit keeps may be such things as widows/orphans.
-
If the page contains before floats or footnotes then as each area or line area is removed the float/footnote should also be removed.
-This will change the available space and is a one way operation.
-The footnote should be removed first as a footnote may be placed on the next page.
-The lowest keep value may need to be reassessed as each conditional area is removed.
-
The before float and footnote regions are managed so that the separator
-regions will be present if it contains at least one area.
-
-
- Optimising
-
Once the areas for the page are finalised then the spacing will need to be adjusted.
-The available height on the page is compared with the min and max spacing.
-All of the spacing in all the areas on the page is then adjusted by the appropriate percentage value.
-
-
- Multi-Column Pages
-
In the case of multi-column pages the column breaks and eventually the page break must be found in a slightly different way.
-
The columns need to be layed out completely from first to last but this can only be done after a rough estimate of all the elements on the page in case of before floats or footnotes.
-
So first the complete page is layed out with all columns filled with areas and the spacing at a minimum.
-Then if there are any before floats or footnotes then the availabe space is adjusted.
-Then each the best break is found for each column starting from the first column.
-If any before floats or footnotes are removed as a result of the new breaks and optimised spacing then all the columns should still be layed out for the same column height.
-
-
- Completing Page
-
After the region body has been finished the static areas can be layed out.
-The width of the static area is set and the height is inifinite, that is all block areas should be placed in the area and their visibility is controlled be other factors.
-
The area tree for the region body will contain the information about markers that may be necessary for the retrieve marker.
-
The ordering of the area tree must be adjusted so that the areas are before, start, body, end and after in that order.
-The body region should be in the order before float, main then footnote.
-
-
- Line Areas
-
Creating a line areas uses a similair concept.
-Each inline area is placed across the available space until there is no room left.
-The line is then split by considering all keeps and spacing.
-
Each word (group of adjacent character inline areas) will have keeps based on hyphenation.
-The line break is at the lowest keep value starting from the end of the line.
-
Once a line has been layed out for a particular width then that line is fixed for the page (except for unresolved page references).
-
-
- Before Floats and Footnotes
-
The before float region and footnote region are handled by the page layoutmanger.
-These regions will handle the addition and removal of the separator regions when before floats/footnotes area added and removed.
-
Footnotes and Before Floats are placed in special areas in the body region
-of the page.
-The size of these areas is determined by the content.
-This in turn effects the available size of the main reference area that contains the flow.
-
A layout manager handles the adding and removing of footnotes/floats, this in turn effects the available space in the main reference area.
-
-
- Side Floats
-
If a float anchor is present in a particular line area then the available space for that line (and other in the block) will be reduced.
-The side float adds to the height of the block area and this height also depends on the clear value of subsequent blocks.
-The keep status of the block is also effected as there must be enough space on the page to fit the
-side float.
-
Side floats alter the length of the inline progression dimension for the
-current line and following lines for the size of the float.
-
This means that the float needs to be handled by the block layout manager
-so that it can adjust the available inline progression dimension for the
-relevant line areas.
-
-
-
- Unresolved Areas
-
Once the layout of the page is complete there may be unresolved areas.
-
Page number citations and links may require following pages to be layed out before they can be resolved.
-These will remain in the area tree as unresolved areas.
-
As each page is completed the list of unresolved id's will be checked and if the id can be resolved it will be.
-Once all id's are resolved then the page can be rendered.
-
Each page contains a map of all unresolved id's and the corresponding areas.
-
In the case of page number citations, the areas reserves the equivalent of 3 number nines in the current font.
-When the area is resolved then the area is adjusted to its proper size and the line area is
-re-aligned to accomodate the change.
-
-
- ID and Link Areas
-
Any formatting object that has an ID or any inline link defines an area that will be required when rendering and resolving id references.
-
This area is stored in the parent area and may be a shape that exists
-in more than one page, for example over a page break.
-This shape consists of the boundary of all inline (or block) areas that the shape is defined for.
-
-
- Inline Areas
-
This is the definition of all inline areas that will exist in the area.
These areas have a fixed width and height. They also have a viewport.
-
-
- Stretch Areas
-
leader, inline space
-
These areas have a fixed height but the width may vary.
-
-
- Character Areas
-
character
-
This is an simple character that has fixed properties according to the current font.
-There are implicit keeps with adjacent characters.
-
-
- Anchor Areas
-
float anchor, footnote anchor
-
This area has no size.
-It keeps the position for footnotes and floats and has a keep with the associated inline area.
-
-
- Unresolved Page Numbers
-
page-number-citation
-
A page number area that needs resolving, behaves as a character and has the space of 3 normal characters reserved.
-The size will adjust when the value is resolved.
-
-
- Block Areas
-
When a block creating element is complete then it is possible to build the
-block area and add it to the paprent.
-
A block area will contain either more block areas or line areas, which are
-special block areas.
-The line areas are created by the LineLayoutManager in which the inline areas flow into.
-
So a block area manager handles the lines or blocks as its children and determines things like spacing and breaks.
-
In the case of tables and lists the blocks are stacked in a specific way that needs to be handled by the layout manager.
-
The block area has info about the following:
-
-
all anchors including which lines they are on
-
unresolved page references with line info
-
id and link areas
-
height (min/max/optimum) or area including floats
-
holds space before/after and keep information
-
widows and orphans
-
-
Once the layout has been finalised then this information can be discarded.
-
-
- Page Areas
-
Contains inforamtion about all the block areas in the body, before area and footer area.
-
Has a list of the unresolved page references and a list of id refences that can be used to obtain the area associated with that id.
-
-
- Test Cases
-
Here a few layout possibilities areas explored to determine how the layout process will handle these situations.
-
- Simple Pages
-
All blocks (including nested) are placed on the page with minimum spacing and the last block has the minimum number of lines past the page end.
-The lowest keep value is then found within the body area limits.
-Then the next equally low keep is found to determine if the spacing will be closer to the optimum values.
-
-
- Before Floats/Footnotes
-
After filling the page with the block areas then the new body height is used to find the best position to break.
-Before each line area or block area is remove any associated before floats and footnotes are removed.
-This will then adjust the available space on the page and may allow for a different breaking point.
-Areas are removed towards the new breaking point until the areas fit on the page.
-When finding the optimum spacing the removal of before floats and footnotes must also be onsidered.
-
-
- Multicolumn
-
First the page is filled with all columns for the intial page area.
-Then each column is adjusted for the new height starting from the first column.
-The best break for the column is found then the next column is considered, any left over areas a pre-pended to the next column.
-Once all the columns are finished then all the columns are adjusted to fit in the same height columns.
-This handles the situation where before floats or footnotes may have been removed.
-
-
- Last Page
-
If in the process of adding areas to a page it is found that there are no more areas in the flow then this page will need to be changed to the last page (if applicable).
-The areas are then placed on a last page.
-
-
-
- Status
-
- To Do
-
-
-
Task
-
Priority
-
Notes
-
-
-
Keep Properties
-
High
-
Need to get keep-* properties working on block level constructs
-
-
-
Justified Text
-
High
-
This has been completed, thanks largely to Luca Furini. Although there is still issue 28706
-that requires further analysis.
-
-
-
Multi-column layout
-
High
-
-
-
-
Get Markers Working
-
High
-
Main Problem is markers can be added to wrong page. LEWP is returning first on Next page!
-
-
-
Absolutely positioned block containers
-
High
-
-
-
-
Background Images
-
High
-
-
-
-
Conditional space suppression
-
High
-
-
-
-
Fix break-* properties
-
High
-
-
-
-
Footnotes
-
Medium
-
-
-
-
Relative positioned block containers
-
Medium
-
-
-
-
Fine-tuning line breaking and hypenation
-
Medium
-
-
-
-
Last page layout
-
Medium
-
-
-
-
Aligned leaders, especially in justified text
-
Medium
-
-
-
-
Floats of all kind
-
Low
-
-
-
-
Border collapsing on tables
-
Low
-
RenderX hasnt implemented this (17/03/04)
-
-
-
Fine-tuning all other borders
-
Low
-
Not sure what Joerg means by this, border collapse priorties?
-Dashed and dotted borders have been implemented in PDF
-
-
-
BIDI support
-
Low
-
-
-
-
-
- Work in Progress
-
-
- Completed
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/design/optimise.xml b/src/documentation/content/xdocs/dev/design/optimise.xml
deleted file mode 100644
index 9b23e931d..000000000
--- a/src/documentation/content/xdocs/dev/design/optimise.xml
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-
-
- Apache⢠FOP Design: Optimisations
- $Revision$
-
-
-
-
-
-
-
- Introduction
-
-Apache⢠FOP should be able to handle very large documents. A document can be
-supplied using SAX and the information should be passed entirely through
-the system, from fo elements to rendered output as soon as possible.
-
-
-A top level block area, immediately below the flow, can be added to the
-page layout as soon as the element is complete.
-
-
-The fo elements used to construct a page can be discarded as soon as the
-layout for the page is complete. Some information may be stored in the
-area tree of the page in order to handle unresolved page references
-and links.
-
-
-Once the layout of a page has been completed, all elements are fully
-resolved, then the page can be rendered. Some renderers may support
-out of order rendering of pages.
-
-
-The main problem that will remain is that any page with forward
-references will need to be stored until the refence is resolved.
-This means that the information contained in the page should be
-as minimal as possible.
-
-
-Line areas can be optimised once the layout for the line has
-been finalised. Consecutive characters with the same properties
-can be combined into a "word" to hold the information with
-limited overhead.
-
-
-If there are a large number of pages where forward references
-cannot be resolved the a method of writing a page onto disk
-could be used to save memory. The easiest way to achieve this
-is to make the page and all children serializable.
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/design/parsing.xml b/src/documentation/content/xdocs/dev/design/parsing.xml
deleted file mode 100644
index f3b4a383c..000000000
--- a/src/documentation/content/xdocs/dev/design/parsing.xml
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP Design: Input Parsing
- $Revision$
-
-
-
- Introduction
-
Parsing is the process of reading the XSL-FO input and making the information in it available to Apache⢠FOP.
-
-
- SAX for Input
-
The two standard ways of dealing with XML input are SAX and DOM.
-SAX basically creates events as it parses an XML document in a serial fashion; a program using SAX (and not storing anything internally) will only see a small window of the document at any point in time, and can never look forward in the document.
-DOM creates and stores a tree representation of the document, allowing a view of the entire document as an integrated whole.
-One issue that may seem counter-intuitive to some new FOP developers, and which has from time to time been contentious, is that FOP uses SAX for input.
-(DOM can be used as input as well, but it is converted into SAX events before entering FOP, effectively negating its advantages).
-
Since FOP essentially needs a tree representation of the FO input, at first glance it seems to make sense to use DOM.
-Instead, FOP takes SAX events and builds its own tree-like structure. Why?
-
-
DOM has a relatively large memory footprint. FOP's FO Tree is a lighter-weight structure.
-
DOM contains an entire document. FOP is able to process individual fo:page-sequence objects discretely, without the need to have the entire document in memory. For documents that have only one fo:page-sequence object, FOP's approach is no advantage, but in other cases it is a huge advantage. A 500-page book that is broken into 100 5-page chapters, each in its own fo:page-sequence, essentially needs only 1% of the document memory that would be required if using DOM as input.
-
-
See the Input Section of the User Embedding Document for a discussion of input usage patterns and some implementation details.
-
FOP's FO Tree Mechanism is responsible for catching the SAX events and processing them.
-
-
- Validation
-
If the input XML is not well-formed, that will be reported.
-
There is no DTD for XSL-FO, so no formal validation is possible at the parser level.
-
The SAX handler will report an error for unrecognized namespaces.
-
-
- Namespaces
-
To allow for extensions to the XSL-FO language, FOP provides a mechanism for handling foreign namespaces.
-
See User Extensions for a discussion of standard extensions shipped with FOP, and their related namespaces.
-
See Developer Extensions for a discussion of the mechanisms in place to allow developers to add their own extensions, including how to tell FOP about the foreign namespace.
-
-
- Status
-
- To Do
-
-
- Work In Progress
-
-
- Completed
-
-
better handling of unknown xml and xml from an unknown namespace
-
Changed extensions to allow for external xml
-
Can have a default element mapping for extensions
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/design/pdf-library.xml b/src/documentation/content/xdocs/dev/design/pdf-library.xml
deleted file mode 100644
index f6562cc83..000000000
--- a/src/documentation/content/xdocs/dev/design/pdf-library.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
-
-
-
- Apache⢠FOP Design: PDF Library
- $Revision$
-
-
-
-
- Introduction
-
-
The PDF Library is an independant package of classes in Apache⢠FOP. These class
-provide a simple way to construct documents and add the contents. The
-classes are found in org.apache.fop.pdf.*.
-
-
-
- PDF Document
-
This is where most of the document is created and put together.
-
It sets up the header, trailer and resources. Each page is made and added to the document.
-There are a number of methods that can be used to create/add certain PDF objects to the document.
-
-
-
- Building PDF
-
The PDF Document is built by creating a page for each page in the Area Tree.
-
This page then has all the contents added.
- The page is then added to the document and available objects can be written to the output stream.
-
The contents of the page are things such as text, lines, images etc.
-The PDFRenderer inserts the text directly into a pdf stream.
-The text consists of markup to set fonts, set text position and add text.
-
Most of the simple pdf markup is inserted directly into a pdf stream.
-Other more complex objects or commonly used objects are added through java classes.
-Some pdf objects such as an image consists of two parts.
-
It has a separate object for the image data and another bit of markup to display the image in a certain position on the page.
-
The java objects that represent a pdf object implement a method that returns the markup for inserting into a stream.
-The method is: byte[] toPDF().
-
-
-
- Features
-
-
- Fonts
-
Support for embedding fonts and using the default Acrobat fonts.
-
-
-
- Images
-
Images can be inserted into a page. The image can either be inserted as a pixel map or directly insert a jpeg image.
-
-
-
- Stream Filters
-
A number of filters are available to encode the pdf streams. These filters can compress the data or change it such as converting to hex.
-
-
-
- Links
-
A pdf link can be added for an area on the page. This link can then point to an external destination or a position on any page in the document.
-
-
-
- Patterns
-
The fill and stroke of graphical objects can be set with a colour, pattern or gradient.
-
-
-
The are a number of other features for handling pdf markup relevent to creating PDF files for FOP.
As the input XSL-FO is being parsed and the FO Tree is being built, the attributes of the FO elements are passed by the parser to the related FO object.
-The java object that represent the FO object then converts the attributes into properties that are stored in the FO Tree.
-
-
- Issues
-
The following are some issues when dealing with properties:
-
-
Initial Property Set
-
Inheritance: Some properties can be inherited from parent objects.
-
Adoption: The parentage for some elements can move around.
-Markers are one example.
-
Multiple Namespaces: The properties for foreign namespaces must be handled.
-
Expressions: XSL-FO expressions can be included in properties.
-
-
-
- Overview of Processing
-
The general flow of property processing is as follows:
-
-
As part of FOTreeBuilder.startElement(), FObj.handleAttrs is passed a list of attributes to be processed for the new FObj.
-
FObj.handleAttrs gets a PropertyListBuilder and asks it to create a Property List from the list of attributes. There is currently only one static PropertyListBuilder, which handles the fo: namespace.
-
FObj.handleAttrs then cross-references the returned PropertyList with the FObj, creates a PropertyManager to facilitate downstream processing of the PropertyList, and handles the special case of the writing-mode property.
-
-
-
- PropertyListBuilder
-
Each plb object contains a hash of
-property names and their respective Makers. It may also
-contain element-specific property maker hashes; these are based on the
-local name of the flow object, ie. table-row, not
-fo:table-row. If an element-specific property mapping exists,
-it is preferred to the generic mapping.
-
The PLB loops through each attribute in the list, finds an appropriate "Maker" for it, then calls the Maker to convert the attribute value into a Property object of the correct type, and stores that Property in the PropertyList.
-
-
- Property datatypes
-
The property datatypes are defined in the
-org.apache.fop.datatypes package, except Number and String which are java
-primitives. The FOP datatypes are:
-
-
Number
-
String
-
ColorType
-
Length (has several subclasses)
-
CondLength (compound)
-
LengthRange (compound)
-
Space (compound)
-
Keep (compound)
-
-
The org.apache.fop.fo.Property class is the superclass for all
-Property subclasses. There is a subclass for each kind of property
-datatype. These are named using the datatype name plus the word
-Property, resulting in NumberProperty, StringProperty, and so
-on. There is also a class EnumProperty which uses an int
-primitive to hold enumerated values. There is no corresponding Enum
-datatype class.
-
The Property class provides a "wrapper" around any possible
-property value. Code manipulating property values (in layout for
-example) usually knows what kind (or kinds) of datatypes are
-acceptable for a given property and will use the appropriate accessor.
-
The base Property class defines accessor methods for all FO property
-datatypes, such as getNumber(), getColorType(), getSpace(), getEnum(),
-etc. It doesn't define
-accessors for SVG types, since these are handled separately (at least
-for now.) In the base Property class, all of these methods return
-null, except getEnum which returns 0. Individual subclasses return a value of the appropriate type,
-such as Length or ColorType. A subclass may also choose to return a
-reasonable value for other accessor types. For example, a
-SpaceProperty will return the optimum value if asked for a Length.
-
-
- Property Makers
-
The Property class contains a nested class called
-Maker. This is the base class for all other property Makers. It
-provides basic framework functionality which is overridden by the
-code generated by properties.xsl from the *properties.xml files. In
-particular it provides basic expression evaluation, using
-PropertyParser class in the org.apache.fop.fo.expr package.
-
Other Property subclasses such as LengthProperty define their own
-nested Maker classes (subclasses of Property.Maker). These handle
-conversion from the Property subclass returned from expression
-evaluation into the appropriate subclass for the property.
-
For each generic or specific property definition in the
-properties.xml files, a new subclass of one of the Maker classes is
-created. Note that no new Property subclasses are created, only new
-PropertyMaker subclasses. Once the property value has been parsed and
-stored, it has no specific functionality. Only the Maker code is
-specific. Maker subclasses define such aspects as keyword
-substitutions, whether the property can be inherited or not, which
-enumerated values are legal, default values, corresponding properties
-and specific datatype conversions.
-
The PLB finds a "Maker" for the property based on the attribute name and
-the element name. Most Makers are generic and handle the attribute on
-any element, but it's possible to set up an element-specific property
-Maker. The attribute name to Maker mappings are automatically created
-during the code generation phase by processing the XML property
-description files.
-
-
- Processing the attribute list
-
The PLB first looks to see if the font-size property is specified, since
-it sets up relative units which can be used in other property
-specifications. Each attribute is then handled in turn. If the attribute
-specifies part of a compound property such as space-before.optimum, the
-PLB looks to see if the attribute list also contains the "base" property
-(space-before in this case) and processes that first.
-
-
- How the Property Maker works
-
There is a family of Maker objects for each of the property datatypes,
-such as Length, Number, Enumerated, Space, etc. But since each Property
-has specific aspects such as whether it's inherited, its default value,
-its corresponding properties, etc. there is usually a specific Maker for
-each Property. All these Maker classes are created during the code
-generation phase by processing (using XSLT) the XML property description
-files to create Java classes.
-
The Maker first checks for "keyword" values for a property. These are
-things like "thin, medium, thick" for the border-width property. The
-datatype is really a Length but it can be specified using these keywords
-whose actual value is determined by the "User Agent" rather than being
-specified in the XSL standard. For FOP, these values are currently
-defined in foproperties.xml. The keyword value is just a string, so it
-still needs to be parsed as described next.
-
The Maker also checks to see if the property is an Enumerated type and
-then checks whether the value matches one of the specified enumeration
-values.
-
Otherwise the Maker uses the property parser in the fo.expr package to
-evaluate the attribute value and return a Property object. The parser
-interprets the expression language and performs numeric operations and
-function call evaluations.
-
If the returned Property value is of the correct type (specificed in
-foproperties.xml, where else?), the Maker returns it. Otherwise, it may
-be able to convert the returned type into the correct type.
-
Some kinds of property values can't be fully resolved during FO tree
-building because they depend on layout information. This is the case of
-length values specified as percentages and of the special
-proportional-column-width(x) specification for table-column widths.
-These are stored as special kinds of Length objects which are evaluated
-during layout. Expressions involving "em" units which are relative to
-font-size _are_ resolved during the FO tree building however.
-
-
- Structure of the PropertyList
-
The PropertyList extends HashMap and its basic function is to associate
-Property value objects with Property names. The Property objects are all
-subclasses of the base Property class. Each one simply contains a
-reference to one of the property datatype objects. Property provides
-accessors for all known datatypes and various subclasses override the
-accessor(s) which are reasonable for the datatype they store.
-
The PropertyList itself provides various ways of looking up Property
-values to handle such issues as inheritance and corresponding
-properties.
-
The main logic is: If the property is a writing-mode relative property (using start, end,
-before or after in its name), the corresponding absolute property value
-is returned if it's explicitly set on this FO. Otherwise, the
-writing-mode relative value is returned if it's explicitly set. If the
-property is inherited, the process repeats using the PropertyList of the
-FO's parent object. (This is easy because each PropertyList points to
-the PropertyList of the nearest ancestor FO.) If the property isn't
-inherited or no value is found at any level, the initial value is
-returned.
-
-
- Implementing Standard Properties
-
Because the properties defined in the standard are basically static, FOP currently builds the source code for the related Property classes from an XML data file.
-All properties are specified in src/codegen/foproperties.xml.
-The related classes are created automatically during the build process by applying an XSLT stylesheet to the foproperties.xml file.
-
- Generic properties
-
In the properties xml files, one can define generic property
-definitions which can serve as a basis for individual property
-definitions. There are currently several generic properties defined in
-foproperties.xml. An example is GenericColor, which defines basic properties
-for all ColorType properties. Since the generic specification doesn't include
-the inherited or default elements, these should be set in each property
-which is based on GenericColor. Here is an example:
A generic property specification can include all of the elements
-defined for the property element in the DTD, including the description
-of components for compound properties, and the specification of
-keyword shorthands.
-
Generic property specifications can be based on other generic
-specifications.
-An example is GenericCondPadding template which is based on the
-GenericCondLength definition but which extends it by adding an inherited
-element and a default value for the length component.
-
Generic properties can specify enumerated values, as in the
-GenericBorderStyle template. This means that the list of values, which
-is used by 8 properties (the "absolute" and "writing-mode-relative"
-variants for each BorderStyle property) is only specified one time.
-
When a property includes a "use-generic" element and includes no other
-elements (except the "name" element), then no class is generated for the
-property. Instead the generated mapping will associate this
-property directly with an instance of the generic Maker.
-
A generic class may also be hand-coded, rather than generated from the
-properties file.
-Properties based on such a generic class are indicated by the
-attribute ispropclass='true' on the
-use-generic element.
-
This is illustrated by the SVG properties, most of
-which use one of the Property subclasses defined in the
-org.apache.fop.svg
-package. Although all of these properties are now declared in
-svgproperties.xml, no specific classes are generated. Classes are only
-generated for those SVG properties which are not based on generic
-classes defined in svg.
-
-
- Element-specific properties
-
Properties may be defined for all flow objects or only for
-particular flow objects. A PropertyListBuilder object will always look
-first for a Property.Maker for the flow object before looking in the
-general list. These are specified in the
-element-property-list section of the properties.xml
-files. The localname element children of this element specify for
-which flow-object elements the property should be registered.
-
- NOTE: All the properties for an object or set of objects
-must be specified in a single element-property-list element. If the
-same localname appears in several element lists, the later set of
-properties will hide the earlier ones! Use the ref
-functionality if the same property is to be used in different sets of
-element-specific mappings.
-
-
- Reference properties
-
A property element may have a type attribute with the value
- ref. The
- content of the name child element is the name of the referenced
- property (not its class-name!). This indicates that the property
- specification has
- already been given, either in this same specification file or in a
- different one (indicated by the family attribute). The
- value of the family attribute is XX where the file
- XXproperties.xml defines the referenced property. For
- example, some SVG objects may have properties defined for FO. Rather
- than defining them again with a new name, the SVG properties simply
- reference the defined FO properties. The generating mapping for the
- SVG properties will use the FO Maker classes.
-
-
- Corresponding properties
-
Some properties have both absolute and
-writing-mode-relative forms. In general, the absolute forms
-are equivalent to CSS properties, and the writing-mode-relative forms
-are based on DSSSL. FO files may use either or both forms. In
-FOP code, a request for an absolute form will retrieve that value if it
-was specified on the FO; otherwise the corresponding relative property
-will be used if it was specified. However, a request for a relative
-form will only use the specified relative value if the corresponding
-absolute value was not specified for that FO.
-
Corresponding properties are specified in the properties.xml files
-using the element corresponding, which has at least one
-propval child and may have a propexpr child,
-if the corresponding
-value is calculated based on several other properties, as for
-start-indent.
-
- NOTE: most current FOP code accesses the absolute variants
-of these properties, notably for padding, border, height and width
-attributes. However it does use start-indent and end-indent, rather
-than the "absolute" margin properties.
-
-
-
- Mapping
-
The XSL script propmap.xsl is used to generate
-property mappings based on
-both foproperties.xml and svgproperties.xml. The mapping classes
-in the main fop packages simply load these automatically generated
-mappings. The mapping code still uses the static
-"maker" function of the generated object to obtain a Maker
-object. However, for all generated classes, this method returns an
-instance of the class itself (which is a subclass of Property.Maker)
-and not an instance of a separate nested Maker class.
-
For most SVG properties which use the SVG Property classes directly,
-the generated mapper code calls the "maker" method of the SVG Property
-class, which returns an instance of its nested Maker class.
-
The property generation also handles element-specific property
-mappings as specified in the properties XML files.
-
-
- Enumerated values
-
For any property whose datatype is Enum or which
-contains possible enumerated values, FOP code may need to access
-enumeration constants. These are defined in the interfaces whose name
-is the same as the generated class name for the property,
-for example BorderBeforeStyle.NONE. These interface classes
-are generated by the XSL script enumgen.xsl. A separate
-interface defining the enumeration constants is always generated for
-every property which uses the constants, even if the constants
-themselves are defined in a generic class, as in BorderStyle.
-
If a subproperty or component of a compound property has enumerated
-values, the constants are defined in a nested interface whose name is
-the name of the subproperty (using appropriate capitalization
-rules). For example,
-the keep properties may have values of AUTO or FORCE or an integer
-value. These are defined for each kind of keep property. For example,
-the keep-together property is a compound property with the components
-within-line, within-column and within-page. Since each component may
-have the values AUTO or FORCE, the KeepTogether interface defines
-three nested interfaces, one for each component, and each defines
-these two constants. An example of a reference in code to the constant
-is KeepTogether.WithinPage.AUTO.
-
-
- Compound property types
-
Some XSL FO properties are specified by compound datatypes. In the FO file,
-these are defined by a group of attributes, each having a name of the
-form property.component, for example
-space-before.minimum. These are several compound
-datatypes:
-
-
LengthConditional, with components length and conditionality
-
LengthRange, with components minimum, optimum, and maximum
-
Space, with components minimum, optimum, maximum, precedence and
-conditionality
-
Keep, with components within-line, within-column and within-page
-
-
These are described in the properties.xml files using the element
-compound which has subproperty children. A subproperty element is much
-like a property element, although it may not have an inherited child
-element, as only a complete property object may be inherited.
-
Specific datatype classes exist for each compound property. Each
-component of a compound datatype is itself stored as a Property
-object. Individual components may be accessed either by directly
-performing a get operation on the name, using the "dot" notation,
-eg. get("space-before.optimum"); or by using an accessor on the compound
-property, eg. get("space-before").getOptimum().
-In either case,
-the result is a Property object, and the actual value may be accessed
-(in this example) by using the "getLength()" accessor.
-
-
- Refinement
-
The Refinement step is part of reading and using the properties which may happen immediately or during the layout process. FOP does not currently use a separate Refinement process, but tends to handle refining steps as the FO Tree is built.
-
-
- Refined FO Tree
-
The Refined FO Tree is the result of the Refinement process.
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/design/renderers.xml b/src/documentation/content/xdocs/dev/design/renderers.xml
deleted file mode 100644
index 2e21db864..000000000
--- a/src/documentation/content/xdocs/dev/design/renderers.xml
+++ /dev/null
@@ -1,229 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP Design: Renderers
- $Revision$
-
-
-
-
-
-
- Introduction
-
A renderer is primarily designed to convert a given area tree into the output
-document format. It should be able to produce pages and fill the pages
-with the text and graphical content. Usually the output is sent to
-an output stream.
-
Some output formats may support extra information that is not available
-from the area tree or depends on the destination of the document.
-
Each renderer is given an area tree to render to its output format.
-The area tree is simply a representation of the pages and the placement
-of text and graphical objects on those pages.
-
The renderer will be given each page as it is ready and an output stream
-to write the data out.
-All pages are supplied in the order they appear in the document.
-In order to save memory it is
-possble to render the pages out of order. Any page that is not ready to
-be rendered is setup by the renderer first so that it can reserve a space
-or reference for when the page is ready to be rendered.The renderer is responsible for managing the
-output format and associated data and flow.
Each renderer is totally responsible for its output format.
-
-
- Send Output to a Stream
-
-
-
- Fonts
-
Because font metrics (and therefore layout) are obtained in two different ways depending on the renderer, the renderer actually sets up the fonts being used. The font metrics are used
-during the layout process to determine the size of characters.
-
-
- Render Context
-
The render context is used by handlers.
-It contains information about the current state of the renderer, such as the page, the position, and any other miscellanous objects that are required to draw into the page.
-
-
- XML Handling
-
A document may contain information in the form of XML for an image or instream foreign object.
-This XML is handled through the user agent.
-A standard extension for PDF is the SVG handler.
-
If there is XML in the SVG namespace it is given to the handler which renders the SVG into the pdf document at the given location.
-This separation means that other XML handlers can easily be added.
-
-
- Extensions
-
Document level extensions are handled with an extension handler.
-This handles the information from the AreaTree and adds renders it to the document.
-An example is the pdf bookmarks. This information first needs to have all references resolved.
-Then the extension handler is ready to put the information into the pdf document.
-
-
- Renderer Implementations
-
-
-
Name
-
Type
-
Font Source
-
Font Embedding?
-
Out of Order Rendering?
-
Notes
-
-
-
PDF
-
Paginated
-
FOP
-
Yes
-
Yes
-
Uses the PDFDocument classes to create a PDF document. Most of the work is to insert text or create lines. SVG is handled by the XML handler that uses the PDFGraphics2D and batik to
-draw the svg into the pdf page.
-
-
-
PostScript
-
Paginated
-
FOP
-
Not implemented
-
?
-
Similar to PDF.
-
-
-
PCL
-
Paginated
-
FOP
-
?
-
?
-
Similar to PDF.
-
-
-
SVG
-
Paginated
-
?
-
?
-
?
-
Creates a single svg document that contains all the pages rendered
-with page sequences horizontally and pages vertically. Adds
-links between the pages so that it can be viewed by clicking on the page
-to go to the next page.
-
-
-
TXT
-
Paginated
-
N/A
-
N/A
-
No
-
Outputs to a text document.
-
-
-
AWT
-
Paginated
-
AWT
-
N/A
-
?
-
This draws the pages into an AWT graphic.
-
-
-
XML
-
Paginated
-
FOP
-
No
-
No
-
Creates an XML file that represents the AreaTree.
-
-
-
Print
-
Paginated
-
AWT
-
?
-
No
-
Prints the document using the java printing facitlities. The AWT
-rendering is used to draw the pages onto the printjob.
-
-
-
RTF
-
Structural
-
N/A
-
N/A
-
No
-
Structural format uses a different rendering mechanism.
-
-
-
MIF
-
Structural
-
N/A
-
N/A
-
No
-
Structural format uses a different rendering mechanism.
-
-
-
-
- Adding a Renderer
-
You can add other renderers by implementing the Renderer interface.
-However, the AbstractRenderer does most of what is needed, including iterating through the tree parts, so it is probably better to extend this.
-This means that you only need to implement the basic functionality such as text, images, and lines.
-AbstractRenderer's methods can easily be overridden to handle things in a different way or do some extra processing.
-
The relevent AreaTree structures that will need to be rendered are:
-
-
Page
-
Viewport
-
Region
-
Span
-
Block
-
Line
-
Inline
-
-
A renderer implementation does the following:
-
-
render each individual page
-
clip and align child areas to a viewport
-
handle all types of inline area, text, image etc.
-
draw various lines and rectangles
-
-
-
- Multiple Renderers
-
The layout of the document depends mainly on the font being used.
-If two renderers have the same font metrics then it is possible to use the same Area Tree to render both. This can be handled by the AreaTree Handler.
-
-
- Status
-
- To Do
-
-
- Work In Progress
-
-
- Completed
-
-
new renderer model
-
new interface for structured documents, rtf and mif
-
added handlers for xml in renderer
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/design/startup.xml b/src/documentation/content/xdocs/dev/design/startup.xml
deleted file mode 100644
index db1742135..000000000
--- a/src/documentation/content/xdocs/dev/design/startup.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP Design: Startup, Environment, Control
- $Revision$
-
-
-
- Introduction
-
Startup is the process of getting Apache⢠FOP bootstrapped and creating basic objects. Environment includes acquiring user options, instantiating any frameworks, setting up logging, etc. Control includes the basic logic for tieing the various subsystems together properly.
-
-
- Status
-
- To Do
-
-
avalon integration - logging, configuration, component management, caching, uri resolver
-
improved interfaces
-
-
no threading/static problems
-
simpler to use
-
-
-
better commandline handling
-
-
-
- Work In Progress
-
-
- Completed
-
-
better image handling - redone so it can use a cache and synchronizes properly only on the current image while loading
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/design/svg.xml b/src/documentation/content/xdocs/dev/design/svg.xml
deleted file mode 100644
index 1d4f72d04..000000000
--- a/src/documentation/content/xdocs/dev/design/svg.xml
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
-
-
-
-
-
- Apache⢠FOP Design: SVG
- $Revision$
-
-
-
- Introduction
-
SVG is rendered through Apache⢠Batik.
The XML from the XSL:FO document
- is converted into an SVG DOM with batik. This DOM is then set as the Document
- on the Foreign Object area in the Area Tree.
This DOM is then available to
- be rendered by the renderer.
SVG is rendered in the renderers via an
- XMLHandler in the FOUserAgent. This XML handler is used to render the SVG. The
- SVG is rendered by using batik. Batik converts the SVG DOM into an internal
- structure that can be drawn into a Graphics2D. So for PDF we use a
- PDFGraphics2D to draw into.
This creates the necessary PDF information to
- create the SVG image in the PDF document.
Most of the work is done in the
- PDFGraphics2D class. There are also a few bridges that are plugged into batik
- to provide different behaviour for some SVG elements.
-
-
- Text Drawing
-
Normally batik converts text into a set of curved
- shapes.
This is handled as any other shapes when rendering to the output. This
- is not always desirable as the shapes have very fine curves. This can cause the
- output to look a bit bad in PDF and PS (it can be drawn properly but is not by
- default). These curves also require much more data than the original
- text.
To handle this there is a PDFTextElementBridge that is set when
- using the bridge in batik. If the text is simple enough for the text to be
- drawn in the PDF as with all other text then this sets the TextPainter to use
- the PDFTextPainter. This inserts the text directly into the PDF using the drawString method on the PDFGraphics2D.
Text is considered simple if the
- font is available, the font size is useable and there are no tspans or other
- complications. This can make the resulting PDF significantly
- smaller.
-
-
- PDF Links
-
To support links in PDF another batik
- element bridge is used. The PDFAElementBridge creates a PDFANode which inserts
- a link into the PDF document via the PDFGraphics2D.
Since links are positioned on the page without any transforms then we need to transform the
- coordinates of the link area so that they match the current position of the a
- element area. This transform may also need to account for the svg being
- positioned on the page.
-
-
- Images
-
Images are normally drawn
- into the PDFGraphics2D. This then creates a bitmap of the image data that can
- be inserted into the PDF document.
As PDF can support jpeg images then another
- element bridge is used so that the jpeg can be directly inserted into the PDF.
-
-
- PDF Transcoder
-
Batik provides a mechanism to
- convert SVG into various formats. Through FOP we can convert an SVG document
- into a single paged PDF document. The page contains the SVG drawn as best as
- possible on the page. There is a PDFDocumentGraphics2D that creates a
- standalone PDF document with a single page. This is then drawn into by batik in
- the same way as with the PDFGraphics2D.
-
-
- Other Outputs
-
When rendering to AWT the SVG is simply drawn onto the
- awt canvas using batik.
The PS Renderer uses a similar technique as the
- PDF Renderer.
The SVG Renderer simply embeds the SVG inside an svg
- element.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/design/useragent.xml b/src/documentation/content/xdocs/dev/design/useragent.xml
deleted file mode 100644
index 5ee7f29e2..000000000
--- a/src/documentation/content/xdocs/dev/design/useragent.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
-
-
- Apache⢠FOP Design: User Agent
- $Revision$
-
-
-
-
-
-
-
- Introduction
-
-Technically the user agent is Apache⢠FOP in the role of determining the
-output format and when resolving various attributes. The user
-agent is represented by a class that is available to others to
-specify how FOP should behave.
-
-
-The user agent is used by the formatting process to determine
-certain user definable values.
-
-
-It will enable the customisation of values for generating and
-rendering the document.
-
-
-The user agent must be available to the layout processor and
-the renderer. Users can supply their own user agent or use
-the default one for a particular renderer.
-
-
-The user agent needs to be made available to the property
-resolution layout process and the renderer.
-
-
-
-Standard Features:
-
-
-
error handling, what to do if fo markup is invalid
-
auto overflow value and handling error-if-overflow
-
adjusting length values (eg. for borders) to renderable values
-
available fonts
-
converting cm/in to pt (dpi)
-
active state for multi properties
-
title, used to identify a set of pages (in a page sequence)
-
the width (in inline-progression-dimension) of a character with
-treat-word-as-space true
-
maximum space used by conditional areas from region-reference-area
-
if there should be "hot links" to before floats or footnotes
-
when to clear side floats if space in inline-progression-dimension
-is not enough
-
placement of left over footnotes on a page with a region-body
-
using color property as border colour
-
interpretting all border styles (except outset) as solid
-
thin, medium and thick values for border width
-
initial font-family value
-
absolute font sizes (eg, xx-small, x-small etc.)
-
relative font sizes (eg. larger, smaller)
-
small caps simulation
-
font weight mapping
-
baseline info for a font if not available
-
determining sub/superscript when another baseline is dominant
-
scaling method for external-graphic and instream-foreign-object
-
the width of a replaced element
-
"normal" line height value
-
text alignment (stretching the line with letter and word spacing)
-
text transform
-
initial color
-
rendering intent of auto
-
dot character for leader
-
line breaking with leaders, use optimum length when breaking the line
-
page height/width of auto
-
left and right caption widths
-
glyph orientation vertical of auto
-
rendering processor of content-type (mime type)
-
-
-
-Interactive Features:
-
-
-
inline and block scroll amount
-
dynamic effects, links and property sets
-
initial "pause-after", "pause-before" and "voice-family" value
-
treating fixed as scroll on background attachement
-
media usage of auto
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/doc.xml b/src/documentation/content/xdocs/dev/doc.xml
deleted file mode 100644
index fe9e656ed..000000000
--- a/src/documentation/content/xdocs/dev/doc.xml
+++ /dev/null
@@ -1,166 +0,0 @@
-
-
-
-
-
-
- Apache⢠FOP Development: Managing Documentation
- $Revision$
-
-
-
- General Information
-
All raw documentation content is managed in the Apache⢠FOP SVN repository.
-Updates should be committed to the repository, then the repository files are used to generate usable output.
-The remaining discussions on this page assume that the SVN repository is the starting place for processing.
-The path to the documentation is src/documentation/content/xdocs.
- All documentation is maintained on the trunk.
-
Basic documents are stored in XML files, and use DTDs provided by Apache Forrest.
-
-
- Design Principles
-
These principles are not written in stone, but reflect the current philosophy, and are documented here primarily to help achieve consistency. These principles should be changed if better or more practical ones are found, but they should probably be discussed and changed by common consent.
-
- Where
-
-
To the extent possible, keep user content separate from developer content, primarily so the user doesn't have to filter out technical information.
-
To the extent possible, try to document a topic exactly once, in the place the user is most likely to look for it, then link to that from other locations as appropriate. This is somewhat contrary to the principle above, which should be applied as a higher priority.
-
-
-
- When
-
The documentation and the product are in a constant state of change, and there is some difficulty in deciding what product state the website content should reflect. The current thinking is that the website should reflect the current state of the repository code branch from which releases are made. Features or other documentation that applies to unreleased code should be marked in such a way within the content that the user can determine whether and how it applies to the version they are using. For example, "Feature xyz is first available in Release n.nn.n".
-
Other approaches were considered, but all seemed to have significantly higher costs both to the users and the developers. From the user's standpoint, the choice is either that they potentially have to look multiple places to get the information they need (which was rejected), or they have to filter out an occasional feature that is in code available subsequent to their release (which was accepted).
-
-
-
- Website
-
- Background
-
The FOP web site and documentation are generated using Apache Forrest.
-
The following table summarizes the flow of data to the FOP website in chronological order:
-
-
-
Process
-
Output
-
State
-
View(s)
-
-
-
Developer commits code to FOP repository.
-
FOP repository (SVN)
-
Raw XML and other content
-
in SVN
-
-
-
Developer builds and uploads documentation using ForrestBot.
-
/www/xmlgraphics.apache.org/fop on people.apache.org
-
sync-ready
-
n/a
-
-
-
Cron job runs rsync to synchronize the website with the real web server (runs every few hours).
-
Infrastructure knows. :-)
-
web-ready
-
FOP Web Site
-
-
- Server-side ForrestBot is currently not available for website publishing. We use it locally and with manual invocation.
-
-
- ForrestBot "publish" Step-by-Step
-
- We're using ForrestBot for build and deploy the FOP website. ForrestBot comes with Apache Forrest 0.8.
- The root directory of your FOP checkout contains the file "publish.xml" which is an Ant build file
- that manages the build and the deployment of the FOP website. Please look into this file for
- further instructions to set up ForrestBot on your machine. Basically, we're simply running ForrestBot
- manually by typing "ant -f publish.xml" once we're happy with our changes to the site.
- Step-by-step instructions for the deployment process again:
-
-
- Please make sure you use Forrest from the Trunk (revision 632959 or later) for the time being. You will need
- to download it directly from SVN:
- http://svn.apache.org/repos/asf/forrest/trunk
-
-
-
Modify the sources of the website and check locally with Forrest (run "forrest run" or just "forrest").
-
- Once you're satisfied, run "ant -f publish.xml" to do a clean build of the website. If the build
- runs without problems, the website will be uploaded as a whole using SVN to the
- website staging directory in SVN.
-
-
- Then log into people.apache.org using SSH, go to the /www/xmlgraphics.apache.org
- directory and run "svn up".
-
-
- Wait for the next rsync cycle and check your changes in the live site.
- (Sorry, no manual rsync available ATM)
-
-
-
- The reason for putting the generated website in the SVN repository: The infrastructure
- people want to be able to restore the websites themselves in case of a crash.
-
-
-
- Using a Local Forrest
-
To use a local Forrest (during website development, not for deployment):
-
-
download latest the Forrest release (currently Forrest 0.8)
-
set environment variable FORREST_HOME=~/apache-forrest-0.8 where ~ is the directory where Forrest is installed
- (see http://forrest.apache.org/docs/your-project.html for details)
-
set environment variable PATH=$PATH:$FORREST_HOME/bin
-
cd to your local FOP checkout
-
update your local FOP checkout (svn update)
-
run forrest(.bat), which will build the web-site documents in xml-fop/build/site.
-
-
- You can use "forrest run" to start a local web server. That improves development speed as you
- can simply refresh in the browser after a change.
-
-
-
- Updating Distribution Files
-
- The Apache distribution system mirrors distributions around the world. Since it uses
- Apache httpd Module
- mod_autoindex
- you also need to manually update the HEADER.html & READER.html files on
- people.apache.org in
- /www/www.apache.org/dist/xmlgraphics/fop/.
-
-
- Please be careful when doing stuff like that.
-
-
-
- Deleting Documentation Files
-
- ForrestBot simply uploads the whole generated site. It doesn't delete obsolete files. You
- can do that manually in the /www/xmlgraphics.apache.org/fop folder on cvs.apache.org. Be careful
- when doing stuff like that.
-
-
- Please make sure you always have group rw permissions on all files under the /www directory!
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/extensions.xml b/src/documentation/content/xdocs/dev/extensions.xml
deleted file mode 100644
index 3a5f499d5..000000000
--- a/src/documentation/content/xdocs/dev/extensions.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-
-
-
-
-
-
-
- Apache⢠FOP Development: Adding an Extension
- $Revision$
-
-
-
- Overview
-
For documentation of standard Apache⢠FOP extensions, see the User FOP Extensions document.
-
-If the default funtionality of FOP needs to be extended for
-some reason then you can write an extension.
-
-
There are three types of extensions possible:
-
-
An output document extension such as the PDF bookmarks
-
an instream-foreign-object extensions such as SVG
-
an fo extension that creates an area in the area tree where normal xsl:fo is not possible
-
-
-
- Adding Your Own
-
-To add your own extension you need to do the following things.
-
-
-
Write code that implements your extension functionality. The easiest place to
-start is by looking at the code in org.apache.fop.fo.extensions, and by looking at the examples in the examples directory.
-
Create a class that extends the abstract org.apache.fop.fo.ElementMapping class. ElementMapping is a hashmap of all of the elements in a particular namespace, which makes it easier for FOP to create a different object for each element.
-ElementMapping objects are static to save on memory.
-They are loaded by FOP when parsing starts to validate input.
-
Create the following file: "/META-INF/services/org.apache.fop.fo.ElementMapping", which should contain the fully qualified classname of your ElementMapping implementation class.
-
Create a jar file containing all of the above files.
-
Create your XSL-FO file with the extra XML data embedded in the file with the
-correct name space.
-The examples for SVG and pdfoutline.fo show how this can be done.
-The pdf documents on the FOP site use this extension.
-See also Examples for more examples.
-
Put your jar file in the classpath
-
Run FOP using your XSL-FO file as input.
-
-
-
-
\ No newline at end of file
diff --git a/src/documentation/content/xdocs/dev/faq.xml b/src/documentation/content/xdocs/dev/faq.xml
deleted file mode 100644
index ae15eaabd..000000000
--- a/src/documentation/content/xdocs/dev/faq.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-
-
-
-
-
-
-
- General Questions
-
- How can I contribute?
-
-
There are many ways that you can help:
-
-
You can help us implement missing features that are needed in order to comply with the standard. See the Standards Compliance for more details.
-
You can help us address bug reports. See bugzilla for more information.
-
You can help support our user base by answering questions on the fop-user mailing list.
-
You can help us document FOP better.
-
-
-
-
-
- Documentation
-
- How do I get the javadocs for FOP?
-
-
Currently, the only way to get FOP javadocs is to
- Download the source code and then Build
- FOP using the ant build task "javadocs".
-
-
-
- Where can I learn how the FOP docs and web site are built?
-
-
- See FOP Doc Management. ;-)
-
-
-
-
-
- Further Help
-
- I don't see my question addressed here. Are there other FAQs?
-
-