Browse Source

Merged revisions 611116-634214 via svnmerge from

https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk

(details omitted)

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ProcessingFeedback@634267 13f79535-47bb-0310-9956-ffa450edef68
Temp_ProcessingFeedback
Jeremias Maerki 16 years ago
parent
commit
ee3a14e3cd
100 changed files with 3281 additions and 6437 deletions
  1. 1
    1
      build.xml
  2. 113
    113
      examples/embedding/java/embedding/ExampleAWTViewer.java
  3. 127
    127
      examples/embedding/java/embedding/ExampleFO2OldStylePrint.java
  4. 1
    1
      examples/embedding/java/embedding/intermediate/ExampleConcat.java
  5. 1
    1
      examples/embedding/java/embedding/intermediate/ExampleStamp.java
  6. 7
    0
      fixsvnprops.sh
  7. 1
    1
      fop.bat
  8. 3
    2
      forrest.properties
  9. 22
    0
      forrest.properties.xml
  10. 60
    42
      lib/README.txt
  11. BIN
      lib/xmlgraphics-commons-1.3.jar
  12. 1
    0
      src/codegen/fonts/Symbol.xml
  13. 88
    59
      src/codegen/fonts/code-point-mapping.xsl
  14. 9
    9
      src/codegen/fonts/encodings.xml
  15. 4
    4
      src/documentation/content/doap.rdf
  16. 0
    125
      src/documentation/content/xdocs/0.93/extensions.xml
  17. 0
    298
      src/documentation/content/xdocs/0.93/fonts.xml
  18. 0
    338
      src/documentation/content/xdocs/0.93/graphics.xml
  19. 2
    2
      src/documentation/content/xdocs/0.94/index.xml
  20. 1
    1
      src/documentation/content/xdocs/0.94/pdfa.xml
  21. 0
    0
      src/documentation/content/xdocs/0.95/anttask.xml
  22. 3
    2
      src/documentation/content/xdocs/0.95/compiling.xml
  23. 72
    13
      src/documentation/content/xdocs/0.95/configuration.xml
  24. 10
    3
      src/documentation/content/xdocs/0.95/embedding.xml
  25. 234
    0
      src/documentation/content/xdocs/0.95/extensions.xml
  26. 418
    0
      src/documentation/content/xdocs/0.95/fonts.xml
  27. 0
    5
      src/documentation/content/xdocs/0.95/fotree/disabled-testcases.xml
  28. 551
    0
      src/documentation/content/xdocs/0.95/graphics.xml
  29. 0
    0
      src/documentation/content/xdocs/0.95/hyphenation.xml
  30. 8
    8
      src/documentation/content/xdocs/0.95/index.xml
  31. 0
    0
      src/documentation/content/xdocs/0.95/intermediate.xml
  32. 0
    28
      src/documentation/content/xdocs/0.95/known-issues.xml
  33. 7
    9
      src/documentation/content/xdocs/0.95/knownissues_overview.xml
  34. 10
    30
      src/documentation/content/xdocs/0.95/layoutengine/disabled-testcases.xml
  35. 124
    8
      src/documentation/content/xdocs/0.95/output.xml
  36. 27
    1
      src/documentation/content/xdocs/0.95/pdfa.xml
  37. 0
    4
      src/documentation/content/xdocs/0.95/pdfencryption.xml
  38. 0
    0
      src/documentation/content/xdocs/0.95/pdfx.xml
  39. 32
    31
      src/documentation/content/xdocs/0.95/running.xml
  40. 66
    1
      src/documentation/content/xdocs/0.95/servlets.xml
  41. 16
    26
      src/documentation/content/xdocs/0.95/upgrading.xml
  42. 69
    404
      src/documentation/content/xdocs/compliance.ihtml
  43. 2
    2
      src/documentation/content/xdocs/dev/doc.xml
  44. 20
    1
      src/documentation/content/xdocs/download.xml
  45. 15
    0
      src/documentation/content/xdocs/faq.xml
  46. 124
    0
      src/documentation/content/xdocs/quickstartguide.xml
  47. 13
    12
      src/documentation/content/xdocs/site.xml
  48. 4
    4
      src/documentation/content/xdocs/status.xml
  49. 1
    7
      src/documentation/content/xdocs/tabs.xml
  50. 25
    12
      src/documentation/content/xdocs/team.xml
  51. 17
    1
      src/documentation/content/xdocs/trunk/configuration.xml
  52. 18
    0
      src/documentation/content/xdocs/trunk/extensions.xml
  53. 138
    68
      src/documentation/content/xdocs/trunk/fonts.xml
  54. 1
    1
      src/documentation/content/xdocs/trunk/index.xml
  55. 38
    3
      src/documentation/content/xdocs/trunk/output.xml
  56. 1
    1
      src/documentation/content/xdocs/trunk/pdfa.xml
  57. 3
    2
      src/documentation/poster/README.txt
  58. 0
    7
      src/documentation/poster/cfg/README.txt
  59. 0
    1817
      src/documentation/poster/cfg/VERDANA.ttf.xml
  60. 0
    1167
      src/documentation/poster/cfg/VERDANAB.ttf.xml
  61. 1
    11
      src/documentation/poster/cfg/fop.xconf
  62. 0
    925
      src/documentation/poster/cfg/lucon.ttf.xml
  63. 2
    1
      src/documentation/poster/svg/pepe-business-card.svg
  64. 10
    9
      src/documentation/poster/xml/business-card-demo.xml
  65. 5
    6
      src/documentation/poster/xml/fop-history.xml
  66. 5
    5
      src/documentation/poster/xml/fop-poster.xml
  67. 1
    1
      src/documentation/poster/xml/fop-transformation-chain.xml
  68. 1
    2
      src/documentation/poster/xml/fop-use-cases.xml
  69. 3
    3
      src/documentation/poster/xslt/common.xsl
  70. 6
    7
      src/documentation/poster/xslt/fop-poster.xsl
  71. 6
    37
      src/documentation/sitemap.xmap
  72. 13
    6
      src/documentation/skinconf.xml
  73. 1
    1
      src/java/org/apache/fop/Version.java
  74. 1
    36
      src/java/org/apache/fop/apps/FOUserAgent.java
  75. 4
    60
      src/java/org/apache/fop/apps/Fop.java
  76. 17
    20
      src/java/org/apache/fop/apps/FopFactory.java
  77. 1
    1
      src/java/org/apache/fop/apps/FopFactoryConfigurator.java
  78. 85
    85
      src/java/org/apache/fop/apps/FormattingResults.java
  79. 80
    80
      src/java/org/apache/fop/apps/MimeConstants.java
  80. 59
    59
      src/java/org/apache/fop/apps/PageSequenceResults.java
  81. 14
    5
      src/java/org/apache/fop/area/AreaTreeModel.java
  82. 12
    9
      src/java/org/apache/fop/area/AreaTreeParser.java
  83. 12
    3
      src/java/org/apache/fop/area/Block.java
  84. 9
    0
      src/java/org/apache/fop/area/BlockViewport.java
  85. 3
    1
      src/java/org/apache/fop/area/NormalFlow.java
  86. 52
    1
      src/java/org/apache/fop/area/PageSequence.java
  87. 6
    11
      src/java/org/apache/fop/area/RenderPagesModel.java
  88. 59
    59
      src/java/org/apache/fop/area/inline/SpaceArea.java
  89. 72
    72
      src/java/org/apache/fop/area/inline/WordArea.java
  90. 31
    3
      src/java/org/apache/fop/cli/InputHandler.java
  91. 12
    0
      src/java/org/apache/fop/datatypes/LengthBase.java
  92. 1
    1
      src/java/org/apache/fop/fo/FONode.java
  93. 29
    7
      src/java/org/apache/fop/fo/FOPropertyMapping.java
  94. 35
    64
      src/java/org/apache/fop/fo/FOTreeBuilder.java
  95. 4
    2
      src/java/org/apache/fop/fo/PropertyList.java
  96. 26
    23
      src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java
  97. 64
    18
      src/java/org/apache/fop/fo/expr/ICCColorFunction.java
  98. 2
    1
      src/java/org/apache/fop/fo/expr/NumericProperty.java
  99. 29
    0
      src/java/org/apache/fop/fo/expr/PPColWidthFunction.java
  100. 0
    0
      src/java/org/apache/fop/fo/expr/PropertyException.java

+ 1
- 1
build.xml View File

@@ -658,7 +658,7 @@ list of possible build targets.
<include name="org/apache/fop/image/Abstract*"/>
<include name="org/apache/fop/image/analyser/*.class"/>
<include name="org/apache/fop/util/CMYKColorSpace*.class"/>
<include name="org/apache/fop/util/ColorExt*.class"/>
<include name="org/apache/fop/util/Color*.class"/>
<include name="org/apache/fop/util/ASCII*.class"/>
<include name="org/apache/fop/util/*OutputStream.class"/>
<include name="org/apache/fop/util/SubInputStream.class"/>

+ 113
- 113
examples/embedding/java/embedding/ExampleAWTViewer.java View File

@@ -1,113 +1,113 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package embedding;
//Java
import java.io.File;
import java.io.IOException;
//JAXP
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerException;
import javax.xml.transform.Source;
import javax.xml.transform.Result;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.sax.SAXResult;
//Avalon
import org.apache.avalon.framework.ExceptionUtil;
//FOP
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.MimeConstants;
/**
* This class demonstrates the use of the AWT Viewer.
*/
public class ExampleAWTViewer {
// configure fopFactory as desired
private FopFactory fopFactory = FopFactory.newInstance();
/**
* Display an FO file in the AWT Preview.
* @param fo the FO file
* @throws IOException In case of an I/O problem
* @throws FOPException In case of a problem during layout
* @throws TransformerException In case of a problem during XML processing
*/
public void viewFO(File fo)
throws IOException, FOPException, TransformerException {
//Setup FOP
Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_AWT_PREVIEW);
try {
//Load XSL-FO file (you can also do an XSL transformation here)
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
Source src = new StreamSource(fo);
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
} catch (Exception e) {
if (e instanceof FOPException) {
throw (FOPException)e;
}
throw new FOPException(e);
}
}
/**
* Main method.
* @param args the command-line arguments
*/
public static void main(String[] args) {
try {
System.out.println("FOP ExampleAWTViewer\n");
System.out.println("Preparing...");
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
outDir.mkdirs();
//Setup input and output files
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
System.out.println("Input: XSL-FO (" + fofile + ")");
System.out.println("Output: AWT Viewer");
System.out.println();
System.out.println("Starting AWT Viewer...");
ExampleAWTViewer app = new ExampleAWTViewer();
app.viewFO(fofile);
System.out.println("Success!");
} catch (Exception e) {
System.err.println(ExceptionUtil.printStackTrace(e));
System.exit(-1);
}
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package embedding;
//Java
import java.io.File;
import java.io.IOException;
//JAXP
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerException;
import javax.xml.transform.Source;
import javax.xml.transform.Result;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.sax.SAXResult;
//Avalon
import org.apache.avalon.framework.ExceptionUtil;
//FOP
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.apps.MimeConstants;
/**
* This class demonstrates the use of the AWT Viewer.
*/
public class ExampleAWTViewer {
// configure fopFactory as desired
private FopFactory fopFactory = FopFactory.newInstance();
/**
* Display an FO file in the AWT Preview.
* @param fo the FO file
* @throws IOException In case of an I/O problem
* @throws FOPException In case of a problem during layout
* @throws TransformerException In case of a problem during XML processing
*/
public void viewFO(File fo)
throws IOException, FOPException, TransformerException {
//Setup FOP
Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_AWT_PREVIEW);
try {
//Load XSL-FO file (you can also do an XSL transformation here)
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
Source src = new StreamSource(fo);
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
} catch (Exception e) {
if (e instanceof FOPException) {
throw (FOPException)e;
}
throw new FOPException(e);
}
}
/**
* Main method.
* @param args the command-line arguments
*/
public static void main(String[] args) {
try {
System.out.println("FOP ExampleAWTViewer\n");
System.out.println("Preparing...");
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
outDir.mkdirs();
//Setup input and output files
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
System.out.println("Input: XSL-FO (" + fofile + ")");
System.out.println("Output: AWT Viewer");
System.out.println();
System.out.println("Starting AWT Viewer...");
ExampleAWTViewer app = new ExampleAWTViewer();
app.viewFO(fofile);
System.out.println("Success!");
} catch (Exception e) {
System.err.println(ExceptionUtil.printStackTrace(e));
System.exit(-1);
}
}
}

+ 127
- 127
examples/embedding/java/embedding/ExampleFO2OldStylePrint.java View File

@@ -1,127 +1,127 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package embedding;
// Java
import java.awt.print.PrinterJob;
import java.io.File;
import java.io.IOException;
//JAXP
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Source;
import javax.xml.transform.Result;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.sax.SAXResult;
// FOP
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.render.print.PrintRenderer;
/**
* This class demonstrates printing an FO file to a PrinterJob instance.
*/
public class ExampleFO2OldStylePrint {
// configure fopFactory as desired
private FopFactory fopFactory = FopFactory.newInstance();
/**
* Prints an FO file using an old-style PrinterJob.
* @param fo the FO file
* @throws IOException In case of an I/O problem
* @throws FOPException In case of a FOP problem
*/
public void printFO(File fo) throws IOException, FOPException {
//Set up PrinterJob instance
PrinterJob printerJob = PrinterJob.getPrinterJob();
printerJob.setJobName("FOP Printing Example");
try {
//Set up a custom user agent so we can supply our own renderer instance
FOUserAgent userAgent = fopFactory.newFOUserAgent();
//Set up our own PrintRenderer instance so we can supply a special PrinterJob instance.
PrintRenderer renderer = new PrintRenderer(printerJob);
renderer.setUserAgent(userAgent);
userAgent.setRendererOverride(renderer);
// Construct fop with desired output format (here, it is set through the user agent)
Fop fop = fopFactory.newFop(userAgent);
// Setup JAXP using identity transformer
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); // identity transformer
// Setup input stream
Source src = new StreamSource(fo);
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
} catch (Exception e) {
e.printStackTrace(System.err);
System.exit(-1);
}
}
/**
* Main method.
* @param args command-line arguments
*/
public static void main(String[] args) {
try {
System.out.println("FOP ExampleFO2OldStylePrint\n");
System.out.println("Preparing...");
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
outDir.mkdirs();
//Setup input and output files
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
System.out.println("Input: XSL-FO (" + fofile + ")");
System.out.println("Output: old-style printing using PrinterJob");
System.out.println();
System.out.println("Transforming...");
ExampleFO2OldStylePrint app = new ExampleFO2OldStylePrint();
app.printFO(fofile);
System.out.println("Success!");
} catch (Exception e) {
e.printStackTrace(System.err);
System.exit(-1);
}
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package embedding;
// Java
import java.awt.print.PrinterJob;
import java.io.File;
import java.io.IOException;
//JAXP
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Source;
import javax.xml.transform.Result;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.sax.SAXResult;
// FOP
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FopFactory;
import org.apache.fop.render.print.PrintRenderer;
/**
* This class demonstrates printing an FO file to a PrinterJob instance.
*/
public class ExampleFO2OldStylePrint {
// configure fopFactory as desired
private FopFactory fopFactory = FopFactory.newInstance();
/**
* Prints an FO file using an old-style PrinterJob.
* @param fo the FO file
* @throws IOException In case of an I/O problem
* @throws FOPException In case of a FOP problem
*/
public void printFO(File fo) throws IOException, FOPException {
//Set up PrinterJob instance
PrinterJob printerJob = PrinterJob.getPrinterJob();
printerJob.setJobName("FOP Printing Example");
try {
//Set up a custom user agent so we can supply our own renderer instance
FOUserAgent userAgent = fopFactory.newFOUserAgent();
//Set up our own PrintRenderer instance so we can supply a special PrinterJob instance.
PrintRenderer renderer = new PrintRenderer(printerJob);
renderer.setUserAgent(userAgent);
userAgent.setRendererOverride(renderer);
// Construct fop with desired output format (here, it is set through the user agent)
Fop fop = fopFactory.newFop(userAgent);
// Setup JAXP using identity transformer
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); // identity transformer
// Setup input stream
Source src = new StreamSource(fo);
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
} catch (Exception e) {
e.printStackTrace(System.err);
System.exit(-1);
}
}
/**
* Main method.
* @param args command-line arguments
*/
public static void main(String[] args) {
try {
System.out.println("FOP ExampleFO2OldStylePrint\n");
System.out.println("Preparing...");
//Setup directories
File baseDir = new File(".");
File outDir = new File(baseDir, "out");
outDir.mkdirs();
//Setup input and output files
File fofile = new File(baseDir, "xml/fo/helloworld.fo");
System.out.println("Input: XSL-FO (" + fofile + ")");
System.out.println("Output: old-style printing using PrinterJob");
System.out.println();
System.out.println("Transforming...");
ExampleFO2OldStylePrint app = new ExampleFO2OldStylePrint();
app.printFO(fofile);
System.out.println("Success!");
} catch (Exception e) {
e.printStackTrace(System.err);
System.exit(-1);
}
}
}

+ 1
- 1
examples/embedding/java/embedding/intermediate/ExampleConcat.java View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/

/* $Id: ExampleDOM2PDF.java 332791 2005-11-12 15:58:07Z jeremias $ */
/* $Id$ */
package embedding.intermediate;


+ 1
- 1
examples/embedding/java/embedding/intermediate/ExampleStamp.java View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/

/* $Id: ExampleDOM2PDF.java 332791 2005-11-12 15:58:07Z jeremias $ */
/* $Id$ */
package embedding.intermediate;


+ 7
- 0
fixsvnprops.sh View File

@@ -0,0 +1,7 @@
#!/bin/sh

find . -name \*.java -exec svn ps svn:keywords "Id" '{}' \;
find . -name \*.xml -exec svn ps svn:keywords "Revision Id" '{}' \;
find . -name \*.java -exec svn ps svn:eol-style native '{}' \;
find . -name \*.xml -exec svn ps svn:eol-style native '{}' \;


+ 1
- 1
fop.bat View File

@@ -61,7 +61,7 @@ set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xercesImpl-2.7.1.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xalan-2.7.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\serializer-2.7.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\batik-all-1.7.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xmlgraphics-commons-1.3svn.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\xmlgraphics-commons-1.3.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\avalon-framework-4.2.0.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-io-1.3.1.jar
set LOCALCLASSPATH=%LOCALCLASSPATH%;%LIBDIR%\commons-logging-1.0.4.jar

+ 3
- 2
forrest.properties View File

@@ -97,7 +97,8 @@ forrest.validate.skins.stylesheets=${forrest.validate.skins}
# server, set to -Djava.awt.headless=true
#forrest.jvmargs=
# The bugtracking URL - the issue number will be appended
#project.bugtracking-url=http://issues.apache.org/bugzilla/show_bug.cgi?id=
project.bugtracking-url=http://issues.apache.org/bugzilla/show_bug.cgi?id=
bugtracking-url=http://issues.apache.org/bugzilla/show_bug.cgi?id=
#project.bugtracking-url=http://issues.apache.org/jira/browse/
# The issues list as rss
#project.issues-rss-url=
@@ -106,4 +107,4 @@ forrest.validate.skins.stylesheets=${forrest.validate.skins}
# The names of plugins that are required to build the project
# comma separated list (no spaces)
# project.required.plugins=
project.required.plugins=org.apache.forrest.plugin.output.pdf-0.1
project.required.plugins=org.apache.forrest.plugin.input.projectInfo,org.apache.forrest.plugin.output.pdf

+ 22
- 0
forrest.properties.xml View File

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

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<properties>
<!-- Project identity -->
<property name="projectInfo.project.fullname" value="Apache FOP"/>
<property name="projectInfo.project.url" value="http://xmlgraphics.apache.org/fop/"/>
</properties>

+ 60
- 42
lib/README.txt View File

@@ -51,58 +51,33 @@ Normal Dependencies
Apache License v2.0

- Apache XML Commons Externals
- Apache XML Commons Externals (JAXP API)

xml-apis-ext-*.jar
xml-apis.jar
http://xml.apache.org/commons/components/external/
(additional DOM APIs from W3C, like SVG, SMIL and Simple API for CSS)
(the JAXP API, plus SAX and various W3C DOM Java bindings,
maintained in XML Commons Externals)
Apache License v2.0 (applies to the distribution)
SAX is in the public domain
http://www.saxproject.org/copying.html
W3C Software Notice and License (applies to the various DOM Java bindings)
W3C Document License (applies to the DOM documentation)
http://www.w3.org/Consortium/Legal/copyright-software
http://www.w3.org/Consortium/Legal/copyright-documents
http://www.w3.org/Consortium/Legal/



Special Dependencies
-----------------------

The special dependencies are the whole JAXP set which required for users
on JDK 1.3.x which doesn't include JAXP. But it is also interesting for
users on JDKs >= 1.4 if they want to replace the default JAXP
implementation delivered by the JDK.

Replacing the default implementations involves understanding the
"Endorsed Standards Override Mechanism".
More information can be found here:
http://java.sun.com/j2se/1.4.2/docs/guide/standards/index.html

- JAXP API

xml-apis.jar
xml-apis-ext-*.jar
http://xml.apache.org/commons/components/external/
(the JAXP API, plus SAX and various W3C DOM Java bindings,
maintained in XML Commons Externals)
(additional DOM APIs from W3C, like SVG, SMIL and Simple API for CSS)
Apache License v2.0 (applies to the distribution)
SAX is in the public domain
http://www.saxproject.org/copying.html
W3C Software Notice and License (applies to the various DOM Java bindings)
W3C Document License (applies to the DOM documentation)
http://www.w3.org/Consortium/Legal/copyright-software
http://www.w3.org/Consortium/Legal/copyright-documents
http://www.w3.org/Consortium/Legal/

- Apache Xerces-J

xercesImpl-*.jar
http://xerces.apache.org
(JAXP-compliant XML parser and DOM Level 3 implementation)
Apache License v2.0

- Apache Xalan-J

xalan-*.jar and serializer-*.jar
@@ -116,6 +91,45 @@ http://java.sun.com/j2se/1.4.2/docs/guide/standards/index.html
(see xalan.runtime.LICENSE.txt)


Special Dependencies
-----------------------

- Apache Xerces-J

xercesImpl-*.jar
http://xerces.apache.org
(JAXP-compliant XML parser and DOM Level 3 implementation)
Apache License v2.0
Xerces-J is not directly referenced by FOP or any of its dependencies.

A note on JAXP
-----------------------

Since Java 1.4, JAXP (Java API for XML Processing) is part of the
JRE/JDK. Every JVM includes the APIs and an implementation. However,
older JREs often contain implementations with bugs that are triggered
by code in Apache FOP and therefore need to be overridden. Now, since
JAXP is part of the class library, special precautions are necessary
to replace the original implementations. This is not done by simply
adding new JARs to the classpath as these classes would never be
loaded (due to Java's class loader hierarchy).

Replacing the default implementations involves understanding the
"Endorsed Standards Override Mechanism".
More information can be found here:
http://java.sun.com/j2se/1.4.2/docs/guide/standards/index.html

See also:
http://xml.apache.org/xalan-j/faq.html#faq-N100EF

Essentially, you have two different possibilities:
- add the replacement JARs in the jre/lib/endorsed directory of your JRE.
- Use the -Xbootclasspath/p: option when starting the JVM (may not be
available for every JVM).


Optional Dependencies
------------------------
@@ -123,15 +137,13 @@ Optional Dependencies
The following libraries are not bundled with FOP and must be installed manually.
Please make sure you've read the license of each package.

- JIMI Image library

http://java.sun.com/products/jimi
Sun Binary Code License

- JAI (Java Advanced Imaging API)
- JAI Image I/O Tools

http://java.sun.com/products/java-media/jai
Java Research License and Java Distribution License (Check which one applies to you!)
https://jai-imageio.dev.java.net/
BSD license
Note: Not the whole JAI is needed, only the ImageIO-compatible codecs
packaged as "Image I/O Tools". The name may be misleading.

- JEuclid (MathML implementation, for the MathML extension)

@@ -164,4 +176,10 @@ Additional development-time dependencies

(not bundled, provided by Apache Ant or your IDE)
http://www.junit.org
Common Public License V1.0
Common Public License V1.0

- XMLUnit (optional)

(not bundled, to be added to your Apache Ant installation)
http://xmlunit.sourceforge.net/
BSD style license

BIN
lib/xmlgraphics-commons-1.3svn.jar → lib/xmlgraphics-commons-1.3.jar View File


+ 1
- 0
src/codegen/fonts/Symbol.xml View File

@@ -124,6 +124,7 @@
<char name="bar" width="200"/>
<char name="braceright" width="480"/>
<char name="similar" width="549"/>
<char name="Euro" width="750"/>
<char name="Upsilon1" width="620"/>
<char name="minute" width="247"/>
<char name="lessequal" width="549"/>

+ 88
- 59
src/codegen/fonts/code-point-mapping.xsl View File

@@ -43,86 +43,41 @@ package org.apache.fop.fonts;
import java.util.Map;
import java.util.Collections;

public class CodePointMapping {
private char[] latin1Map;
private char[] characters;
private char[] codepoints;
public class CodePointMapping extends AbstractCodePointMapping {

private CodePointMapping(int [] table) {
int nonLatin1 = 0;
latin1Map = new char[256];
for (int i = 0; i &lt; table.length; i += 2) {
if (table[i + 1] &lt; 256) {
latin1Map[table[i + 1]] = (char) table[i];
} else {
++nonLatin1;
}
}
characters = new char[nonLatin1];
codepoints = new char[nonLatin1];
int top = 0;
for (int i = 0; i &lt; table.length; i += 2) {
char c = (char) table[i + 1];
if (c >= 256) {
++top;
for (int j = top - 1; j >= 0; --j) {
if (j > 0 &amp;&amp; characters[j - 1] >= c) {
characters[j] = characters[j - 1];
codepoints[j] = codepoints[j - 1];
} else {
characters[j] = c;
codepoints[j] = (char) table[i];
break;
}
}
}
}
}
<xsl:apply-templates mode="constant"/>

public final char mapChar(char c) {
if (c &lt; 256) {
return latin1Map[c];
} else {
int bot = 0, top = characters.length - 1;
while (top >= bot) {
int mid = (bot + top) / 2;
char mc = characters[mid];
public CodePointMapping(String name, int[] table) {
super(name, table);
}

if (c == mc) {
return codepoints[mid];
} else if (c &lt; mc) {
top = mid - 1;
} else {
bot = mid + 1;
}
}
return 0;
}
public CodePointMapping(String name, int[] table, String[] charNameMap) {
super(name, table, charNameMap);
}

private static Map mappings;
static {
mappings = Collections.synchronizedMap(new java.util.HashMap());
}

public static CodePointMapping getMapping(String encoding) {
CodePointMapping mapping = (CodePointMapping) mappings.get(encoding);
if (mapping != null) {
return mapping;
} <xsl:apply-templates mode="get"/>
//TODO: Implement support for Expert and ExpertSubset encoding
else if (encoding.startsWith("Expert")) {
throw new UnsupportedOperationException(encoding + " not implemented yet");
}
throw new UnsupportedOperationException("Unknown encoding: " + encoding);
}
<xsl:apply-templates mode="table"/>
<xsl:apply-templates select="encoding" mode="names"/>
}
</xsl:template>

<xsl:template match="encoding" mode="constant"> public static final String <xsl:value-of select="@constant"/> = "<xsl:value-of select="@id"/>";</xsl:template>
<xsl:template match="encoding" mode="get">
else if (encoding.equals("<xsl:value-of select="@id"/>")) {
mapping = new CodePointMapping(enc<xsl:value-of select="@id"/>);
mappings.put("<xsl:value-of select="@id"/>", mapping);
else if (encoding.equals(<xsl:value-of select="@constant"/>)) {
mapping = new CodePointMapping(<xsl:value-of select="@constant"/>, enc<xsl:value-of select="@id"/>, names<xsl:value-of select="@id"/>);
mappings.put(<xsl:value-of select="@constant"/>, mapping);
return mapping;
}
</xsl:template>
@@ -139,4 +94,78 @@ public class CodePointMapping {
</xsl:for-each></xsl:for-each>
};
</xsl:template>
<xsl:template match="encoding" mode="names">
private static final String[] names<xsl:value-of select="@id"/>
= {
<xsl:call-template name="charname">
<xsl:with-param name="idx" select="0"/>
</xsl:call-template>
};
</xsl:template>
<xsl:template name="charname">
<xsl:param name="idx"/>
<xsl:variable name="idxHEXraw">
<xsl:call-template name="toHex">
<xsl:with-param name="decimalNumber" select="$idx"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="idxHEX">
<xsl:call-template name="padnumber">
<xsl:with-param name="num" select="$idxHEXraw"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="idxhex" select="translate($idxHEX, 'ABCDEF', 'abcdef')"></xsl:variable>
<!--
<xsl:value-of select="$idx"/>-<xsl:value-of select="$idxHEXraw"/>-<xsl:value-of select="$idxHEX"/>-<xsl:value-of select="$idxhex"/>
-->
<xsl:if test="($idx mod 4) = 0">
<xsl:text>&#x0D; /*</xsl:text><xsl:value-of select="$idxHEX"/><xsl:text>*/ </xsl:text>
</xsl:if>
<xsl:variable name="v">
<xsl:value-of select="child::glyph[@codepoint = $idxHEX or @codepoint = $idxhex]/@name"/><!--<xsl:value-of select="glyph[@codepoint = $idxhex]/@name"/>-->
</xsl:variable>
<xsl:choose>
<xsl:when test="string-length($v) > 0">
<xsl:text>"</xsl:text><xsl:value-of select="$v"/><xsl:text>"</xsl:text>
</xsl:when>
<xsl:otherwise>null</xsl:otherwise>
</xsl:choose>
<xsl:if test="$idx &lt; 255">
<xsl:text>, </xsl:text>
<xsl:call-template name="charname">
<xsl:with-param name="idx" select="$idx + 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:variable name="hexDigits" select="'0123456789ABCDEF'"/>
<xsl:template name="toHex">
<xsl:param name="decimalNumber" />
<xsl:if test="$decimalNumber >= 16">
<xsl:call-template name="toHex">
<xsl:with-param name="decimalNumber" select="floor($decimalNumber div 16)" />
</xsl:call-template>
</xsl:if>
<xsl:value-of select="substring($hexDigits, ($decimalNumber mod 16) + 1, 1)" />
</xsl:template>
<xsl:template name="padnumber">
<xsl:param name="num"/>
<xsl:param name="len" select="2"/>
<!--
<xsl:text> </xsl:text><xsl:value-of select="$num"/>/<xsl:value-of select="$len"/>
-->
<xsl:choose>
<xsl:when test="string-length($num) &lt; $len">
<xsl:call-template name="padnumber">
<xsl:with-param name="num" select="concat('0',$num)"/>
<xsl:with-param name="len" select="$len"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise><xsl:value-of select="$num"/></xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

+ 9
- 9
src/codegen/fonts/encodings.xml View File

@@ -19,12 +19,12 @@
<!DOCTYPE encoding-set [
<!ELEMENT encoding-set (encoding+)>
<!ELEMENT encoding (glyph+)>
<!ATTLIST encoding id ID #REQUIRED glyphlist CDATA "AGL">
<!ATTLIST encoding id ID #REQUIRED constant CDATA #REQUIRED glyphlist CDATA "AGL">
<!ELEMENT glyph EMPTY>
<!ATTLIST glyph codepoint CDATA #REQUIRED name CDATA #REQUIRED>
]>
<encoding-set>
<encoding id='StandardEncoding' glyphlist='AGL'>
<encoding id='StandardEncoding' constant="STANDARD_ENCODING" glyphlist='AGL'>
<glyph codepoint='20' name='space'/>
<glyph codepoint='21' name='exclam'/>
<glyph codepoint='22' name='quotedbl'/>
@@ -175,7 +175,7 @@
<glyph codepoint='fa' name='oe'/>
<glyph codepoint='fb' name='germandbls'/>
</encoding>
<encoding id='ISOLatin1Encoding' glyphlist='AGL'>
<encoding id='ISOLatin1Encoding' constant="ISOLATIN1_ENCODING" glyphlist='AGL'>
<glyph codepoint='20' name='space'/>
<glyph codepoint='21' name='exclam'/>
<glyph codepoint='22' name='quotedbl'/>
@@ -377,7 +377,7 @@
<glyph codepoint='fe' name='thorn'/>
<glyph codepoint='ff' name='ydieresis'/>
</encoding>
<encoding id='CEEncoding' glyphlist='AGL'>
<encoding id='CEEncoding' constant="CE_ENCODING" glyphlist='AGL'>
<glyph codepoint='20' name='space'/>
<glyph codepoint='21' name='exclam'/>
<glyph codepoint='22' name='quotedbl'/>
@@ -594,7 +594,7 @@
<glyph codepoint='fe' name='tcommaaccent'/>
<glyph codepoint='ff' name='dotaccent'/>
</encoding>
<encoding id='MacRomanEncoding' glyphlist='AGL'>
<encoding id='MacRomanEncoding' constant="MAC_ROMAN_ENCODING" glyphlist='AGL'>
<glyph codepoint='20' name='space'/>
<glyph codepoint='21' name='exclam'/>
<glyph codepoint='22' name='quotedbl'/>
@@ -803,7 +803,7 @@
<glyph codepoint='b4' name='yen'/>
<glyph codepoint='7a' name='z'/>
</encoding>
<encoding id='WinAnsiEncoding' glyphlist='AGL'>
<encoding id='WinAnsiEncoding' constant="WIN_ANSI_ENCODING" glyphlist='AGL'>
<glyph codepoint='20' name='space'/>
<glyph codepoint='21' name='exclam'/>
<glyph codepoint='22' name='quotedbl'/>
@@ -1021,7 +1021,7 @@
<glyph codepoint='fe' name='thorn'/>
<glyph codepoint='ff' name='ydieresis'/>
</encoding>
<encoding id='PDFDocEncoding' glyphlist='AGL'>
<encoding id='PDFDocEncoding' constant="PDF_DOC_ENCODING" glyphlist='AGL'>
<glyph codepoint='18' name='breve'/>
<glyph codepoint='19' name='caron'/>
<glyph codepoint='1a' name='circumflex'/>
@@ -1252,7 +1252,7 @@
<glyph codepoint='fe' name='thorn'/>
<glyph codepoint='ff' name='ydieresis'/>
</encoding>
<encoding id='SymbolEncoding' glyphlist='AGL'>
<encoding id='SymbolEncoding' constant="SYMBOL_ENCODING" glyphlist='AGL'>
<glyph codepoint='20' name='space'/>
<glyph codepoint='21' name='exclam'/>
<glyph codepoint='22' name='universal'/>
@@ -1443,7 +1443,7 @@
<glyph codepoint='fd' name='bracerightmid'/>
<glyph codepoint='fe' name='bracerightbt'/>
</encoding>
<encoding id='ZapfDingbatsEncoding' glyphlist='ZGL'>
<encoding id='ZapfDingbatsEncoding' constant="ZAPF_DINGBATS_ENCODING" glyphlist='ZGL'>
<glyph codepoint='20' name='space'/>
<glyph codepoint='21' name='a1'/>
<glyph codepoint='22' name='a2'/>

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

@@ -77,15 +77,15 @@
<release>
<Version>
<name>Previous release</name>
<created>2003-07-16</created>
<revision>0.20.5</revision>
<created>2007-01-02</created>
<revision>0.93</revision>
</Version>
</release>
<release>
<Version>
<name>Latest stable release</name>
<created>2007-01-02</created>
<revision>0.93</revision>
<created>2007-08-23</created>
<revision>0.94</revision>
</Version>
</release>
<repository>

+ 0
- 125
src/documentation/content/xdocs/0.93/extensions.xml View File

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

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

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


+ 0
- 298
src/documentation/content/xdocs/0.93/fonts.xml View File

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

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Apache FOP: Fonts</title>
<version>$Revision$</version>
<authors>
<person name="Jeremias Märki" email=""/>
<person name="Tore Engvig" email=""/>
</authors>
</header>
<body>
<section id="intro">
<title>Summary</title>
<note>The FOP Font subsystem is currently undergoing a significant change.
The details provided here especially related to the generation of FOP Font
Metrics files and the FOP Font configuration are likely to change substantially
in the future.
</note>
<p>The following table summarizes the font capabilities of the various FOP renderers:</p>
<table>
<tr>
<th>Renderer</th>
<th>Base-14</th>
<th>AWT/OS</th>
<th>Custom</th>
<th>Custom Embedding</th>
</tr>
<tr>
<td>PDF</td>
<td>yes</td>
<td>no</td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td>PostScript</td>
<td>yes</td>
<td>no</td>
<td>yes</td>
<td>yes</td>
</tr>
<!--tr> NOT AVAILABLE YET!!!
<td>PCL</td>
<td>yes (modified)</td>
<td>no</td>
<td>no</td>
<td>no</td>
</tr-->
<tr>
<td>TXT</td>
<td>yes (used for layout but not for output)</td>
<td>no</td>
<td>yes (used for layout but not for output)</td>
<td>no</td>
</tr>
<tr>
<td>AWT</td>
<td>if available from OS</td>
<td>yes</td>
<td>yes</td>
<td>n/a (display only)</td>
</tr>
<tr>
<td>Print</td>
<td>if available from OS</td>
<td>yes</td>
<td>yes</td>
<td>controlled by OS printer driver</td>
</tr>
<tr>
<td>RTF</td>
<td>n/a (font metrics not needed)</td>
<td>n/a</td>
<td>n/a</td>
<td>n/a</td>
</tr>
<tr>
<td>MIF</td>
<td>n/a (font metrics not needed)</td>
<td>n/a</td>
<td>n/a</td>
<td>n/a</td>
</tr>
<tr>
<td>SVG</td>
<td>if available from OS</td>
<td>yes</td>
<td>no</td>
<td>no</td>
</tr>
<tr>
<td>XML</td>
<td>yes</td>
<td>no</td>
<td>yes</td>
<td>n/a</td>
</tr>
</table>
</section>
<section>
<title>Base-14 Fonts</title>
<p>The Adobe PDF Specification specifies a set of 14 fonts that must be available to every PDF reader: Helvetica (normal, bold, italic, bold italic), Times (normal, bold, italic, bold italic), Courier (normal, bold, italic, bold italic), Symbol and ZapfDingbats.</p>
</section>
<section id="awt">
<title>AWT/Operating System Fonts</title>
<p>The AWT family of renderers (AWT, Print, SVG), use the Java AWT libraries for font metric information. Through operating system registration, the AWT libraries know what fonts are available on the system, and the font metrics for each one.</p>
</section>
<section id="custom">
<title>Custom Fonts</title>
<p>Support for custom fonts is added by creating font metric files (written in XML) from the actual font files, and registering them with FOP. Currently only Type 1 and TrueType fonts can be added.
More information about fonts can be found at:</p>
<ul>
<li><a href="http://partners.adobe.com/asn/developer/type/ftypes.html">Adobe font types</a></li>
<li><a href="http://partners.adobe.com/asn/developer/technotes/fonts.html">Adobe Font Technote</a>
</li>
</ul>
<section id="type1-metrics">
<title>Type 1 Font Metrics</title>
<p>FOP includes PFMReader, which reads the PFM file that normally comes with a Type 1 font, and generates an appropriate font metrics file for it.
To use it, run the class org.apache.fop.fonts.apps.PFMReader:</p>
<p>Windows (on JDK 1.4 and later):</p>
<source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
<p>Windows (on JDK 1.3.x):</p>
<source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar;lib\xml-apis.jar;
lib\xercesImpl.jar;lib\xalan.jar;lib\serializer.jar
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
<p>Unix (on JDK 1.4 and later):</p>
<source>java -cp build/fop.jar:lib/avalon-framework.jar:lib/commons-logging.jar:lib/commons-io.jar
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
<p>Unix (on JDK 1.3.1):</p>
<source>java -cp build/fop.jar:lib/avalon-framework.jar:lib/commons-logging.jar:lib/commons-io.jar:lib/xml-apis.jar:
lib/xercesImpl.jar:lib/xalan.jar:lib/serializer.jar
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
<p>PFMReader [options]:</p>
<ul>
<li><strong>-fn &lt;fontname&gt;</strong> By default, FOP uses the fontname from the
.pfm file when embedding the font. Use the "-fn" option to override this name with one you have
chosen. This may be useful in some cases to ensure that applications using the output document
(Acrobat Reader for example) use the embedded font instead of a local font with the same
name.</li>
</ul>
<note>The classpath in the above example has been simplified for readability.
You will have to adjust the classpath to the names of the actual JAR files in the lib directory.
xml-apis.jar, xercesImpl.jar, xalan.jar and serializer.jar are not necessary for JDK version 1.4 or later.</note>
<note>The tool will construct some values (FontBBox, StemV and ItalicAngle) based on assumptions and calculations which are only an approximation to the real values.
FontBBox and Italic Angle can be found in the human-readable part of the PFB file or in the AFM file.
The PFMReader tool does not yet interpret PFB or AFM files, so if you want to be correct, you may have to adjust the values in the XML file manually.
The constructed values however appear to have no visible influence.</note>
</section>
<section id="truetype-metrics">
<title>TrueType Font Metrics</title>
<p>FOP includes TTFReader, which reads the TTF file and generates an appropriate font metrics file for it.
Use it in a similar manner to PFMReader.
For example, to create such a metrics file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:</p>
<source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
org.apache.fop.fonts.apps.TTFReader [options]
C:\myfonts\cmr10.ttf ttfcm.xml</source>
<p>TTFReader [options]:</p>
<ul>
<li><strong>-d &lt;DEBUG | INFO &gt;</strong> Sets the debug level (default is
INFO).</li>
<li><strong>-fn &lt;fontname&gt;</strong> Same as for PFMReader.</li>
<li><strong>-ttcname &lt;fontname&gt;</strong> If you're reading data from a
TrueType Collection (.ttc file) you must specify which font from the collection you will read
metrics from.
If you read from a .ttc file without this option, the fontnames will be listed for you.</li>
<li><strong>-enc ansi</strong> Creates a WinAnsi-encoded font metrics file.
Without this option, a CID-keyed font metrics file is created.
The table below summarizes the differences between these two encoding options as currently
used within FOP.
Please note that this information only applies to TrueType fonts and TrueType collections:</li>
</ul>
<table id="ttf-encoding">
<tr>
<th>Issue</th>
<th>WinAnsi</th>
<th>CID-keyed</th>
</tr>
<tr>
<td>Usable Character Set</td>
<td>Limited to WinAnsi character set, which is roughly equivalent to iso-8889-1.</td>
<td>Limited only by the characters in the font itself.</td>
</tr>
<tr>
<td>Embedding the Font</td>
<td>Optional.</td>
<td>Mandatory. Not embedding the font produces invalid PDF documents.</td>
</tr>
</table>
<warning>
You may experience failures with certain TrueType fonts, especially if they don't contain
the so-called Unicode "cmap" table. TTFReader can currently not deal with font like this.
</warning>
</section>
<section id="truetype-collections-metrics">
<title>TrueType Collections Font Metrics</title>
<p>TrueType collections (.ttc files) contain more than one font.
To create metrics files for these fonts, you must specify which font in the collection should be generated, by using the "-ttcname" option with the TTFReader.</p>
<p>To get a list of the fonts in a collection, just start the TTFReader as if it were a normal TrueType file (without the -ttcname option).
It will display all of the font names and exit with an Exception.</p>
<p>Here is an example of generating a metrics file for a .ttc file:</p>
<source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho"
msmincho.ttc msminch.xml</source>
</section>
<section id="register">
<title>Register Fonts with FOP</title>
<p>You must tell FOP how to find and use the font metrics files by registering them in the <a href="configuration.html">FOP Configuration</a>. Add entries for your custom fonts, regardless of font type, to the configuration file in a manner similar to the following:</p>
<source><![CDATA[<font metrics-url="file:///C:/myfonts/FTL_____.xml" kerning="yes"
embed-url="file:///C:/myfonts/FTL_____.pfb">
<font-triplet name="FrutigerLight" style="normal" weight="normal"/>
</font>]]></source>
<note>Review the documentation for <a href="configuration.html">FOP Configuration</a> for instructions on making the FOP configuration available to FOP when it runs. Otherwise, FOP has no way of finding your custom font information.</note>
<ul>
<li>
URLs are used to access the font metric and font files.
Relative URLs are resolved relative to the font-base property (or base) if available.
See <a href="configuration.html">FOP: Configuration</a> for more information.
</li>
<li>The "kerning" and "embed-url" attributes are optional. Kerning is currently not used at all. If embedding is off, the output will position the text correctly (from the metrics file), but it will not be displayed or printed correctly unless the viewer has the applicable font available to their local system.</li>
<li>When setting the embed-url attribute for Type 1 fonts, be sure to specify the PFB (actual font data), not PFM (font metrics) file that you used to generate the XML font metrics file.</li>
<li>
If relative URLs are specified, they are evaluated relative to the value of the
"font-base" setting. If there is no "font-base" setting, the fonts are evaluated
relative to the base directory.
</li>
</ul>
<!--note>Cocoon users will need to setup the config, see FOPSerializer for more information.</note-->
</section>
<section id="embedding">
<title>Embedding</title>
<note>The PostScript renderer does not yet support TrueType fonts, but can embed Type 1 fonts.</note>
<note>The font is simply embedded into the PDF file, it is not converted.</note>
<p>Font embedding is enabled in the userconfig.xml file and controlled by the embed-url attribute.
If you don't specify the embed-url attribute the font will not be embedded, but will only be referenced.</p>
<warning>
Omitting the embed-url attribute for CID-encoded TrueType fonts will currently produce invalid
PDF files! If you create the XML font metric file using the "-enc ansi" option, you can omit
the embed-url attribute for TrueType fonts but you're restricted to the WinAnsi character set.
</warning>
<p>When FOP embeds a font, it adds a prefix to the fontname to ensure that the name will not match the fontname of an installed font.
This is helpful with older versions of Acrobat Reader that preferred installed fonts over embedded fonts.</p>
<p>When embedding PostScript fonts, the entire font is always embedded.</p>
<p>When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a subset of the original font, containing only the glyphs used, is embedded in the output document.
Currently, this embedded font contains only the minimum data needed to be embedded in a pdf document, and does not contain any codepage information.
The PDF document contains indexes to the glyphs in the font instead of to encoded characters.
While the document will be displayed correctly, the net effect of this is that searching, indexing, and cut-and-paste will not work properly.</p>
<p>One workaround for this behavior is to use the "-enc ansi" option when generating metrics with TTFReader.
This will cause the whole font to be embedded in the pdf document.
Characters will be WinAnsi encoded (as specified in the PDF spec), so you lose the ability to use characters from other character sets.
See <a href="#ttf-encoding">Table of TTF Encoding Options</a> for more details.</p>
</section>
<section id="embedding-base14">
<title>Explicitely embedding the base 14 fonts</title>
<p>
There are cases where you might want to force the embedding of one or more of the base 14 fonts that
can normally be considered available on the target platform (viewer, printer). One of these cases is
PDF/A which mandates the embedding of even the base 14 fonts. Embedding a font such as Helvetica or
Courier is straight-forward. The "Symbol" and "ZapfDingbats" fonts, however, currently present a
problem because FOP cannot correctly determine the encoding of these two single-byte fonts through
the PFM file. FOP now correctly interprets the "encoding" value in the XML font metrics file, but the
PFMReader application writes "UnknownEncoding" to the generated XML file. In order to embed "Symbol"
and "ZapfDingbats" you have to manually change the XML font metrics file and specify "SymbolEncoding"
or "ZapfdingbatsEncoding" encoding respectively as the value for the "encoding" element.
</p>
<p>Example:</p>
<source><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<font-metrics type="TYPE1">
<font-name>Symbol</font-name>
<embed/>
<encoding>SymbolEncoding</encoding>
<cap-height>673</cap-height>
<x-height>766</x-height>
[..]]]></source>
</section>
</section>
</body>
</document>

+ 0
- 338
src/documentation/content/xdocs/0.93/graphics.xml View File

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

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Apache FOP: Graphics Formats</title>
<version>$Revision$</version>
</header>
<body>
<section id="support-overview">
<title>Overview of Graphics Support</title>
<p>
The table below summarizes the <em>theoretical</em> support for graphical formats within FOP. In other words, within the constraints of the limitations listed here, these formats <em>should</em> work. However, many of them have not been tested, and there may be limitations that have not yet been discovered or documented. The packages needed to support some formats are not included in the FOP distribution and must be installed separately. Follow the links in the "Support Thru" column for more details.
</p>
<table>
<tr>
<th>Format</th>
<th>Type</th>
<th><a href="#native">FOP native support</a></th>
<th><a href="#batik">Batik SVG</a></th>
<th><a href="#batik-codecs">Batik codecs</a></th>
<th><a href="#imageio">Image I/O</a></th>
<th><a href="#jai">JAI</a></th>
<th><a href="#jimi">JIMI</a></th>
</tr>
<tr>
<td><a href="#bmp">BMP</a> (Microsoft Windows Bitmap)</td>
<td>bitmap</td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="#eps">EPS</a> (Encapsulated PostScript)</td>
<td>metafile (both bitmap and vector), probably most frequently used for vector drawings</td>
<td>(X)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>GIF (Graphics Interchange Format)</td>
<td>bitmap</td>
<td>X</td>
<td></td>
<td></td>
<td>X</td>
<td>X</td>
<td>X</td>
</tr>
<tr>
<td><a href="#jpeg">JPEG</a> (Joint Photographic Experts Group)</td>
<td>bitmap</td>
<td>(X)</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="#png">PNG</a> (Portable Network Graphic)</td>
<td>bitmap</td>
<td></td>
<td></td>
<td>X</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="#svg">SVG</a> (Scalable Vector Graphics)</td>
<td>vector (with embedded bitmaps)</td>
<td></td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td><a href="#tiff">TIFF</a> (Tag Image Format File)</td>
<td>bitmap</td>
<td>(X)</td>
<td></td>
<td>X</td>
<td></td>
<td>X</td>
<td></td>
<!--td><a href="#native">FOP native</a> or <a href="#jai">JAI</a>, depending on the subformat. See <a href="#tiff">TIFF</a> for more details.(JIMI also supports TIFF, but this has not been implemented within FOP).</td-->
</tr>
</table>
<note>"(X)" means restricted support. Please see the details below.</note>
</section>
<section id="packages">
<title>Graphics Packages</title>
<section id="native">
<title>FOP Native</title>
<p>
FOP has native ability to handle some graphic file formats.
</p>
</section>
<section id="batik-codecs">
<title>Batik codecs</title>
<p>
Apache Batik contains codecs for PNG and TIFF access. FOP can use these.
</p>
</section>
<section id="imageio">
<title>Image I/O (JDK 1.4 or higher)</title>
<p>
For JDKs 1.4 or higher, FOP provides a wrapper to load images through the
<a class="fork" href="http://java.sun.com/j2se/1.4.2/docs/guide/imageio/index.html">JDK's Image I/O API</a> (JSR 015).
Image I/O allows to dynamically add additional image codecs. An example of such an add-on library are the
<a class="fork" href="http://java.sun.com/products/java-media/jai/">JAI Image I/O Tools</a> available from Sun.
</p>
</section>
<section id="jimi">
<title>JIMI</title>
<p>
Because of licensing issues, the JIMI image library is not included in the FOP distribution. First, <a class="fork" href="http://java.sun.com/products/jimi">download</a> and install it.
Then, copy the file "JimiProClasses.zip" from the archive to {fop-install-dir}/lib/jimi-1.0.jar. Please note that FOP binary distributions are compiled with JIMI support, so there is no need for you to build FOP to add the support. If jimi-1.0.jar is installed in the right place, it will automatically be used by FOP, otherwise it will not.
</p>
</section>
<section id="jai">
<title>JAI (Java Advanced Imaging API)</title>
<warning>JAI support is available for Release 0.20.5 and later. The comments in this section do not apply to releases earlier than 0.20.5.</warning>
<p>
FOP has been compiled with JAI support, but JAI is not included in the FOP distribution.
To use it, install <a href="http://java.sun.com/products/java-media/jai">JAI</a>, then copy the jai_core.jar and the jai_codec.jar files to {fop-install-dir}/lib.
JAI is much faster than JIMI, but is not available for all platforms. See <a href="http://java.sun.com/products/java-media/jai/forDevelopers/jaifaq.html#platforms">What platforms are supported?</a> on the JAI FAQ page for more details.
</p>
</section>
<section id="batik">
<title>Batik</title>
<p>Current FOP distributions include a distribution of the Apache <a class="fork" href="ext:batik">Batik</a> version 1.6.
It is automatically installed with FOP.
Because Batik's API changes frequently, it is highly recommended that you use the version that ships with FOP, at least when running FOP.</p>
<warning>Batik must be run in a graphical environment.</warning>
<p>Batik must be run in a graphical environment.
It uses AWT classes for rendering SVG, which in turn require an X server on Unixish systems.
If you run a server without X, or if you can't connect to the X server due to security restrictions or policies (a so-called "headless" environment), SVG rendering will fail.</p>
<p>Here are some workarounds:</p>
<ul>
<li>If you are using JDK 1.4, start it with the <code>-Djava.awt.headless=true</code> command line option.</li>
<li>Install an X server which provides an in-memory framebuffer without actually using a screen device or any display hardware. One example is Xvfb.</li>
<li>Install a toolkit which emulates AWT without the need for an underlying X server. One example is the <a href="http://www.eteks.com/pja/en">PJA toolkit</a>, which is free and comes with detailed installation instructions.</li>
</ul>
</section>
</section>
<section id="bmp">
<title>BMP</title>
<p>FOP native support for BMP images is limited to the RGB color-space.</p>
</section>
<section id="eps">
<title>EPS</title>
<p>FOP provides support for two output targets:</p>
<ul>
<li>PostScript (full support).</li>
<li>
PDF (partial support). Due to the lack of a built-in PostScript interpreter, FOP
can only embed the EPS file into the PDF. Acrobat Reader will not currently display
the EPS (it doesn't have a PostScript interpreter, either) but it will be shown
correctly when you print the PDF on a PostScript-capable printer. PostScript devices
(including GhostScript) will render the EPS correctly.
</li>
</ul>
<p>
Other output targets can't be supported at the moment because
FOP lacks a PostScript interpreter. Furthermore, FOP is not able
to parse the preview bitmaps sometimes contained in EPS files.
</p>
</section>
<section id="jpeg">
<title>JPEG</title>
<p>FOP native support of JPEG does not include all variants, especially those containing unusual color lookup tables and color profiles.
If you have trouble with a JPEG image in FOP, try opening it with an image processing program (such as Photoshop or Gimp) and then saving it.
Specifying 24-bit color output may also help.
For the PDF and PostScript renderers most JPEG images can be passed through without decompression.
User reports indicate that grayscale, RGB, and CMYK color-spaces are all rendered properly.
</p>
</section>
<section id="png">
<title>PNG</title>
<p>If using JAI for PNG support, only RGB and RGBA color-spaces are supported for FOP rendering.</p>
</section>
<section id="svg">
<title>SVG</title>
<section id="svg-intro">
<title>Introduction</title>
<p>FOP uses <a href="#batik">Batik</a> for SVG support.
This format can be handled as an <code>fo:instream-foreign-object</code> or in a separate
file referenced with <code>fo:external-graphic</code>.</p>
<note>
Batik's SVG Rasterizer utility may also be used to convert standalone SVG
documents into PDF. For more information please see the
<a href="http://xml.apache.org/batik/svgrasterizer.html">SVG Rasterizer documentation</a>
on the Batik site.
</note>
</section>
<section id="svg-pdf-graphics">
<title>Placing SVG Graphics into PDF</title>
<p>
The SVG is rendered into PDF by using PDF commands to draw and fill
lines and curves. This means that the graphical objects created with
this remain as vector graphics.
</p>
<p>
There are a number of SVG things that cannot be converted directly into
PDF. Parts of the graphic such as effects, patterns and images are inserted
into the PDF as a raster graphic. The resolution of this graphic may not
be ideal depending on the FOP dpi (72dpi) and the scaling for that graphic.
We hope to improve this in the future.</p>
<p>
Currently transparency is not supported in PDF so many svg images that
contain effects or graphics with transparent areas will not be displayed
correctly.
</p>
</section>
<section id="svg-pdf-text">
<title>Placing SVG Text into PDF</title>
<p>If possible, Batik will use normal PDF text when inserting text. It does
this by checking if the text can be drawn normally and the font is
supported. This example svg <a href="../dev/svg/text.svg">text.svg</a> /
<!--link href="../dev/svg/text.pdf"-->text.pdf<!--/link-->
shows how various types and effects with text are handled.
Note that tspan and outlined text are not yet implemented.</p>
<p>
Otherwise, text is converted and drawn as a set of shapes by batik, using the stroking text painter.
This means that a typical character will
have about 10 curves (each curve consists of at least 20 characters).
This can make the pdf files large and when the pdf is viewed the
viewer does not normally draw those fine curves very well (turning on
Smooth Line Art in the Acrobat preferences will fix this).
If the text is inserted into the PDF using the inbuilt text commands
for PDF it will use a single character.
</p>
<p>Note that because SVG text can be rendered as either text or a vector graphic, you may need to consider settings in your viewer for both.
The Acrobat viewer has both "smooth line art" and "smooth text" settings that may need to be set for SVG images to be displayed nicely on your screen (see Edit / Preferences / Display).
This setting will not affect the printing of your document, which should be OK in any case, but will only affect the quality of the screen display.</p>
</section>
<section id="svg-scaling">
<title>Scaling</title>
<p>Currently, SVG images are rendered with the dimensions specified <em>in the SVG file</em>, within the viewport specified in the fo:external-graphic element.
For everything to work properly, the two should be equal.
The SVG standard leaves this issue as an implementation detail.
FOP will probably implement a scaling mechanism in the future.</p>
</section>
<section id="svg-problems">
<title>Known Problems</title>
<ul>
<li>
soft mask transparency is combined with white so that it looks better
on pdf 1.3 viewers but this causes the soft mask to be slightly lighter
or darker on pdf 1.4 viewers
</li>
<li>
there is some problem with a gradient inside a pattern causing a pdf
error when viewed in acrobat 5
</li>
<li>
text is not always handled correctly, it may select the wrong font
especially if characters have multiple fonts in the font list
</li>
<li>
more pdf text handling could be implemented
It could draw the string using the attributed character iterator
to handle tspans and other simple changes of text.
</li>
<li>
JPEG images are not inserted directly into the pdf document
This area has not been implemented yet since the appropriate
method in batik is static
</li>
<li>
Uniform transparency for images and other svg elements that are converted
into a raster graphic are not drawn properly in PDF. The image is opaque.
</li>
</ul>
</section>
</section>
<section id="tiff">
<title>TIFF</title>
<p>FOP-native TIFF support is limited to PDF and PostScript output only. Also, according to user reports, FOP's native support for TIFF is limited to images with the following characteristics (all must be true for successful rendering):</p>
<ul>
<li>single channel images (i.e., bi-level and grayscale only)</li>
<li>uncompressed images, or images using CCITT T.4, CCITT T.6, or JPEG compression</li>
<li>images using white-is-zero encoding in the TIFF PhotometricInterpretation tag</li>
</ul>
<p><em>JAI:</em> Supports RGB and RGBA only for FOP rendering.</p>
</section>
<section id="resolution">
<title>Graphics Resolution</title>
<p>Some bitmapped image file formats store a dots-per-inch (dpi) or other resolution value. Since PDF and most output formats do not have a concept of resolution, but only of absolute image units (i.e. pixels) FOP ignores the resolution values as well. Instead, FOP uses the dimensions of the image as specified in the fo:external-graphic element to render the image:</p>
<ul>
<li>If no dimensions are given, FOP uses a default value of 72 dpi to compute the graphic's dimensions. For example, suppose a graphic 300 pixels wide and 400 pixels high. FOP will render the graphic at 4.167 inches wide, 5.555 inches high, with an apparent resolution of 72 dpi.</li>
<li>If only one dimension is given, FOP by default uses the same aspect ratio to compute the other dimension (to avoid the appearance of stretching). For example, suppose a graphic 300 pixels wide and 400 pixels high, for which content-width = ".5in". FOP will compute the content-height = .667 inches, and will render the graphic at that size, with an apparent resolution of 600 dpi.</li>
<li>If both dimensions are given, FOP simply renders the image in that space. For example, suppose a graphic 300 pixels wide and 400 pixels high, for which content-width = "3in" and content-height = "4in". FOP will render the graphic at that size, with an apparent resolution of 100 dpi.</li>
</ul>
<p>If you need a higher apparent output resolution for bitmapped images, first make sure that at least one dimension of the image is defined in your XSL-FO input. Apart from that, resolution problems are in the image file itself, and must be corrected there: use or create a higher-resolution image file.</p>
<note>The explanation above describes only the basic default behavior. There are other attributes of the fo:external-graphic element that can affect the behavior described above.</note>
</section>
<section id="caching">
<title>Image caching</title>
<p>
FOP caches images between runs. The URL is used as a key to identify images which means that when
a particular URL appears again, the image is taken from the cache. If you have a servlet that
generates a different image each time it is called with the same URL you need to use a constantly
changing dummy parameter on the URL to avoid caching.
</p>
<p>
The image cache has been improved considerably in the redesigned code. Therefore, a resetCache() method
has become unnecessary. If you still experience OutOfMemoryErrors, please notify us.
</p>
</section>
</body>
</document>

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

@@ -20,7 +20,7 @@
<document>
<header>
<title>Apache FOP Version 0.94</title>
<version>$Revision: 201586 $</version>
<version>$Revision$</version>
</header>
<body>
<section id="intro">
@@ -32,7 +32,7 @@
</p>
<p>
This fifth release contains many bug fix release and new features compared
to 0.92beta. To see what has changed since the last release, please visit the
to 0.93. To see what has changed since the last release, please visit the
<a href="changes_0.94.html">Changes Page</a> and the <a href="releaseNotes_0.94.html">Release Notes</a>.
</p>
</section>

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

@@ -20,7 +20,7 @@
<document>
<header>
<title>PDF/A (ISO 19005)</title>
<version>$Revision: 389563 $</version>
<version>$Revision$</version>
<authors>
<person name="Jeremias Märki" email="jeremias@apache.org"/>
</authors>

src/documentation/content/xdocs/0.93/anttask.xml → src/documentation/content/xdocs/0.95/anttask.xml View File


src/documentation/content/xdocs/0.93/compiling.xml → src/documentation/content/xdocs/0.95/compiling.xml View File

@@ -59,7 +59,7 @@
<p>
The build script uses <a href="ext:ant">Apache Ant</a>, a popular
Java-based build tool, which usually requires that the environment variable JAVA_HOME point to
your local JDK root directory. This is true even if you use JDK 1.2 or above, which normally
your local JDK root directory. This is true even if you use JDK 1.3 or above, which normally
does not need this setting.
</p>
</section>
@@ -103,7 +103,8 @@
needed, but may be helpful if you are having problems with the build process itself.
</li>
<li>
<strong>javadocs</strong>: Generates javadocs. This creates the FOP API documentation.
<strong>javadocs</strong>: Creates the FOP API documentation.
<note>A minimum JDK version of 1.4.2 is required for generating the javadocs.</note>
</li>
</ul>
<p>To run the build:</p>

src/documentation/content/xdocs/0.93/configuration.xml → src/documentation/content/xdocs/0.95/configuration.xml View File

@@ -64,19 +64,21 @@
<tr>
<th>Element</th>
<th>Data Type (for the value)</th>
<th>Description</th>
<th>Default Value</th>
</tr>
<tr>
<td>base</td>
<td>URL or directory</td>
<td>Specifies the base URL based on which relative URL will be resolved.</td>
<td>current directory</td>
</tr>
<tr>
<td>font-base</td>
<td>URL or directory</td>
<td>Specifies the base URL based on which relative font URLs will be resolved.
If not specified defaults to the base URL above.
</td>
<td>base URL/directory (above)</td>
</tr>
<tr>
<td>hyphenation-base</td>
@@ -85,6 +87,7 @@
files will be resolved. If not specified, support for user-supplied hyphenation
patterns remains disabled.
</td>
<td>disabled</td>
</tr>
<tr>
<td>source-resolution</td>
@@ -93,6 +96,7 @@
Resolution in dpi (dots per inch) which is used internally to determine the pixel
size for SVG images and bitmap images without resolution information.
</td>
<td>72 dpi</td>
</tr>
<tr>
<td>target-resolution</td>
@@ -102,6 +106,17 @@
images generated by bitmap renderers (such as the TIFF renderer) and by bitmaps
generated by Apache Batik for filter effects and such.
</td>
<td>72 dpi</td>
</tr>
<tr>
<td>strict-configuration</td>
<td>Boolean (true, false)</td>
<td>
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.</td>
<td>false</td>
</tr>
<tr>
<td>strict-validation</td>
@@ -111,6 +126,7 @@
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.</td>
<td>true</td>
</tr>
<tr>
<td>break-indent-inheritance</td>
@@ -124,6 +140,7 @@
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.</td>
<td>false</td>
</tr>
<tr>
<td>default-page-settings</td>
@@ -132,11 +149,31 @@
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.</td>
<td>"height" 11 inches, "width" 8.26 inches</td>
</tr>
<tr>
<td>use-cache</td>
<td>boolean (true, false)</td>
<td>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.</td>
<td>true</td>
</tr>
<tr>
<td>cache-file</td>
<td>String</td>
<td>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.</td>
<td>${base}/conf/fop.cache</td>
</tr>
<tr>
<td>renderers</td>
<td>(see text below)</td>
<td>Contains the configuration for each renderer. See below.</td>
<td>N/A</td>
</tr>
</table>
<p>
@@ -145,6 +182,12 @@
<source><![CDATA[
<fop version="1.0">

<!-- Strict user configuration -->
<strict-configuration>true</strict-configuration>

<!-- Strict FO validation -->
<strict-validation>true</strict-validation>

<!-- Base URL for resolving relative URLs -->
<base>./</base>

@@ -234,7 +277,23 @@
<output-profile>C:\FOP\Color\EuropeISOCoatedFOGRA27.icc</output-profile>
<fonts....
</renderer>]]></source>
</renderer>]]></source>
<p>
Some people don't have high requirements on color fidelity but instead want the smallest
PDF file sizes possible. In this case it's possible to disable the default sRGB color space
which XSL-FO requires. This will cause RGB colors to be generated as device-specific RGB.
Please note that this option is unavailable (and will cause an error) if you enable
PDF/A or PDF/X functionality or if you specify an output profile. This setting will make the
PDF about 4KB smaller. To disable the sRGB color space add the following setting:
</p>
<source><![CDATA[
<renderer mime="application/pdf">
<filterList...
<disable-srgb-colorspace>true</disable-srgb-colorspace>
<fonts....
</renderer>]]></source>
</section>
<section id="ps-renderer">
<title>Special Settings for the PostScript Renderer</title>
@@ -268,7 +327,7 @@
offered by Java.
</p>
<p>
Additionally, there are certain settings that control who the renderer handles various elements.
Additionally, there are certain settings that control how the renderer handles various elements.
</p>
<source><![CDATA[<renderer mime="application/vnd.hp-PCL">
<rendering>quality</rendering>
@@ -290,10 +349,10 @@
</section>
</section>

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

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

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

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

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

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

</ul>
</ul>

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


src/documentation/content/xdocs/0.93/embedding.xml → src/documentation/content/xdocs/0.95/embedding.xml View File

@@ -166,7 +166,7 @@ try {
<title>Logging</title>
<p>
Logging is now a little different than it was in FOP 0.20.5. We've switched from
Avalon Logging to <a href="ext:jakarta/commons/logging">Jakarta Commons Logging</a>.
Avalon Logging to <a href="ext:commons-logging">Jakarta Commons Logging</a>.
While with Avalon Logging the loggers were directly given to FOP, FOP now retrieves
its logger(s) through a statically available LogFactory. This is similar to the
general pattern that you use when you work with Apache Log4J directly, for example.
@@ -187,10 +187,10 @@ try {
which documents what we're going to build.
</note>
<p>
By default, <a href="ext:jakarta/commons/logging">Jakarta Commons Logging</a> uses
By default, <a href="ext:commons-logging">Jakarta Commons Logging</a> uses
JDK logging (available in JDKs 1.4 or higher) as its backend. You can configure Commons
Logging to use an alternative backend, for example Log4J. Please consult the
<a href="ext:jakarta/commons/logging">documentation for Jakarta Commons Logging</a> on
<a href="ext:commons-logging">documentation for Jakarta Commons Logging</a> on
how to configure alternative backends.
</p>
</section>
@@ -291,6 +291,13 @@ try {
</p>
<source>fopFactory.setFontBaseURL("file:///C:/Temp/fonts");</source>
</li>
<li>
<p>
The <strong>hyphenation base URL</strong> to use when resolving relative URLs for
hyphenation patterns. Example:
</p>
<source>fopFactory.setHyphenBaseURL("file:///C:/Temp/hyph");</source>
</li>
<li>
<p>
Disable <strong>strict validation</strong>. When disabled FOP is less strict about the rules

+ 234
- 0
src/documentation/content/xdocs/0.95/extensions.xml View File

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

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

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


+ 418
- 0
src/documentation/content/xdocs/0.95/fonts.xml View File

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

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Apache FOP: Fonts</title>
<version>$Revision$</version>
<authors>
<person name="Jeremias Märki" email=""/>
<person name="Tore Engvig" email=""/>
<person name="Adrian Cumiskey" email=""/>
<person name="Max Berger" email=""/>
</authors>
</header>
<body>
<section id="intro">
<title>Summary</title>
<p>The following table summarizes the font capabilities of the various FOP renderers:</p>
<table>
<tr>
<th>Renderer</th>
<th>Base-14</th>
<th>AWT/OS</th>
<th>Custom</th>
<th>Custom Embedding</th>
</tr>
<tr>
<td>PDF</td>
<td>yes</td>
<td>no</td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td>PostScript</td>
<td>yes</td>
<td>no</td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td>PCL</td>
<td>yes (modified)</td>
<td>yes (painted as bitmaps)</td>
<td>yes (painted as bitmaps)</td>
<td>no</td>
</tr>
<tr>
<td>AFP</td>
<td>no</td>
<td>no</td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td>Java2D/AWT/Bitmap</td>
<td>if available from OS</td>
<td>yes</td>
<td>yes</td>
<td>n/a (display only)</td>
</tr>
<tr>
<td>Print</td>
<td>if available from OS</td>
<td>yes</td>
<td>yes</td>
<td>controlled by OS printer driver</td>
</tr>
<tr>
<td>RTF</td>
<td>n/a (font metrics not needed)</td>
<td>n/a</td>
<td>n/a</td>
<td>n/a</td>
</tr>
<tr>
<td>TXT</td>
<td>yes (used for layout but not for output)</td>
<td>no</td>
<td>yes (used for layout but not for output)</td>
<td>no</td>
</tr>
<!--tr> NOT AVAILABLE
<td>MIF</td>
<td>n/a (font metrics not needed)</td>
<td>n/a</td>
<td>n/a</td>
<td>n/a</td>
</tr-->
<!--tr> NOT AVAILABLE
<td>SVG</td>
<td>if available from OS</td>
<td>yes</td>
<td>no</td>
<td>no</td>
</tr-->
<tr>
<td>XML</td>
<td>yes</td>
<td>no</td>
<td>yes</td>
<td>n/a</td>
</tr>
</table>
</section>
<section>
<title>Base-14 Fonts</title>
<p>
The Adobe PostScript and PDF Specification specify a set of 14 fonts that must be
available to every PostScript interpreter and PDF reader:
Helvetica (normal, bold, italic, bold italic),
Times (normal, bold, italic, bold italic),
Courier (normal, bold, italic, bold italic),
Symbol and ZapfDingbats.
</p>
<p>
Please note that recent versions of Adobe Acrobat Reader replace
"Helvetica" with "Arial" and "Times" with "Times New Roman" internally.
GhostScript replaces "Helvetica" with "Nimbus Sans L" and "Times" with
"Nimbus Roman No9 L". Other document viewers may do similar font
substitutions. If you need to make sure that there are no such
substitutions, you need to specify an explicit font and embed it in
the target document.
</p>
</section>
<section>
<title>Missing Fonts</title>
<p>
When FOP does not have a specific font at its disposal (because it's
not installed in the operating system or set up in FOP's configuration),
the font is replaced with "any". "any" is internally mapped to the
Base-14 font "Times" (see above).
</p>
</section>
<section id="awt">
<title>Java2D/AWT/Operating System Fonts</title>
<p>
The Java2D family of renderers (Java2D, AWT, Print, TIFF, PNG), use the
Java AWT subsystem for font metric information. Through operating system
registration, the AWT subsystem knows what fonts are available on the system,
and the font metrics for each one.
</p>
<p>
When working with one of these output formats and you're missing a font, just
install it in your operating system and they should be available for these
renderers. Please note that this is not true for other output formats such as
PDF or PostScript.
</p>
</section>
<section id="custom">
<title>Custom Fonts</title>
<p>
Support for custom fonts is highly output format dependent (see above table).
This section shows how to add Type 1 and TrueType fonts to the PDF, PostScript and
Java2D-based renderers. Other renderers (like AFP) support other font formats. Details
in this case can be found on the page about <a href="output.html">output formats</a>.
</p>
<p>
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.
</p>
<p>
Basic information about fonts can be found at:
</p>
<ul>
<li><a href="http://partners.adobe.com/asn/developer/type/ftypes.html">Adobe font types</a></li>
<li><a href="http://partners.adobe.com/asn/developer/technotes/fonts.html">Adobe Font Technote</a></li>
</ul>
</section>
<section id="basics">
<title>Basic font configuration</title>
<p>
If you want FOP to use custom fonts, you need to tell it where to find them. This
is done in the configuration file and once per renderer (because each output format
is a little different). In the basic form, you can either tell FOP to find your
operating system fonts or you can specify directories that it will search for
support fonts. These fonts will then automatically be registered.
</p>
<source><![CDATA[
<fonts>
<!-- register all the fonts found in a directory -->
<directory>C:\MyFonts1</directory>
<!-- register all the fonts found in a directory
and all of its sub directories (use with care) -->
<directory recursive="true">C:\MyFonts2</directory>

<!-- automatically detect operating system installed fonts -->
<auto-detect/>
</fonts>]]></source>
<note>
Review the documentation for <a href="configuration.html">FOP Configuration</a>
for instructions on making the FOP configuration available to FOP when it runs.
Otherwise, FOP has no way of finding your custom font information. It is currently
not possible to easily configure fonts from Java code.
</note>
</section>
<section id="advanced">
<title>Advanced font configuration</title>
<p>
The instructions found above should be sufficient for most users. Below are some
additional instructions in case the basic font configuration doesn't lead to
the desired results.
</p>
<section id="type1-metrics">
<title>Type 1 Font Metrics</title>
<p>FOP includes PFMReader, which reads the PFM file that normally comes with a Type 1 font, and generates an appropriate font metrics file for it.
To use it, run the class org.apache.fop.fonts.apps.PFMReader:</p>
<p>Windows (on JDK 1.4 and later):</p>
<source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
<p>Windows (on JDK 1.3.x):</p>
<source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar;lib\xml-apis.jar;
lib\xercesImpl.jar;lib\xalan.jar;lib\serializer.jar
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
<p>Unix (on JDK 1.4 and later):</p>
<source>java -cp build/fop.jar:lib/avalon-framework.jar:lib/commons-logging.jar:lib/commons-io.jar
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
<p>Unix (on JDK 1.3.1):</p>
<source>java -cp build/fop.jar:lib/avalon-framework.jar:lib/commons-logging.jar:lib/commons-io.jar:lib/xml-apis.jar:
lib/xercesImpl.jar:lib/xalan.jar:lib/serializer.jar
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
<p>PFMReader [options]:</p>
<ul>
<li><strong>-fn &lt;fontname&gt;</strong> By default, FOP uses the fontname from the
.pfm file when embedding the font. Use the "-fn" option to override this name with one you have
chosen. This may be useful in some cases to ensure that applications using the output document
(Acrobat Reader for example) use the embedded font instead of a local font with the same
name.</li>
</ul>
<note>The classpath in the above example has been simplified for readability.
You will have to adjust the classpath to the names of the actual JAR files in the lib directory.
xml-apis.jar, xercesImpl.jar, xalan.jar and serializer.jar are not necessary for JDK version 1.4 or later.</note>
<note>The tool will construct some values (FontBBox, StemV and ItalicAngle) based on assumptions and calculations which are only an approximation to the real values.
FontBBox and Italic Angle can be found in the human-readable part of the PFB file or in the AFM file.
The PFMReader tool does not yet interpret PFB or AFM files, so if you want to be correct, you may have to adjust the values in the XML file manually.
The constructed values however appear to have no visible influence.</note>
</section>
<section id="truetype-metrics">
<title>TrueType Font Metrics</title>
<p>FOP includes TTFReader, which reads the TTF file and generates an appropriate font metrics file for it.
Use it in a similar manner to PFMReader.
For example, to create such a metrics file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:</p>
<source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
org.apache.fop.fonts.apps.TTFReader [options]
C:\myfonts\cmr10.ttf ttfcm.xml</source>
<p>TTFReader [options]:</p>
<ul>
<li><strong>-d &lt;DEBUG | INFO &gt;</strong> Sets the debug level (default is
INFO).</li>
<li><strong>-fn &lt;fontname&gt;</strong> Same as for PFMReader.</li>
<li><strong>-ttcname &lt;fontname&gt;</strong> If you're reading data from a
TrueType Collection (.ttc file) you must specify which font from the collection you will read
metrics from.
If you read from a .ttc file without this option, the fontnames will be listed for you.</li>
<li><strong>-enc ansi</strong> Creates a WinAnsi-encoded font metrics file.
Without this option, a CID-keyed font metrics file is created.
The table below summarizes the differences between these two encoding options as currently
used within FOP.
Please note that this information only applies to TrueType fonts and TrueType collections:</li>
</ul>
<table id="ttf-encoding">
<tr>
<th>Issue</th>
<th>WinAnsi</th>
<th>CID-keyed</th>
</tr>
<tr>
<td>Usable Character Set</td>
<td>Limited to WinAnsi character set, which is roughly equivalent to iso-8889-1.</td>
<td>Limited only by the characters in the font itself.</td>
</tr>
<tr>
<td>Embedding the Font</td>
<td>Optional.</td>
<td>Mandatory. Not embedding the font produces invalid PDF documents.</td>
</tr>
</table>
<warning>
You may experience failures with certain TrueType fonts, especially if they don't contain
the so-called Unicode "cmap" table. TTFReader can currently not deal with font like this.
</warning>
</section>
<section id="truetype-collections-metrics">
<title>TrueType Collections Font Metrics</title>
<p>TrueType collections (.ttc files) contain more than one font.
To create metrics files for these fonts, you must specify which font in the collection should be generated, by using the "-ttcname" option with the TTFReader.</p>
<p>To get a list of the fonts in a collection, just start the TTFReader as if it were a normal TrueType file (without the -ttcname option).
It will display all of the font names and exit with an Exception.</p>
<p>Here is an example of generating a metrics file for a .ttc file:</p>
<source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho"
msmincho.ttc msminch.xml</source>
</section>
<section id="register">
<title>Register Fonts with FOP</title>
<p>You must tell FOP how to find and use the font metrics files by registering them in the <a href="configuration.html">FOP Configuration</a>. Add entries for your custom fonts, regardless of font type, to the configuration file in a manner similar to the following:</p>
<source><![CDATA[
<fonts>
<!-- register a particular font -->
<font metrics-url="file:///C:/myfonts/FTL_____.xml" kerning="yes"
embed-url="file:///C:/myfonts/FTL_____.pfb">
<font-triplet name="FrutigerLight" style="normal" weight="normal"/>
</font>
<!-- register all the fonts found in a directory -->
<directory>C:\MyFonts1</directory>
<!-- register all the fonts found in a directory
and all of its sub directories (use with care) -->
<directory recursive="true">C:\MyFonts2</directory>

<!-- automatically detect operating system installed fonts -->
<auto-detect/>
</fonts>]]></source>
<ul>
<li>
URLs are used to access the font metric and font files.
Relative URLs are resolved relative to the font-base property (or base) if available.
See <a href="configuration.html">FOP: Configuration</a> for more information.
</li>
<li>The "metrics-url" attribute is generally not necessary except if you run into problems with certain fonts.</li>
<li>Either an "embed-url" or a "metrics-url" must be specified for font tag configurations.</li>
<li>The font "kerning" attribute is optional. Default is "true".</li>
<li>If embedding is off (i.e. embed-url is not set), the output will position the text correctly (from the metrics file), but it will not be displayed or printed correctly unless the viewer has the applicable font available to their local system.</li>
<li>When setting the "embed-url" attribute for Type 1 fonts, be sure to specify the PFB (actual font data), not PFM (font metrics) file that you used to generate the XML font metrics file.</li>
<li>The fonts "directory" tag can be used to register fonts contained within a single or list of directory paths. The "recursive" attribute can be specified to recursively add fonts from all sub directories.</li>
<li>The fonts "auto-detect" tag can be used to automatically register fonts that are found to be installed on the native operating system.</li>
<li>Fonts registered with "font" tag configurations override fonts found by means of "directory" tag definitions.</li>
<li>Fonts found as a result of a "directory" tag configuration override fonts found as a result of the "auto-detect" tag being specified.</li>
<li>
If relative URLs are specified, they are evaluated relative to the value of the
"font-base" setting. If there is no "font-base" setting, the fonts are evaluated
relative to the base directory.
</li>
</ul>
<!--note>Cocoon users will need to setup the config, see FOPSerializer for more information.</note-->
</section>
<section id="autodetect">
<title>Auto-Detect and auto-embedd feature</title>
<p>When the "auto-detect" flag is set in the configuration, FOP will automatically search for fonts in the default paths for your operating system.</p>
<p>FOP will also auto-detect fonts which are available in the classpath, if they are described as "application/x-font" in the MANIFEST.MF file. For example, if your .jar file contains font/myfont.ttf:</p>
<source>Manifest-Version: 1.0
Name: font/myfont.ttf
Content-Type: application/x-font</source>
<p>This feature allows you to create JAR files containing fonts. The JAR files can be added to fop by providem them in the classpath, e.g. copying them into the lib/ directory.</p>
</section>
<section id="embedding">
<title>Embedding</title>
<note>The PostScript renderer does not yet support TrueType fonts, but can embed Type 1 fonts.</note>
<note>The font is simply embedded into the PDF file, it is not converted.</note>
<p>Font embedding is enabled in the userconfig.xml file and controlled by the embed-url attribute.
If you don't specify the embed-url attribute the font will not be embedded, but will only be referenced.</p>
<warning>
Omitting the embed-url attribute for CID-encoded TrueType fonts will currently produce invalid
PDF files! If you create the XML font metric file using the "-enc ansi" option, you can omit
the embed-url attribute for TrueType fonts but you're restricted to the WinAnsi character set.
</warning>
<p>When FOP embeds a font, it adds a prefix to the fontname to ensure that the name will not match the fontname of an installed font.
This is helpful with older versions of Acrobat Reader that preferred installed fonts over embedded fonts.</p>
<p>When embedding PostScript fonts, the entire font is always embedded.</p>
<p>When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a subset of the
original font, containing only the glyphs used, is embedded in the output document.</p>
</section>
<!-- The following section should no longer be required
<section id="embedding-base14">
<title>Explicitly embedding the base 14 fonts</title>
<p>
There are cases where you might want to force the embedding of one or more of the base 14 fonts that
can normally be considered available on the target platform (viewer, printer). One of these cases is
<a href="pdfa.html">PDF/A</a> which mandates the embedding of even the base 14 fonts. Embedding a font such as Helvetica or
Courier is straight-forward. The "Symbol" and "ZapfDingbats" fonts, however, currently present a
problem because FOP cannot correctly determine the encoding of these two single-byte fonts through
the PFM file. FOP now correctly interprets the "encoding" value in the XML font metrics file, but the
PFMReader application writes "UnknownEncoding" to the generated XML file. In order to embed "Symbol"
and "ZapfDingbats" you have to manually change the XML font metrics file and specify "SymbolEncoding"
or "ZapfdingbatsEncoding" encoding respectively as the value for the "encoding" element.
</p>
<p>Example:</p>
<source><![CDATA[
<?xml version="1.0" encoding="UTF-8"?>
<font-metrics type="TYPE1">
<font-name>Symbol</font-name>
<embed/>
<encoding>SymbolEncoding</encoding>
<cap-height>673</cap-height>
<x-height>766</x-height>
[..]]]></source>
</section-->
</section>
</body>
</document>

src/documentation/content/xdocs/0.93/fotree/disabled-testcases.xml → src/documentation/content/xdocs/0.95/fotree/disabled-testcases.xml View File

@@ -17,11 +17,6 @@
-->
<!-- $Id$ -->
<disabled-testcases>
<testcase>
<name>demo test failure</name>
<file>demo-test-failure.fo</file>
<description></description>
</testcase>
<testcase>
<name>Markers and core function evaluation</name>
<file>from-table-column_marker.fo</file>

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

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

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

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

src/documentation/content/xdocs/0.93/hyphenation.xml → src/documentation/content/xdocs/0.95/hyphenation.xml View File


src/documentation/content/xdocs/0.93/index.xml → src/documentation/content/xdocs/0.95/index.xml View File

@@ -19,22 +19,22 @@
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">
<document>
<header>
<title>Apache FOP Version 0.93</title>
<version>$Revision: 201586 $</version>
<title>Apache FOP Version 0.95</title>
<version>$Revision$</version>
</header>
<body>
<section id="intro">
<title>Introduction</title>
<p>
The Apache FOP team is proud to present to you this production quality release. It has taken
over three years to get this far and over two years without a new release from the FOP
project. We're still in the process of adding new features. We welcome any feedback you
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.
</p>
<p>
This fourth release contains many bug fix release and new features compared
to 0.92beta. To see what has changed since the last release, please visit the
<a href="changes_0.93.html">Changes Page</a> and the <a href="releaseNotes_0.93.html">Release Notes</a>.
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
<a href="changes_0.95.html">Changes Page</a> and the
<a href="releaseNotes_0.95.html">Release Notes</a>.
</p>
</section>
<section id="upgrading">

src/documentation/content/xdocs/0.93/intermediate.xml → src/documentation/content/xdocs/0.95/intermediate.xml View File


src/documentation/content/xdocs/0.93/known-issues.xml → src/documentation/content/xdocs/0.95/known-issues.xml View File

@@ -20,17 +20,9 @@
<known-issue>
MIF and SVG output support have not been restored, yet.
</known-issue>
<known-issue>
Java2D/AWT support has been improved, but some problems remain,
for example with block-containers.
</known-issue>
<known-issue>
Auto table layout is not implemented, yet.
</known-issue>
<known-issue>
The collapsing border model on tables is not implemented, yet. Please
use border-collapse="separate" for now.
</known-issue>
<known-issue>
Footnotes may overlap with text of the region-body in multi-column
documents.
@@ -56,22 +48,9 @@
<known-issue>
There are several small problems around white space handling.
</known-issue>
<known-issue>
Images currently don't shrink so they fit on a page when they are
too big and shrinking is allowed to happen.
</known-issue>
<known-issue>
inline-container may not work as expected.
</known-issue>
<known-issue>
letter-spacing and word-spacing properties may not work as expected.
</known-issue>
<known-issue>
leaders with leader-pattern="use-content" may not work as expected.
</known-issue>
<known-issue>
keep-with-previous doesn't work inside tables and lists, yet.
</known-issue>
<known-issue>
If two consecutive pages don't have the same available width, the
content currently isn't properly fit into the available space on
@@ -88,15 +67,8 @@
The backgrounds of table-body, table-header, table-footer and
table-column are not painted, yet.
</known-issue>
<known-issue>
Border and padding conditionality are not supported on table-cells, yet.
</known-issue>
<known-issue>
Column balancing in multi-column documents may not work as expected
(<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=36356">Bugzilla #36356</a>)
</known-issue>
<known-issue>
Internal basic-links don't point to the exact location on a page, yet, as they
did in 0.20.5. Currently you land in the upper left corner of the page.
</known-issue>
</known-issues>

src/documentation/content/xdocs/0.93/knownissues_overview.xml → src/documentation/content/xdocs/0.95/knownissues_overview.xml View File

@@ -46,25 +46,23 @@
<section>
<title>FO Tree</title>
<p>
This section lists currently disabled test cases in the test suite for the FO tree tests.
The data for this section comes from
<a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/test/fotree/disabled-testcases.xml">test/fotree/disabled-testcases.xml</a>.
This section lists disabled test cases in the test suite for the FO tree tests, at the time
of the release.
</p>
<xi:include href="cocoon://knownissues-raw-fotree_0.93.xml#xpointer(/document/body/*)"/>
<xi:include href="cocoon://knownissues-raw-fotree_0.95.xml#xpointer(/document/body/*)"/>
</section>
<section>
<title>Layout Engine</title>
<p>
This section lists currently disabled test cases in the test suite for the layout engine tests.
The data for this section comes from
<a href="http://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/test/layoutengine/disabled-testcases.xml">test/layoutengine/disabled-testcases.xml</a>.
This section lists disabled test cases in the test suite for the layout engine tests, at the
time of the release.
</p>
<xi:include href="cocoon://knownissues-raw-layoutengine_0.93.xml#xpointer(/document/body/*)"/>
<xi:include href="cocoon://knownissues-raw-layoutengine_0.95.xml#xpointer(/document/body/*)"/>
</section>
<section>
<title>Other known issues</title>
<p>This section lists other known issues.</p>
<xi:include href="cocoon://knownissues-raw-static_0.93.xml#xpointer(/document/body/*)"/>
<xi:include href="cocoon://knownissues-raw-static_0.95.xml#xpointer(/document/body/*)"/>
</section>
</section>
</body>

src/documentation/content/xdocs/0.93/layoutengine/disabled-testcases.xml → src/documentation/content/xdocs/0.95/layoutengine/disabled-testcases.xml View File

@@ -26,13 +26,6 @@
is not sized correctly if it wraps an image that is higher than the
nominal line.</description>
</testcase>
<testcase>
<name>Bugzilla #36391: reference-orientation</name>
<file>block-container_reference-orientation_bug36391.xml</file>
<description>There's a problem involving nested block-containers
and reference-orientation 180/-180.</description>
<reference>http://issues.apache.org/bugzilla/show_bug.cgi?id=36391</reference>
</testcase>
<testcase>
<name>Auto-height block-containers produce fences</name>
<file>block-container_space-before_space-after_3.xml</file>
@@ -48,8 +41,8 @@
<testcase>
<name>Hyphenation with preserved linefeeds</name>
<file>block_hyphenation_linefeed_preserve.xml</file>
<description>When hyphenation is enabled and linefeeds are preserved linefeeds
are painted as '#' and the text is output multiple times.</description>
<description>When hyphenation is enabled and linefeeds are preserved,
the text is output multiple times.</description>
</testcase>
<testcase>
<name>linefeed-treatment</name>
@@ -104,12 +97,6 @@
<description>Space resolution does not work between footnote
regions.</description>
</testcase>
<testcase>
<name>Footnotes swallowed in hyphenated fo:inlines</name>
<file>footnote_in_inline.xml</file>
<description>getChangedKnuthElements probably loses the footnote
layout manager somewhere along the way.</description>
</testcase>
<testcase>
<name>Footnotes swallowed in lists</name>
<file>footnote_in_list.xml</file>
@@ -128,11 +115,6 @@
element list.</description>
<reference>http://issues.apache.org/bugzilla/show_bug.cgi?id=37579</reference>
</testcase>
<testcase>
<name>keeps on inlines NYI</name>
<file>inline_keep-together.xml</file>
<description>Keeps are not implemented in inline-level elements, yet.</description>
</testcase>
<testcase>
<name>NPE for table inside an inline</name>
<file>inline_block_nested_3.xml</file>
@@ -312,17 +294,15 @@
case should be revisited.</description>
</testcase>
<testcase>
<name>fo:wrapper around block-level content</name>
<file>wrapper_block.xml</file>
<description>A ClassCastException occurs when fo:wrapper directly surrounds a
block-level element because its layout manager is written to handle only
inline content.</description>
<name>fo:wrapper around block-level content (with id)</name>
<file>wrapper_block_id.xml</file>
<description>"id" attributes on fo:wrapper around block-level content don't get
added to the area tree.</description>
</testcase>
<testcase>
<name>Bugzilla #40230: invalid extra page break</name>
<file>block_break-after_bug40230.xml</file>
<description>Currently an extra page is created even if there is nothing
after a block with break-after="page"</description>
<reference>http://issues.apache.org/bugzilla/show_bug.cgi?id=40230</reference>
<name>Soft hyphen with normal hyphenation enabled</name>
<file>block_shy_linebreaking_hyph.xml</file>
<description>A soft hyphen should be a preferred as break compared to a
normal hyphenation point but is not.</description>
</testcase>
</disabled-testcases>

src/documentation/content/xdocs/0.93/output.xml → src/documentation/content/xdocs/0.95/output.xml View File

@@ -48,6 +48,35 @@
The net effect is that the layout of a given FO document can be quite different between
renderers that do not use the same font information.
</p>
<p>
Theoretically, there's some potential to make the output of the PDF/PS renderers match
the output of the Java2D-based renderers. If FOP used the font metrics from its own
font subsystem but still used Java2D for text painting in the Java2D-based renderers,
this could probably be achieved. However, this approach hasn't been implemented, yet.
</p>
<p>
With a work-around, it is possible to match the PDF/PS output in a Java2D-based
renderer pretty closely. The clue is to use the
<a href="intermediate.html">intermediate format</a>. The trick is to layout the
document using FOP's own font subsystem but then render the document using Java2D.
Here are the necessary steps (using the command-line):
</p>
<ol>
<li>
Produce an IF file: <code>fop -fo myfile.fo -at application/pdf myfile.at.xml</code><br/>
Specifying "application/pdf" for the "-at" parameter causes FOP to use FOP's own
font subsystem (which is used by the PDF renderer). Note that no PDF file is created
in this step.
</li>
<li>Render to a PDF file: <code>fop -atin myfile.at.xml -pdf myfile.pdf</code></li>
<li>Render to a Java2D-based renderer:
<ul>
<li><code>fop -atin myfile.at.xml -print</code></li>
<li><code>fop -atin myfile.at.xml -awt</code></li>
<li><code>fop -atin myfile.at.xml -tiff myfile.tiff</code></li>
</ul>
</li>
</ol>
</section>
<section id="general-direct-output">
<title>Output to a Printer or Other Device</title>
@@ -105,7 +134,7 @@ out = proc.getOutputStream();]]></source>
<section id="pdf-postprocess">
<title>Post-processing</title>
<p>
FOP does not currently support several desirable PDF features: XMP metadata and watermarks.
FOP does not currently support several desirable PDF features: watermarks and signatures.
One workaround is to use Adobe Acrobat (the full version, not the Reader) to process
the file manually or with scripting that it supports.
</p>
@@ -199,8 +228,54 @@ out = proc.getOutputStream();]]></source>
support for most text and layout.
Images and SVG are not fully supported, yet. Currently, the PostScript
renderer generates PostScript Level 3 with most DSC comments. Actually,
the only Level 3 feature used is FlateDecode, everything else is Level 2.
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.
</p>
<section id="ps-configuration">
<title>Configuration</title>
<p>
The PostScript renderer configuration currently allows the following settings:
</p>
<source><![CDATA[<renderer mime="application/postscript">
<auto-rotate-landscape>false</auto-rotate-landscape>
<language-level>3</language-level>
<optimize-resources>false</optimize-resources>
<safe-set-page-device>false</safe-set-page-device>
<dsc-compliant>true</dsc-compliant>
</renderer>]]></source>
<p>
The default value for the "auto-rotate-landscape" setting is "false". Setting it
to "true" will automatically rotate landscape pages and will mark them as landscape.
</p>
<p>
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.
</p>
<p>
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.
</p>
<p>
The default value for the "safe-set-page-device" setting is "false". Setting it
to "true" will cause the renderer to invoke a postscript macro which guards against
the possibility of invalid/unsupported postscript key/values being issued to the
implementing postscript page device.
</p>
<p>
The default value for the "dsc-compliant" setting is "true". Setting it
to "false" will break DSC compliance by minimizing the number of setpagedevice
calls in the postscript document output. This feature may be useful when unwanted
blank pages are experienced in your postscript output. This problem is caused by
the particular postscript implementation issuing unwanted postscript subsystem
initgraphics/erasepage calls on each setpagedevice call.
</p>
</section>
<section id="ps-limitations">
<title>Limitations</title>
<ul>
@@ -283,6 +358,7 @@ out = proc.getOutputStream();]]></source>
<source><![CDATA[<renderer mime="application/vnd.hp-PCL">
<rendering>quality</rendering>
<text-rendering>bitmap</text-rendering>
<disable-pjl>false</disable-pjl>
</renderer>]]></source>
<p>
The default value for the "rendering" setting is "speed" which causes borders
@@ -297,6 +373,12 @@ out = proc.getOutputStream();]]></source>
If the mix of painting methods results in unwelcome output, you can set this
to "bitmap" which causes all text to be rendered as bitmaps.
</p>
<p>
The default value for the "disable-pjl" setting is "false". This means that
the PCL renderer usually generates PJL commands before and after the document
in order to switch a printer into PCL language. PJL commands can be disabled
if you set this value to "true".
</p>
<p>
You can control the output resolution for the PCL using the "target resolution"
setting on the FOUserAgent. The actual value will be rounded up to the next
@@ -498,6 +580,13 @@ out = proc.getOutputStream();]]></source>
<font-triplet name="Courier" style="normal" weight="bold"/>
</font>]]></source>
</section>
<section id="afp-renderer-resolution-config">
<title>Output Resolution</title>
<p>By default the AFP Renderer creates output with a resolution of 240 dpi.
This can be overridden by the &lt;renderer-resolution/&gt; configuration element. Example:</p>
<source><![CDATA[
<renderer-resolution>240</renderer-resolution>]]></source>
</section>
<section id="afp-image-config">
<title>Images</title>
<p>By default the AFP Renderer converts all images to 8 bit grey level.
@@ -560,8 +649,7 @@ out = proc.getOutputStream();]]></source>
</section>
<section id="afp-tag-logical-element">
<title>Tag Logical Element Extension</title>
<p>The tag-logical-element extension element allows to injects TLEs into the AFP output stream. Example:
Example:</p>
<p>The tag-logical-element extension element allows to injects TLEs into the AFP output stream. Example:</p>
<source><![CDATA[
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
@@ -577,6 +665,24 @@ out = proc.getOutputStream();]]></source>
The name and value attributes are mandatory.
</p>
</section>
<section id="afp-no-operation">
<title>No Operation Extension</title>
<p>The no-operation extension provides the ability to carry up to 32K of comments or any other type
of unarchitected data into the AFP output stream. Example:</p>
<source><![CDATA[
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:afp="http://xmlgraphics.apache.org/fop/extensions/afp">
<fo:layout-master-set>
<fo:simple-page-master master-name="simple">
<afp:no-operation name="My NOP">insert up to 32k of character data here!</afp:no-operation>
</fo:simple-page-master>
</fo:layout-master-set>
]]></source>
<p>The no-operation extension element can only occur within a simple-page-master.
Multiple no-operation extension elements within a simple-page-master are allowed.
The name attribute is mandatory.
</p>
</section>
</section>
</section>
<section id="rtf">
@@ -584,10 +690,19 @@ out = proc.getOutputStream();]]></source>
<p>
JFOR, an open source XSL-FO to RTF converter has been integrated into Apache FOP.
This will create an RTF (rich text format) document that will
attempt to contain as much information from the fo document as
possible. The RTF output follows Microsoft's RTF specifications
attempt to contain as much information from the XSL-FO document as
possible. It should be noted that is not possible (due to RTF's limitations) to map all
XSL-FO features to RTF. For complex documents, the RTF output will never reach the feature
level from PDF, for example. Thus, using RTF output is only recommended for simple documents
such as letters.
</p>
<p>
The RTF output follows Microsoft's RTF specifications
and produces best results on Microsoft Word.
</p>
<note>RTF output is currently unmaintained and lacks many features compared to other output
formats. Using other editable formats like Open Document Format, instead of producing XSL-FO
then RTF through FOP, might give better results.</note>
</section>
<section id="xml">
<title>XML (Area Tree XML)</title>
@@ -662,8 +777,8 @@ out = proc.getOutputStream();]]></source>
<fonts><!-- described elsewhere --></fonts>
</renderer>]]></source>
<p>
The default value for the "compression" setting is "PackBits" which is a
widely supported RLE compression scheme for TIFF. The set of compression
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:
@@ -770,3 +885,4 @@ out = proc.getOutputStream();]]></source>
</body>
</document>



src/documentation/content/xdocs/0.93/pdfa.xml → src/documentation/content/xdocs/0.95/pdfa.xml View File

@@ -20,7 +20,7 @@
<document>
<header>
<title>PDF/A (ISO 19005)</title>
<version>$Revision: 389563 $</version>
<version>$Revision$</version>
<authors>
<person name="Jeremias Märki" email="jeremias@apache.org"/>
</authors>
@@ -129,5 +129,31 @@ Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent);
activated at the same time.
</p>
</section>
<section id="interoperability">
<title>Interoperability</title>
<p>
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:
</p>
<table>
<tr>
<td>http://www.aiim.org/pdfa/ns/id.html</td>
<td><strong>obsolete</strong>, from an early draft of ISO-19005-1, used by Adobe Acrobat 7.x</td>
</tr>
<tr>
<td>http://www.aiim.org/pdfa/ns/id</td>
<td><strong>obsolete</strong>, found in the original ISO 19005-1:2005 document</td>
</tr>
<tr>
<td>http://www.aiim.org/pdfa/ns/id/</td>
<td><strong>correct</strong>, found in the technical corrigendum 1 of ISO 19005-1:2005</td>
</tr>
</table>
<p>
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.
</p>
</section>
</body>
</document>

src/documentation/content/xdocs/0.93/pdfencryption.xml → src/documentation/content/xdocs/0.95/pdfencryption.xml View File

@@ -29,10 +29,6 @@
<body>
<section>
<title>Overview</title>
<warning>
PDF Encryption is available in Release 0.20.5 and later. The comments on this page do
not apply to releases earlier than 0.20.5.
</warning>
<p>
FOP supports encryption of PDF output, thanks to Patrick
C. Lankswert. This feature is commonly used to prevent

src/documentation/content/xdocs/0.93/pdfx.xml → src/documentation/content/xdocs/0.95/pdfx.xml View File


src/documentation/content/xdocs/0.93/running.xml → src/documentation/content/xdocs/0.95/running.xml View File

@@ -28,21 +28,24 @@
<title>System Requirements</title>
<p>The following software must be installed:</p>
<ul>
<li>Java 1.3.x or later Runtime Environment.</li>
<li>
Java 1.4.x or later Runtime Environment.
<ul>
<li>
Many JREs >=1.4 contain older JAXP implementations (which often contain bugs). It's
usually a good idea to replace them with a current implementation.
</li>
</ul>
</li>
<li>
Apache FOP. The <a href="../download.html">FOP distribution</a> includes all libraries that you will
need to run a basic FOP installation. These can be found in the [fop-root]/lib directory. These
libraries include the following:
<ul>
<li>
A JAXP-compatible XML Parser (FOP comes with <a class="fork" href="ext:xerces">Apache Xerces-J</a>).
</li>
<li>
A JAXP-compatible XSLT Processor (FOP comes with <a class="fork" href="ext:xalan">Apache Xalan-J</a>).
</li>
<li><a class="fork" href="ext:xmlgraphics.apache.org/commons">Apache XML Graphics Commons</a>, an shared library for Batik and FOP.</li>
<li><a class="fork" href="ext:batik">Apache Batik</a>, an SVG library.</li>
<li><a class="fork" href="ext:jakarta/commons/logging">Apache Jakarta Commons Logging</a>, a logger abstraction kit.</li>
<li><a class="fork" href="ext:jakarta/commons/io">Apache Jakarta Commons IO</a>, a library with I/O utilities.</li>
<li><a class="fork" href="ext:commons-logging">Apache Commons Logging</a>, a logger abstraction kit.</li>
<li><a class="fork" href="ext:commons-io">Apache Commons IO</a>, a library with I/O utilities.</li>
<li><a class="fork" href="ext:excalibur/framework">Apache Excalibur/Avalon Framework</a>, for XML configuration handling.</li>
</ul>
</li>
@@ -50,7 +53,8 @@
<p>The following software is optional, depending on your needs:</p>
<ul>
<li>
Graphics libraries. Support for some graphics formats requires additional packages. See
Graphics libraries. Generally, FOP contains direct support for the most important
bitmap image formats (including PNG, JPEG and GIF). See
<a href="graphics.html">FOP: Graphics Formats</a> for details.
</li>
<li>
@@ -178,7 +182,7 @@ Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl
Fop foo.fo -awt]]></source>
<p>
PDF encryption is only available if FOP was compiled with encryption support
<strong>and</strong> if compatible encryption support is availabe at run time.
<strong>and</strong> if compatible encryption support is available at run time.
Currently, only the JCE is supported. Check the <a href="pdfencryption.html">Details</a>.
</p>
</section>
@@ -220,25 +224,27 @@ Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl
<title>FOP's dynamical classpath construction</title>

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

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

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

</section>
</section>
@@ -335,11 +341,6 @@ Fop [options] [-fo|-xml] infile [-xsl file] [-awt|-pdf|-mif|-rtf|-tiff|-png|-pcl
This can be substantial if the page sequence contains lots of FO elements.
</li>
</ul>
<p>
One of FOP's stated design goals is to be able to process input of arbitrary size.
Addressing this goal is one of the prime motivations behind the
<a href="../dev/index.html">FOP Redesign</a>.
</p>
</section>
<section id="problems">
<title>Problems</title>

src/documentation/content/xdocs/0.93/servlets.xml → src/documentation/content/xdocs/0.95/servlets.xml View File

@@ -161,7 +161,7 @@ public void init() throws ServletException {
<ul>
<li>
Instead of java.io.ByteArrayOutputStream consider using the ByteArrayOutputStream
implementation from the <a href="ext:jakarta/commons/io">Jakarta Commons IO project</a> which allocates less memory.
implementation from the <a href="ext:commons-io">Jakarta Commons IO project</a> which allocates less memory.
The full class name is: <code>org.apache.commons.io.output.ByteArrayOutputStream</code>
</li>
<li>
@@ -177,6 +177,71 @@ public void init() throws ServletException {
apply here, too.
</p>
</section>
<section id="uriresolver">
<title>Accessing resources in your web application</title>
<p>
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
<code>org.apache.fop.servlet.ServletContextURIResolver</code>.
</p>
<p>
Here's how to set it up in your servlet. Instantiate a new instance in the servlet's
init() method:
</p>
<source><![CDATA[
/** URIResolver for use by this servlet */
protected URIResolver uriResolver;

public void init() throws ServletException {
this.uriResolver = new ServletContextURIResolver(getServletContext());
[..]
}]]></source>
<p>
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!
</p>
<p>
Further down, you can use the URIResolver for various things:
</p>
<ul>
<li>
With the Transformer (JAXP/XSLT) so things like document() functions can resolver
"servlet-context:" URIs.
</li>
<li>
With the FopFactory so every resource FOP loads can be loaded using a "servlet-context:"
URI.
</li>
<li>
You can the ServletContextURIResolver yourself in your servlet code to access
stylesheets or XML files bundled with your web application.
</li>
</ul>
<p>
Here are some example snippets:
</p>
<source><![CDATA[
//Setting up the JAXP TransformerFactory
this.transFactory = TransformerFactory.newInstance();
this.transFactory.setURIResolver(this.uriResolver);

[..]

//Setting up the FOP factory
this.fopFactory = FopFactory.newInstance();
this.fopFactory.setURIResolver(this.uriResolver);

[..]

//The stylesheet for the JAXP Transfomer
Source xsltSrc = this.uriResolver.resolve(
"servlet-context:/xslt/mystylesheet.xsl", null);
Transformer transformer = this.transFactory.newTransformer(xsltSrc);
transformer.setURIResolver(this.uriResolver);]]></source>
</section>
</section>
<section id="ie">
<title>Notes on Microsoft Internet Explorer</title>

src/documentation/content/xdocs/0.93/upgrading.xml → src/documentation/content/xdocs/0.95/upgrading.xml View File

@@ -31,7 +31,10 @@
</p>
<ul>
<li>
More than half of the codebase has been rewritten over the last three years. With version 0.93 the code has reached <strong>production level</strong>.
More than half of the codebase has been rewritten over the
last four years. With version 0.93 the code has reached
<strong>production level</strong>, and continues to improve with
version 0.94 and 0.95.
</li>
<li>
The API of FOP has changed considerably and is not
@@ -52,13 +55,12 @@
src/foschema/fop-configuration.xsd.
</li>
<li>
If you are using font metrics files for version 0.20.5 or
0.92 or earlier, you have to regenerate them in the new
format. The new format is characterized by a version
attribute on the top-level font-metrics element, whose value
is 2.0. The absence of a version attribute will be
interpreted as version 1.0, and such metrics files will no
longer be parsed.
Beginning with version 0.94 you can skip the generation of
font metric files and remove the "font-metrics" attribute
in the font configuration. 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.
</li>
<li>
<p>
@@ -76,18 +78,13 @@
</li>
<li>
Extensions and Renderers written for version 0.20.5 will not work with the new code! The new FOP
extension for <a href="http://barcode4j.krysalis.org">Barcode4J</a> will be available in
extension for <a href="http://barcode4j.krysalis.org">Barcode4J</a> is available since
January 2007.
</li>
<li>
The PCL Renderer and the MIF Handler have not been resurrected, yet! They are currently non-functional
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.
</li>
<li>
By looking at the <a href="../compliance.html">Compliance page</a> you might get the impression
that the new code is much more advanced than version 0.20.5. That's true but there may still
be a few things that may not be handled as gracefully by the new code as by version 0.20.5.
</li>
</ul>
</section>
<section id="issues">
@@ -95,17 +92,14 @@
<p>
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.
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:
</p>
<ul>
<li>
Check the <a href="../compliance.html">Compliance page</a> for the feature causing
trouble. It may contain the necessary information to understand and resolve the problem.
</li>
<li>
Not all 0.20.5 output formats are supported. PDF and Postscript should be fully supported.
See <a href="output.html">Output Targets</a> for a more complete description.
</li>
<li>
As stated above empty table cells <code>&lt;fo:table-cell&gt;&lt;/fo:table-cell&gt;</code>
are not allowed by the specification. The same applies to empty <code>static-content</code>
@@ -123,12 +117,8 @@
</li>
<li>
The <code>fox:outline</code> extension is not implemented in this version anymore.
It has been superseded by the new bookmark elements from XSL-FO 1.1.
</li>
<li>
The <code>fox:destination</code> extension is also not implemented in this version
although it may be added in the future. See also
<a href="http://issues.apache.org/bugzilla/show_bug.cgi?id=37157">Bug 37157</a>.
It has been superseded by the new bookmark elements from XSL-FO 1.1. So please
update your stylesheets accordingly.
</li>
</ul>
</section>

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


+ 2
- 2
src/documentation/content/xdocs/dev/doc.xml View File

@@ -97,9 +97,9 @@ Maintenance branch releases either copy the trunk content to the maintenance bra
Step-by-step instructions for the deployment process again:
</p>
<note>
Please make sure you use Forrest from the 0.7 branch for the time being. You will need
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:
<link href="http://svn.apache.org/repos/asf/forrest/branches/forrest_07_branch">http://svn.apache.org/repos/asf/forrest/branches/forrest_07_branch</link>
<link href="http://svn.apache.org/repos/asf/forrest/trunk">http://svn.apache.org/repos/asf/forrest/trunk</link>
</note>
<ul>
<li>Modify the sources of the website and check locally with Forrest (run "forrest run" or just "forrest").</li>

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

@@ -84,7 +84,7 @@
<p/>
<table>
<tr>
<th colspan="2">Latest Release</th>
<th colspan="2">Latest Stable Release</th>
</tr>
<tr>
<td>Repository URL</td>
@@ -102,6 +102,25 @@
</link>
</td>
</tr>
<tr>
<th colspan="2">Latest Release</th>
</tr>
<tr>
<td>Repository URL</td>
<td>
<link href="http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-0_95rc/">
<code>http://svn.apache.org/repos/asf/xmlgraphics/fop/tags/fop-0_95rc/</code>
</link>
</td>
</tr>
<tr>
<td>Web view</td>
<td>
<link href="http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-0_95rc/">
<code>http://svn.apache.org/viewvc/xmlgraphics/fop/tags/fop-0_95rc/</code>
</link>
</td>
</tr>
<tr>
<th colspan="2">Trunk</th>
</tr>

+ 15
- 0
src/documentation/content/xdocs/faq.xml View File

@@ -645,6 +645,21 @@ Check the following:</p>
</p>
</answer>
</faq>
<faq id="pdf-ps-java2d-differences">
<question>Why is the output of Java2D/AWT-based renderers different than, for example, PDF or PS?</question>
<answer>
<p>
If you render the same document once to a PNG or TIFF and once into a PDF, the output
may not be the same, i.e. line breaks are different or lines may have different heights.
The reason for this: The Java2D-based renderers use the font subsystem of Java2D/AWT. The
PDF and PS renderers use FOP's own font subsystem which provides much better font metrics
than Java2D. These can lead to different layout decisions when the same document is
rendered with different renderers. An alternative approach to fix this problem might be
available but it hasn't been tested, yet. See also the
<link href="0.95/output.html#general-fonts">notes on fonts in the various output formats</link>.
</p>
</answer>
</faq>
</part>
<part id="part-embedding">
<title>Embedding FOP. Using FOP in a servlet.</title>

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

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

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id: gethelp.xml 627324 2008-02-13 09:35:01Z maxberger $ -->
<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.3//EN" "http://forrest.apache.org/dtd/document-v13.dtd">
<document>
<header>
<title>FOP: Quick Start Guide</title>
<subtitle>Everything you need to start using and appreciating Apache FOP quickly.</subtitle>
<version>$Revision: 627324 $</version>
</header>
<body>
<section id="essentials">
<title>FOP Essentials</title>
<p>The goal of this <strong>Quick Start Guide</strong> is to help novice users get Apache FOP up and running quickly. Typically, you'll need to:</p>
<ol>
<li><link href="download.html">Download FOP</link></li>
<li><link href="0.95/compiling.html">Build FOP</link> (you can skip this step if you download the binary distribution!)</li>
<li><link href="0.95/configuration.html">Configure FOP</link></li>
<li><link href="0.95/running.html">Run FOP</link></li>
</ol>
<p>Here are some links to help you find out what FOP can do, as well as how and where to get help:</p>
<ul>
<li><link href="0.95/embedding.html">Calling FOP from a Java Application</link></li>
<li><link href="0.95/servlets.html">Using FOP in Servlets</link></li>
<li><link href="0.95/anttask.html">Using FOP in an 'Ant' Build Script</link></li>
<li><link href="compliance.html" title="FOP Compliance">XSL-FO Compliance</link> (what FOP supports and what it doesn't)</li>
<li><link href="faq.html">FAQs</link></li>
<li><link href="gethelp.html">Getting Help</link></li>
<li><link href="maillist.html">Mailing Lists</link></li>
</ul>
<p>
Once you've familiarized yourself with the basics, you can get more detailed information,
in the detailed FOP <link href="0.95/index.html">product documentation</link>.
</p>
</section>
<section id="hello-world">
<title>Hello World with FOP</title>
<p>
This section walks you through a "Hello World!" page with Apache FOP. We're assuming you
download the binary distribution and that you have a Java Runtime Environment (version 1.4
or later) installed.
</p>
<ol>
<li>
Unpack the downloaded binary distribution to a directory of your choice (for example,
<code>C:\FOP</code> if you're on Windows). Let's call that
directory &lt;fop-home&gt;.
</li>
<li>
Get a command prompt in the &lt;fop-home&gt; directory and write:<br/>
Windows: <code>fop -fo examples/fo/basic/readme.fo -awt</code><br/>
Unix: <code>./fop.sh -fo examples/fo/basic/readme.fo -awt</code><br/>
</li>
<li>
If all went well, this should open a window showing you a "readme"-style document.
This is just to verify that FOP runs correctly.
</li>
<li>
Now, take your favorite XML editor and create a small XML file like the following. Replace
"Frank" with your own first name to make it a bit more personal and save it as
<code>name.xml</code>:<br/>
<source><![CDATA[<name>Frank</name>]]></source>
</li>
<li>
To produce a PDF file from this XML file, we need an XSLT stylesheet that converts the
XML to XSL-FO. This is the first step in the processing chain. The second step will be
done by FOP when it reads the generated XSL-FO document and formats it to a PDF document.
You can copy the following minimal XSLT stylesheet, which takes your first name and
produces a "Hello World!"-style document (save it as <code>name2fo.xsl</code>):<br/>
<source><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<fo:root>
<fo:layout-master-set>
<fo:simple-page-master master-name="A4-portrait"
page-height="29.7cm" page-width="21.0cm" margin="2cm">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4-portrait">
<fo:flow flow-name="xsl-region-body">
<fo:block>
Hello, <xsl:value-of select="name"/>!
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet>]]></source>
</li>
<li>
Finally, let's put the previous two steps together: Go back to the command prompt and
enter the following command:<br/>
Windows: <code>fop -xml name.xml -xsl name2fo.xsl -pdf name.pdf</code><br/>
Unix: <code>./fop.sh -xml name.xml -xsl name2fo.xsl -pdf name.pdf</code><br/>
</li>
<li>
You've produced your first PDF with Apache FOP! Please open <code>name.pdf</code>
in your favorite PDF viewer.
</li>
</ol>
</section>
</body>
</document>

+ 13
- 12
src/documentation/content/xdocs/site.xml View File

@@ -15,6 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<site label="FOP" href="" xmlns="http://apache.org/forrest/linkmap/1.0" tab="home">
<!--
BEGIN Home tab
@@ -22,6 +23,7 @@
<about label="About">
<index label="Introduction" href="index.html"/>
<download label="Download" href="download.html"/>
<quickstartguide label="Quick Start Guide" href="quickstartguide.html"/>
<compliance label="Compliance" href="compliance.html" description="FOP Compliance"/>
<help label="Getting Help" href="gethelp.html"/>
<faqs label="FAQs" href="faq.html"/>
@@ -34,7 +36,6 @@
<all_sitePDF label="Full PDF" href="wholesite.pdf"/>
-->
</about>

<resources label="Resources">
<xsl-fo label="XSL-FO" href="fo.html"/>
@@ -57,12 +58,12 @@
-->

<!--
BEGIN Version 0.93 documentation tab
BEGIN Version 0.94 documentation tab
-->
<trunk label="FOP 0.93" href="0.93/" tab="oldstableversion">
<trunk label="FOP 0.94" href="0.94/" tab="previousversion">
<about label="About" href="index.html"/>
<release label="Release Notes" href="releaseNotes_0.93.html"/>
<changes label="Changes" href="changes_0.93.html"/>
<release label="Release Notes" href="releaseNotes_0.94.html"/>
<changes label="Changes" href="changes_0.94.html"/>
<knownissues label="Known Issues" href="knownissues_overview.html"/>
<upgrading label="Upgrading" href="upgrading.html"/>
@@ -89,16 +90,16 @@
</trunk>
<!--
END Version 0.93 documentation tab
END Version 0.94 documentation tab
-->
<!--
BEGIN Version 0.94 documentation tab
BEGIN Version 0.95 documentation tab
-->
<trunk label="FOP 0.94" href="0.94/" tab="stableversion">
<trunk label="FOP 0.95beta" href="0.95/" tab="stableversion">
<about label="About" href="index.html"/>
<release label="Release Notes" href="releaseNotes_0.94.html"/>
<changes label="Changes" href="changes_0.94.html"/>
<release label="Release Notes" href="releaseNotes_0.95beta.html"/>
<changes label="Changes" href="changes_0.95beta.html"/>
<knownissues label="Known Issues" href="knownissues_overview.html"/>
<upgrading label="Upgrading" href="upgrading.html"/>
@@ -125,9 +126,9 @@
</trunk>
<!--
END Version 0.94 documentation tab
END Version 0.95 documentation tab
-->
<!--
BEGIN Trunk documentation tab
-->

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

@@ -27,13 +27,13 @@
<body>
<section>
<title>Status</title>
<p>[last updated 9 January 2007]</p>
<p>[last updated 4 March 2008]</p>
<figure width="585" height="175" src="images/track.png" alt="Planning and branches of FOP development"/>
<p>
This is the development status of Apache FOP. Development on
the maintenance branch where FOP 0.20.5 came from has been
halted. The code base has been largely redesigned. The new
code base has reached release 0.94.
code base has reached release 0.95.
</p>
</section>
<section>
@@ -44,7 +44,7 @@
handle large documents.</p>
<p>The redesign of the code base has largely been completed. The
new code reached production quality with release 0.93. In the
course of 2007 we plan to release version 1.0.</p>
course of 2008 or 2009 we hope to release version 1.0.</p>
<p>
If you're looking for a long-term road-map we have to disappoint you. This is Open
Source and we're mostly volunteers working in their free time. What we have
@@ -122,7 +122,7 @@
</tr>
<tr>
<td>Image Support</td>
<td>stable, but in need of a redesign</td>
<td>beta (recently rewritten)</td>
</tr>
<tr>
<td>Hyphenation Subsystem</td>

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

@@ -21,14 +21,8 @@
<tabs software="FOP" title="FOP" copyright="@year@ The Apache Software Foundation" xmlns:xlink="http://www.w3.org/1999/xlink">
<tab label="Home" dir=""/>
<tab label="Version 0.93" dir="0.93/"/>
<tab label="Version 0.94" dir="0.94/"/>
<tab label="Version 0.95beta" dir="0.95/"/>
<tab label="FOP Trunk" dir="trunk/"/>
<tab label="Development" dir="dev/"/>
<!--
<tab label="Design" dir="design/"/>
-->
<!--
<tab label="Alt Design" dir="design/alt.design/"/>
-->
</tabs>

+ 25
- 12
src/documentation/content/xdocs/team.xml View File

@@ -31,7 +31,6 @@
<title>Active Committers</title>
<note label="Important">Please don't write to any developer directly if you need help on using FOP. Only if you submit questions to the <link href="maillist.html#fop-user">FOP User Mailing List</link> will other FOP users be able to profit from answers given to your question. Another point is that a developer may have gone inactive or is on holidays in which case you may not get an answer in time.</note>
<ul>
<li id="fb"><link href="mailto:bckfnn@worldonline.dk">Finn Bock</link> (FB)</li>
<li id="cb"><link href="mailto:bowditch_chris@hotmail.com">Chris Bowditch</link> (CB)
is a Java/VB Programmer from England.</li>
<li id="jb"><link href="mailto:jay@bryantcs.com">Jay Bryant</link> (JB) is a
@@ -51,10 +50,6 @@
<li id="vh"><link href="mailto:vhennebert@apache.org">Vincent Hennebert</link>
(VH), a Java developer from France; with an interest in typography, and in using
Fop as a pdf renderer for book-like documents.</li>
<li id="ph"><link href="mailto:pherweg@web.de">Peter Herweg</link> (PH) is helping to
integrate the jfor project's RTF support into the upcoming FOP 1.0 version.
Born in 1978, he has been serving as an application developer for a small
industrial company in Germany since 1999.</li>
<li id="cl"><link href="mailto:clay@apache.org">Clay Leeds</link> (CL)
is a web/WAP/Palm developer from Laguna Beach, California, USA. A
recent XML/XSL-FO convert, he has been nit-picking FAQs &amp; assorted web
@@ -78,17 +73,16 @@
from the TeX/LaTeX world. See his <fork href="http://www.leverkruid.eu">home
page</fork> for some of his private projects.</li>
<li id="jp"><link href="mailto:pietsch@apache.org">J&#x00F6;rg Pietschmann</link> (JP)</li>
<li id="ot"><link href="mailto:olegt@apache.org">Oleg Tkachenko</link> (OT)</li>
<li id="mb"><link href="mailto:max AT berger DOT name">Max Berger</link> (MB) is currently a
PostDoc pursuing an academic career in computer science. His main interest in FOP is to
improve the DocBook to PDF tool-chain to produce high quality output, while still
conforming to given style-guides. See his <link href="http://max.berger.name">home
page</link> for more information.</li>
</ul>
</section>
<section id="contribute-active">
<title>Active Contributors</title>
<ul>
<li id="mb"><link href="mailto:max AT berger DOT name">Max Berger</link> is currently a
PostDoc pursuing an academic career in computer science. His main interest in FOP is to
improve the DocBook to PDF tool-chain to produce high quality output, while still
conforming to given style-guides. See his <link href="http://max.berger.name">home
page</link> for more information.</li>
<li id="lm">Louis Masters</li>
<li id="mn">Manoj Nair, Currently consulting for Sony Pictures Entertainment in Los Angeles, CA USA. Previously he worked with Java &amp; related technologies specializing in developing n-tier Web applications.</li>
<li id="rr"><link href="mailto:renaud.richardet AT gmail DOT com">Renaud Richardet</link> (RR)
@@ -109,11 +103,16 @@
<section id="commit-inactive">
<title>Inactive Committers</title>
<ul>
<li id="fb"><link href="mailto:bckfnn@worldonline.dk">Finn Bock</link> (FB)</li>
<li id="kc"><link href="mailto:kellyc@apache.org">Kelly Campbell</link></li>
<li id="sc"><link href="mailto:gears@apache.org">Steven Coffman</link></li>
<li id="bd"><link href="mailto:bdelacretaz@apache.org">Bertrand Delacretaz</link></li>
<li id="te"><link href="mailto:tore@apache.org">Tore Engvig</link></li>
<li id="sg"><link href="mailto:stanislav@apache.org">Stanislav Gorkhover</link></li>
<li id="ph"><link href="mailto:pherweg@web.de">Peter Herweg</link> (PH)<!-- is helping to
integrate the jfor project's RTF support into the upcoming FOP 1.0 version.
Born in 1978, he has been serving as an application developer for a small
industrial company in Germany since 1999.--></li>
<li id="fj"><link href="mailto:fotis@apache.org">Fotis Jannidis</link></li>
<li id="kl"><link href="mailto:klease@apache.org">Karen Lease</link></li>
<li id="kll"><link href="mailto:keiron@apache.org">Keiron Liddle</link></li>
@@ -122,6 +121,7 @@
<li id="jn"><link href="mailto:jordan@apache.org">Jordan Naftolin</link></li>
<li id="as"><link href="mailto:arved@apache.org">Arved Sandstrom</link></li>
<li id="es"><link href="mailto:eschaeffer@apache.org">Eric Schaeffer</link></li>
<li id="ot"><link href="mailto:olegt@apache.org">Oleg Tkachenko</link> (OT)</li>
<li id="aw"><link href="mailto:artw@apache.org">Art Welch</link></li>
<li id="pbw"><link href="mailto:pbwest@apache.org">Peter B. West</link></li>
</ul>
@@ -264,7 +264,7 @@
<td/>
<td/>
<td/>
<td/>
<td>X</td>
<td/>
<td/>
<td/>
@@ -298,6 +298,19 @@
<td/>
<td/>
</tr>
<tr>
<td>AFP</td>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
<td/>
</tr>
<tr>
<td>Forrest</td>
<td/>

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

@@ -277,7 +277,23 @@
<output-profile>C:\FOP\Color\EuropeISOCoatedFOGRA27.icc</output-profile>
<fonts....
</renderer>]]></source>
</renderer>]]></source>
<p>
Some people don't have high requirements on color fidelity but instead want the smallest
PDF file sizes possible. In this case it's possible to disable the default sRGB color space
which XSL-FO requires. This will cause RGB colors to be generated as device-specific RGB.
Please note that this option is unavailable (and will cause an error) if you enable
PDF/A or PDF/X functionality or if you specify an output profile. This setting will make the
PDF about 4KB smaller. To disable the sRGB color space add the following setting:
</p>
<source><![CDATA[
<renderer mime="application/pdf">
<filterList...
<disable-srgb-colorspace>true</disable-srgb-colorspace>
<fonts....
</renderer>]]></source>
</section>
<section id="ps-renderer">
<title>Special Settings for the PostScript Renderer</title>

+ 18
- 0
src/documentation/content/xdocs/trunk/extensions.xml View File

@@ -210,6 +210,24 @@ to following pages. Here is an example of FO code creating such a table-header:<
supported for PDF, PS and Java2D-based renderers.
</note>
</section>
<section id="color-functions">
<title>Color functions</title>
<p>
XSL-FO supports specifying color using the rgb(), rgb-icc() and system-color() functions.
Apache FOP provides additional color functions for special use cases. Please note that
using these functions compromises the interoperability of an FO document.
</p>
<section id="color-function-cmyk">
<title>cmyk()</title>
<p><code>color cmyk(numeric, numeric, numeric, numeric)</code></p>
<p>
This function will construct a color in device-specific CMYK color space. The numbers
must be between 0.0 and 1.0. For output formats that don't support device-specific
color space the CMYK value is converted to an sRGB value.
</p>
</section>
</section>
</section>
</body>
</document>

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

@@ -31,11 +31,6 @@
<body>
<section id="intro">
<title>Summary</title>
<note>The FOP Font subsystem is currently undergoing a significant change.
The details provided here especially related to the generation of FOP Font
Metrics files and the FOP Font configuration are likely to change substantially
in the future.
</note>
<p>The following table summarizes the font capabilities of the various FOP renderers:</p>
<table>
<tr>
@@ -59,22 +54,22 @@
<td>yes</td>
<td>yes</td>
</tr>
<!--tr> NOT AVAILABLE YET!!!
<tr>
<td>PCL</td>
<td>yes (modified)</td>
<td>yes (painted as bitmaps)</td>
<td>yes (painted as bitmaps)</td>
<td>no</td>
<td>no</td>
<td>no</td>
</tr-->
</tr>
<tr>
<td>TXT</td>
<td>yes (used for layout but not for output)</td>
<td>AFP</td>
<td>no</td>
<td>yes (used for layout but not for output)</td>
<td>no</td>
<td>yes</td>
<td>yes</td>
</tr>
<tr>
<td>AWT</td>
<td>Java2D/AWT/Bitmap</td>
<td>if available from OS</td>
<td>yes</td>
<td>yes</td>
@@ -95,19 +90,26 @@
<td>n/a</td>
</tr>
<tr>
<td>TXT</td>
<td>yes (used for layout but not for output)</td>
<td>no</td>
<td>yes (used for layout but not for output)</td>
<td>no</td>
</tr>
<!--tr> NOT AVAILABLE
<td>MIF</td>
<td>n/a (font metrics not needed)</td>
<td>n/a</td>
<td>n/a</td>
<td>n/a</td>
</tr>
<tr>
</tr-->
<!--tr> NOT AVAILABLE
<td>SVG</td>
<td>if available from OS</td>
<td>yes</td>
<td>no</td>
<td>no</td>
</tr>
</tr-->
<tr>
<td>XML</td>
<td>yes</td>
@@ -120,8 +122,8 @@
<section>
<title>Base-14 Fonts</title>
<p>
The Adobe PDF Specification specifies a set of 14 fonts that must be
available to every PDF reader:
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),
@@ -147,73 +149,140 @@
</p>
</section>
<section id="awt">
<title>AWT/Operating System Fonts</title>
<p>The AWT family of renderers (AWT, Print, SVG), use the Java AWT libraries for font metric information. Through operating system registration, the AWT libraries know what fonts are available on the system, and the font metrics for each one.</p>
<title>Java2D/AWT/Operating System Fonts</title>
<p>
The Java2D family of renderers (Java2D, AWT, Print, TIFF, PNG), use the
Java AWT subsystem for font metric information. Through operating system
registration, the AWT subsystem knows what fonts are available on the system,
and the font metrics for each one.
</p>
<p>
When working with one of these output formats and you're missing a font, just
install it in your operating system and they should be available for these
renderers. Please note that this is not true for other output formats such as
PDF or PostScript.
</p>
</section>
<section id="custom">
<title>Custom Fonts</title>
<p>Support for custom fonts is added by creating font metric files (written in XML) from the actual font files, and registering them with FOP. Currently only Type 1 and TrueType fonts can be added.
More information about fonts can be found at:</p>
<p>
Support for custom fonts is highly output format dependent (see above table).
This section shows how to add Type 1 and TrueType fonts to the PDF, PostScript and
Java2D-based renderers. Other renderers (like AFP) support other font formats. Details
in this case can be found on the page about <a href="output.html">output formats</a>.
</p>
<p>
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.
</p>
<p>
Basic information about fonts can be found at:
</p>
<ul>
<li><a href="http://partners.adobe.com/asn/developer/type/ftypes.html">Adobe font types</a></li>
<li><a href="http://partners.adobe.com/asn/developer/technotes/fonts.html">Adobe Font Technote</a></li>
</ul>
</section>
<section id="basics">
<title>Basic font configuration</title>
<p>
If you want FOP to use custom fonts, you need to tell it where to find them. This
is done in the configuration file and once per renderer (because each output format
is a little different). In the basic form, you can either tell FOP to find your
operating system fonts or you can specify directories that it will search for
support fonts. These fonts will then automatically be registered.
</p>
<source><![CDATA[
<fonts>
<!-- register all the fonts found in a directory -->
<directory>C:\MyFonts1</directory>
<!-- register all the fonts found in a directory
and all of its sub directories (use with care) -->
<directory recursive="true">C:\MyFonts2</directory>

<!-- automatically detect operating system installed fonts -->
<auto-detect/>
</fonts>]]></source>
<note>
Review the documentation for <a href="configuration.html">FOP Configuration</a>
for instructions on making the FOP configuration available to FOP when it runs.
Otherwise, FOP has no way of finding your custom font information. It is currently
not possible to easily configure fonts from Java code.
</note>
</section>
<section id="advanced">
<title>Advanced font configuration</title>
<p>
The instructions found above should be sufficient for most users. Below are some
additional instructions in case the basic font configuration doesn't lead to
the desired results.
</p>
<section id="type1-metrics">
<title>Type 1 Font Metrics</title>
<p>FOP includes PFMReader, which reads the PFM file that normally comes with a Type 1 font, and generates an appropriate font metrics file for it.
To use it, run the class org.apache.fop.fonts.apps.PFMReader:</p>
To use it, run the class org.apache.fop.fonts.apps.PFMReader:</p>
<p>Windows (on JDK 1.4 and later):</p>
<source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
<p>Windows (on JDK 1.3.x):</p>
<source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar;lib\xml-apis.jar;
lib\xercesImpl.jar;lib\xalan.jar;lib\serializer.jar
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
lib\xercesImpl.jar;lib\xalan.jar;lib\serializer.jar
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
<p>Unix (on JDK 1.4 and later):</p>
<source>java -cp build/fop.jar:lib/avalon-framework.jar:lib/commons-logging.jar:lib/commons-io.jar
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
<p>Unix (on JDK 1.3.1):</p>
<source>java -cp build/fop.jar:lib/avalon-framework.jar:lib/commons-logging.jar:lib/commons-io.jar:lib/xml-apis.jar:
lib/xercesImpl.jar:lib/xalan.jar:lib/serializer.jar
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
lib/xercesImpl.jar:lib/xalan.jar:lib/serializer.jar
org.apache.fop.fonts.apps.PFMReader [options] pfm-file xml-file</source>
<p>PFMReader [options]:</p>
<ul>
<li><strong>-fn &lt;fontname&gt;</strong> By default, FOP uses the fontname from the
.pfm file when embedding the font. Use the "-fn" option to override this name with one you have
chosen. This may be useful in some cases to ensure that applications using the output document
(Acrobat Reader for example) use the embedded font instead of a local font with the same
name.</li>
.pfm file when embedding the font. Use the "-fn" option to override this name with one you have
chosen. This may be useful in some cases to ensure that applications using the output document
(Acrobat Reader for example) use the embedded font instead of a local font with the same
name.</li>
</ul>
<note>The classpath in the above example has been simplified for readability.
You will have to adjust the classpath to the names of the actual JAR files in the lib directory.
xml-apis.jar, xercesImpl.jar, xalan.jar and serializer.jar are not necessary for JDK version 1.4 or later.</note>
You will have to adjust the classpath to the names of the actual JAR files in the lib directory.
xml-apis.jar, xercesImpl.jar, xalan.jar and serializer.jar are not necessary for JDK version 1.4 or later.</note>
<note>The tool will construct some values (FontBBox, StemV and ItalicAngle) based on assumptions and calculations which are only an approximation to the real values.
FontBBox and Italic Angle can be found in the human-readable part of the PFB file or in the AFM file.
The PFMReader tool does not yet interpret PFB or AFM files, so if you want to be correct, you may have to adjust the values in the XML file manually.
The constructed values however appear to have no visible influence.</note>
FontBBox and Italic Angle can be found in the human-readable part of the PFB file or in the AFM file.
The PFMReader tool does not yet interpret PFB or AFM files, so if you want to be correct, you may have to adjust the values in the XML file manually.
The constructed values however appear to have no visible influence.</note>
</section>
<section id="truetype-metrics">
<title>TrueType Font Metrics</title>
<p>FOP includes TTFReader, which reads the TTF file and generates an appropriate font metrics file for it.
Use it in a similar manner to PFMReader.
For example, to create such a metrics file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:</p>
Use it in a similar manner to PFMReader.
For example, to create such a metrics file in Windows from the TrueType font at c:\myfonts\cmr10.ttf:</p>
<source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
org.apache.fop.fonts.apps.TTFReader [options]
C:\myfonts\cmr10.ttf ttfcm.xml</source>
org.apache.fop.fonts.apps.TTFReader [options]
C:\myfonts\cmr10.ttf ttfcm.xml</source>
<p>TTFReader [options]:</p>
<ul>
<li><strong>-d &lt;DEBUG | INFO &gt;</strong> Sets the debug level (default is
INFO).</li>
INFO).</li>
<li><strong>-fn &lt;fontname&gt;</strong> Same as for PFMReader.</li>
<li><strong>-ttcname &lt;fontname&gt;</strong> If you're reading data from a
TrueType Collection (.ttc file) you must specify which font from the collection you will read
metrics from.
If you read from a .ttc file without this option, the fontnames will be listed for you.</li>
TrueType Collection (.ttc file) you must specify which font from the collection you will read
metrics from.
If you read from a .ttc file without this option, the fontnames will be listed for you.</li>
<li><strong>-enc ansi</strong> Creates a WinAnsi-encoded font metrics file.
Without this option, a CID-keyed font metrics file is created.
The table below summarizes the differences between these two encoding options as currently
used within FOP.
Please note that this information only applies to TrueType fonts and TrueType collections:</li>
Without this option, a CID-keyed font metrics file is created.
The table below summarizes the differences between these two encoding options as currently
used within FOP.
Please note that this information only applies to TrueType fonts and TrueType collections:</li>
</ul>
<table id="ttf-encoding">
<tr>
@@ -240,13 +309,13 @@ Please note that this information only applies to TrueType fonts and TrueType co
<section id="truetype-collections-metrics">
<title>TrueType Collections Font Metrics</title>
<p>TrueType collections (.ttc files) contain more than one font.
To create metrics files for these fonts, you must specify which font in the collection should be generated, by using the "-ttcname" option with the TTFReader.</p>
To create metrics files for these fonts, you must specify which font in the collection should be generated, by using the "-ttcname" option with the TTFReader.</p>
<p>To get a list of the fonts in a collection, just start the TTFReader as if it were a normal TrueType file (without the -ttcname option).
It will display all of the font names and exit with an Exception.</p>
It will display all of the font names and exit with an Exception.</p>
<p>Here is an example of generating a metrics file for a .ttc file:</p>
<source>java -cp build\fop.jar;lib\avalon-framework.jar;lib\commons-logging.jar;lib\commons-io.jar
org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho"
msmincho.ttc msminch.xml</source>
org.apache.fop.fonts.apps.TTFReader -ttcname "MS Mincho"
msmincho.ttc msminch.xml</source>
</section>
<section id="register">
<title>Register Fonts with FOP</title>
@@ -269,16 +338,16 @@ It will display all of the font names and exit with an Exception.</p>
<!-- automatically detect operating system installed fonts -->
<auto-detect/>
</fonts>]]></source>
<note>Review the documentation for <a href="configuration.html">FOP Configuration</a> for instructions on making the FOP configuration available to FOP when it runs. Otherwise, FOP has no way of finding your custom font information.</note>
<ul>
<li>
URLs are used to access the font metric and font files.
Relative URLs are resolved relative to the font-base property (or base) if available.
See <a href="configuration.html">FOP: Configuration</a> for more information.
</li>
<li>The "metrics-url" attribute is generally not necessary except if you run into problems with certain fonts.</li>
<li>Either an "embed-url" or a "metrics-url" must be specified for font tag configurations.</li>
<li>The font "kerning" attribute is optional.</li>
<li>If embedding is off, the output will position the text correctly (from the metrics file), but it will not be displayed or printed correctly unless the viewer has the applicable font available to their local system.</li>
<li>The font "kerning" attribute is optional. Default is "true".</li>
<li>If embedding is off (i.e. embed-url is not set), the output will position the text correctly (from the metrics file), but it will not be displayed or printed correctly unless the viewer has the applicable font available to their local system.</li>
<li>When setting the "embed-url" attribute for Type 1 fonts, be sure to specify the PFB (actual font data), not PFM (font metrics) file that you used to generate the XML font metrics file.</li>
<li>The fonts "directory" tag can be used to register fonts contained within a single or list of directory paths. The "recursive" attribute can be specified to recursively add fonts from all sub directories.</li>
<li>The fonts "auto-detect" tag can be used to automatically register fonts that are found to be installed on the native operating system.</li>
@@ -294,37 +363,38 @@ It will display all of the font names and exit with an Exception.</p>
</section>
<section id="autodetect">
<title>Auto-Detect and auto-embedd feature</title>
<p>When the "auto-detect" flag is set in the configuration, FOP will automatically search for fonts in the default paths for your operating system.</p>
<p>FOP will also auto-detect fonts which are available in the classpath, if they are described as "application/x-font" in the MANIFEST.MF file. For example, if your .jar file contains font/myfont.ttf:</p>
<source>Manifest-Version: 1.0
Name: font/myfont.ttf
Content-Type: application/x-font</source>
<p>This feature allows you to create JAR files containing fonts. The JAR files can be added to fop by providem them in the classpath, e.g. copying them into the lib/ directory.</p>
<p>When the "auto-detect" flag is set in the configuration, FOP will automatically search for fonts in the default paths for your operating system.</p>
<p>FOP will also auto-detect fonts which are available in the classpath, if they are described as "application/x-font" in the MANIFEST.MF file. For example, if your .jar file contains font/myfont.ttf:</p>
<source>Manifest-Version: 1.0
Name: font/myfont.ttf
Content-Type: application/x-font</source>
<p>This feature allows you to create JAR files containing fonts. The JAR files can be added to fop by providem them in the classpath, e.g. copying them into the lib/ directory.</p>
</section>
<section id="embedding">
<title>Embedding</title>
<note>The PostScript renderer does not yet support TrueType fonts, but can embed Type 1 fonts.</note>
<note>The font is simply embedded into the PDF file, it is not converted.</note>
<p>Font embedding is enabled in the userconfig.xml file and controlled by the embed-url attribute.
If you don't specify the embed-url attribute the font will not be embedded, but will only be referenced.</p>
If you don't specify the embed-url attribute the font will not be embedded, but will only be referenced.</p>
<warning>
Omitting the embed-url attribute for CID-encoded TrueType fonts will currently produce invalid
PDF files! If you create the XML font metric file using the "-enc ansi" option, you can omit
the embed-url attribute for TrueType fonts but you're restricted to the WinAnsi character set.
</warning>
<p>When FOP embeds a font, it adds a prefix to the fontname to ensure that the name will not match the fontname of an installed font.
This is helpful with older versions of Acrobat Reader that preferred installed fonts over embedded fonts.</p>
This is helpful with older versions of Acrobat Reader that preferred installed fonts over embedded fonts.</p>
<p>When embedding PostScript fonts, the entire font is always embedded.</p>
<p>When embedding TrueType fonts (ttf) or TrueType Collections (ttc), a subset of the
original font, containing only the glyphs used, is embedded in the output document.</p>
</section>
<!-- The following section should no longer be required
<section id="embedding-base14">
<title>Explicitly embedding the base 14 fonts</title>
<p>
There are cases where you might want to force the embedding of one or more of the base 14 fonts that
can normally be considered available on the target platform (viewer, printer). One of these cases is
PDF/A which mandates the embedding of even the base 14 fonts. Embedding a font such as Helvetica or
<a href="pdfa.html">PDF/A</a> which mandates the embedding of even the base 14 fonts. Embedding a font such as Helvetica or
Courier is straight-forward. The "Symbol" and "ZapfDingbats" fonts, however, currently present a
problem because FOP cannot correctly determine the encoding of these two single-byte fonts through
the PFM file. FOP now correctly interprets the "encoding" value in the XML font metrics file, but the
@@ -342,7 +412,7 @@ This is helpful with older versions of Acrobat Reader that preferred installed f
<cap-height>673</cap-height>
<x-height>766</x-height>
[..]]]></source>
</section>
</section-->
</section>
</body>
</document>

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

@@ -20,7 +20,7 @@
<document>
<header>
<title>Apache FOP Trunk (Development code)</title>
<version>$Revision: 201586 $</version>
<version>$Revision$</version>
</header>
<body>
<section id="intro">

+ 38
- 3
src/documentation/content/xdocs/trunk/output.xml View File

@@ -48,6 +48,35 @@
The net effect is that the layout of a given FO document can be quite different between
renderers that do not use the same font information.
</p>
<p>
Theoretically, there's some potential to make the output of the PDF/PS renderers match
the output of the Java2D-based renderers. If FOP used the font metrics from its own
font subsystem but still used Java2D for text painting in the Java2D-based renderers,
this could probably be achieved. However, this approach hasn't been implemented, yet.
</p>
<p>
With a work-around, it is possible to match the PDF/PS output in a Java2D-based
renderer pretty closely. The clue is to use the
<a href="intermediate.html">intermediate format</a>. The trick is to layout the
document using FOP's own font subsystem but then render the document using Java2D.
Here are the necessary steps (using the command-line):
</p>
<ol>
<li>
Produce an IF file: <code>fop -fo myfile.fo -at application/pdf myfile.at.xml</code><br/>
Specifying "application/pdf" for the "-at" parameter causes FOP to use FOP's own
font subsystem (which is used by the PDF renderer). Note that no PDF file is created
in this step.
</li>
<li>Render to a PDF file: <code>fop -atin myfile.at.xml -pdf myfile.pdf</code></li>
<li>Render to a Java2D-based renderer:
<ul>
<li><code>fop -atin myfile.at.xml -print</code></li>
<li><code>fop -atin myfile.at.xml -awt</code></li>
<li><code>fop -atin myfile.at.xml -tiff myfile.tiff</code></li>
</ul>
</li>
</ol>
</section>
<section id="general-direct-output">
<title>Output to a Printer or Other Device</title>
@@ -105,7 +134,7 @@ out = proc.getOutputStream();]]></source>
<section id="pdf-postprocess">
<title>Post-processing</title>
<p>
FOP does not currently support several desirable PDF features: XMP metadata and watermarks.
FOP does not currently support several desirable PDF features: watermarks and signatures.
One workaround is to use Adobe Acrobat (the full version, not the Reader) to process
the file manually or with scripting that it supports.
</p>
@@ -661,8 +690,14 @@ out = proc.getOutputStream();]]></source>
<p>
JFOR, an open source XSL-FO to RTF converter has been integrated into Apache FOP.
This will create an RTF (rich text format) document that will
attempt to contain as much information from the fo document as
possible. The RTF output follows Microsoft's RTF specifications
attempt to contain as much information from the XSL-FO document as
possible. It should be noted that is not possible (due to RTF's limitations) to map all
XSL-FO features to RTF. For complex documents, the RTF output will never reach the feature
level from PDF, for example. Thus, using RTF output is only recommended for simple documents
such as letters.
</p>
<p>
The RTF output follows Microsoft's RTF specifications
and produces best results on Microsoft Word.
</p>
<note>RTF output is currently unmaintained and lacks many features compared to other output

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

@@ -20,7 +20,7 @@
<document>
<header>
<title>PDF/A (ISO 19005)</title>
<version>$Revision: 389563 $</version>
<version>$Revision$</version>
<authors>
<person name="Jeremias Märki" email="jeremias@apache.org"/>
</authors>

+ 3
- 2
src/documentation/poster/README.txt View File

@@ -5,7 +5,8 @@ created for OpenExpo '06 (http://www.openexpo.ch).

To create the PDF just call go.bat.

The fully reconstruct the PDF you need to copy some fonts into
the cfg directory. Please see the README.txt there for details.
The fully reconstruct the PDF you need some fonts installed in
your operating system: Verdana and Lucida Console which are
available in every Windows installation.

You will also need English hyphenation patterns.

+ 0
- 7
src/documentation/poster/cfg/README.txt View File

@@ -1,7 +0,0 @@
The following files are missing here for license reasons:

lucon.ttf - Lucida Console Font
verdana.ttf - Verdana Font
verdanab.ttf - Verdana Bold Font

They can be found in every MS Windows installation.

+ 0
- 1817
src/documentation/poster/cfg/VERDANA.ttf.xml
File diff suppressed because it is too large
View File


+ 0
- 1167
src/documentation/poster/cfg/VERDANAB.ttf.xml
File diff suppressed because it is too large
View File


+ 1
- 11
src/documentation/poster/cfg/fop.xconf View File

@@ -17,23 +17,13 @@
-->
<!-- $Id$ -->
<fop>
<base>.</base>
<source-resolution>72</source-resolution>
<target-resolution>300</target-resolution>
<default-page-settings height="11in" width="8.26in"/>
<renderers>
<renderer mime="application/pdf">
<!--output-profile>cfg/ISOuncoated.icc</output-profile-->
<fonts>
<font metrics-url="cfg\VERDANA.ttf.xml" kerning="yes" embed-url="cfg\VERDANA.ttf">
<font-triplet name="Verdana" style="normal" weight="normal"/>
</font>
<font metrics-url="cfg\VERDANAB.ttf.xml" kerning="yes" embed-url="cfg\VERDANAB.ttf">
<font-triplet name="Verdana" style="normal" weight="bold"/>
</font>
<font metrics-url="cfg\LUCON.ttf.xml" kerning="yes" embed-url="cfg\LUCON.ttf">
<font-triplet name="Lucida Console" style="normal" weight="normal"/>
</font>
<auto-detect/>
</fonts>
</renderer>
</renderers>

+ 0
- 925
src/documentation/poster/cfg/lucon.ttf.xml View File

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

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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- $Id$ -->
<font-metrics type="TYPE0">
<font-name>LucidaConsole</font-name>
<embed/>
<cap-height>626</cap-height>
<x-height>530</x-height>
<ascender>783</ascender>
<descender>-205</descender>
<bbox>
<left>0</left>
<bottom>-210</bottom>
<right>602</right>
<top>789</top>
</bbox>
<flags>35</flags>
<stemv>0</stemv>
<italicangle>0</italicangle>
<subtype>TYPE0</subtype>
<multibyte-extras>
<cid-type>CIDFontType2</cid-type>
<default-width>0</default-width>
<bfranges>
<bf us="32" ue="126" gi="3"/>
<bf us="160" ue="160" gi="172"/>
<bf us="161" ue="161" gi="163"/>
<bf us="162" ue="163" gi="132"/>
<bf us="164" ue="164" gi="188"/>
<bf us="165" ue="165" gi="150"/>
<bf us="166" ue="166" gi="230"/>
<bf us="167" ue="167" gi="134"/>
<bf us="168" ue="168" gi="142"/>
<bf us="169" ue="169" gi="139"/>
<bf us="170" ue="170" gi="157"/>
<bf us="171" ue="171" gi="169"/>
<bf us="172" ue="172" gi="164"/>
<bf us="173" ue="173" gi="256"/>
<bf us="174" ue="174" gi="138"/>
<bf us="175" ue="175" gi="257"/>
<bf us="176" ue="176" gi="131"/>
<bf us="177" ue="177" gi="147"/>
<bf us="178" ue="179" gi="240"/>
<bf us="180" ue="180" gi="141"/>
<bf us="181" ue="181" gi="151"/>
<bf us="182" ue="182" gi="136"/>
<bf us="183" ue="183" gi="258"/>
<bf us="184" ue="184" gi="220"/>
<bf us="185" ue="185" gi="239"/>
<bf us="186" ue="186" gi="158"/>
<bf us="187" ue="187" gi="170"/>
<bf us="188" ue="188" gi="243"/>
<bf us="189" ue="189" gi="242"/>
<bf us="190" ue="190" gi="244"/>
<bf us="191" ue="191" gi="162"/>
<bf us="192" ue="192" gi="173"/>
<bf us="193" ue="193" gi="200"/>
<bf us="194" ue="194" gi="198"/>
<bf us="195" ue="195" gi="174"/>
<bf us="196" ue="197" gi="98"/>
<bf us="198" ue="198" gi="144"/>
<bf us="199" ue="199" gi="100"/>
<bf us="200" ue="200" gi="202"/>
<bf us="201" ue="201" gi="101"/>
<bf us="202" ue="202" gi="199"/>
<bf us="203" ue="203" gi="201"/>
<bf us="204" ue="204" gi="206"/>
<bf us="205" ue="207" gi="203"/>
<bf us="208" ue="208" gi="231"/>
<bf us="209" ue="209" gi="102"/>
<bf us="210" ue="210" gi="209"/>
<bf us="211" ue="212" gi="207"/>
<bf us="213" ue="213" gi="175"/>
<bf us="214" ue="214" gi="103"/>
<bf us="215" ue="215" gi="238"/>
<bf us="216" ue="216" gi="145"/>
<bf us="217" ue="217" gi="212"/>
<bf us="218" ue="219" gi="210"/>
<bf us="220" ue="220" gi="104"/>
<bf us="221" ue="221" gi="233"/>
<bf us="222" ue="222" gi="235"/>
<bf us="223" ue="223" gi="137"/>
<bf us="224" ue="224" gi="106"/>
<bf us="225" ue="225" gi="105"/>
<bf us="226" ue="226" gi="107"/>
<bf us="227" ue="227" gi="109"/>
<bf us="228" ue="228" gi="108"/>
<bf us="229" ue="229" gi="110"/>
<bf us="230" ue="230" gi="160"/>
<bf us="231" ue="231" gi="111"/>
<bf us="232" ue="232" gi="113"/>
<bf us="233" ue="233" gi="112"/>
<bf us="234" ue="235" gi="114"/>
<bf us="236" ue="236" gi="117"/>
<bf us="237" ue="237" gi="116"/>
<bf us="238" ue="239" gi="118"/>
<bf us="240" ue="240" gi="232"/>
<bf us="241" ue="241" gi="120"/>
<bf us="242" ue="242" gi="122"/>
<bf us="243" ue="243" gi="121"/>
<bf us="244" ue="244" gi="123"/>
<bf us="245" ue="245" gi="125"/>
<bf us="246" ue="246" gi="124"/>
<bf us="247" ue="247" gi="184"/>
<bf us="248" ue="248" gi="161"/>
<bf us="249" ue="249" gi="127"/>
<bf us="250" ue="250" gi="126"/>
<bf us="251" ue="252" gi="128"/>
<bf us="253" ue="253" gi="234"/>
<bf us="254" ue="254" gi="236"/>
<bf us="255" ue="255" gi="186"/>
<bf us="256" ue="261" gi="259"/>
<bf us="262" ue="263" gi="251"/>
<bf us="264" ue="267" gi="265"/>
<bf us="268" ue="269" gi="253"/>
<bf us="270" ue="272" gi="269"/>
<bf us="273" ue="273" gi="255"/>
<bf us="274" ue="285" gi="272"/>
<bf us="286" ue="287" gi="246"/>
<bf us="288" ue="303" gi="284"/>
<bf us="304" ue="304" gi="248"/>
<bf us="305" ue="305" gi="213"/>
<bf us="306" ue="320" gi="300"/>
<bf us="321" ue="322" gi="224"/>
<bf us="323" ue="337" gi="315"/>
<bf us="338" ue="339" gi="176"/>
<bf us="340" ue="349" gi="330"/>
<bf us="350" ue="351" gi="249"/>
<bf us="352" ue="353" gi="226"/>
<bf us="354" ue="375" gi="340"/>
<bf us="376" ue="376" gi="187"/>
<bf us="377" ue="380" gi="362"/>
<bf us="381" ue="382" gi="228"/>
<bf us="383" ue="383" gi="366"/>
<bf us="402" ue="402" gi="166"/>
<bf us="506" ue="511" gi="367"/>
<bf us="710" ue="710" gi="214"/>
<bf us="711" ue="711" gi="223"/>
<bf us="713" ue="713" gi="216"/>
<bf us="728" ue="730" gi="217"/>
<bf us="731" ue="731" gi="222"/>
<bf us="732" ue="732" gi="215"/>
<bf us="733" ue="733" gi="221"/>
<bf us="894" ue="894" gi="373"/>
<bf us="900" ue="906" gi="374"/>
<bf us="908" ue="908" gi="381"/>
<bf us="910" ue="929" gi="382"/>
<bf us="931" ue="959" gi="402"/>
<bf us="960" ue="960" gi="155"/>
<bf us="961" ue="974" gi="431"/>
<bf us="1025" ue="1036" gi="445"/>
<bf us="1038" ue="1103" gi="457"/>
<bf us="1105" ue="1116" gi="523"/>
<bf us="1118" ue="1119" gi="535"/>
<bf us="1168" ue="1169" gi="537"/>
<bf us="7808" ue="7813" gi="539"/>
<bf us="7922" ue="7923" gi="545"/>
<bf us="8211" ue="8212" gi="178"/>
<bf us="8213" ue="8213" gi="547"/>
<bf us="8215" ue="8215" gi="548"/>
<bf us="8216" ue="8217" gi="182"/>
<bf us="8218" ue="8218" gi="195"/>
<bf us="8220" ue="8221" gi="180"/>
<bf us="8222" ue="8222" gi="196"/>
<bf us="8224" ue="8224" gi="130"/>
<bf us="8225" ue="8225" gi="193"/>
<bf us="8226" ue="8226" gi="135"/>
<bf us="8230" ue="8230" gi="171"/>
<bf us="8240" ue="8240" gi="197"/>
<bf us="8249" ue="8250" gi="189"/>
<bf us="8252" ue="8252" gi="549"/>
<bf us="8254" ue="8254" gi="550"/>
<bf us="8260" ue="8260" gi="551"/>
<bf us="8319" ue="8319" gi="552"/>
<bf us="8355" ue="8355" gi="245"/>
<bf us="8356" ue="8356" gi="553"/>
<bf us="8359" ue="8359" gi="554"/>
<bf us="8364" ue="8364" gi="665"/>
<bf us="8470" ue="8470" gi="555"/>
<bf us="8482" ue="8482" gi="140"/>
<bf us="8486" ue="8486" gi="159"/>
<bf us="8539" ue="8542" gi="556"/>
<bf us="8592" ue="8597" gi="560"/>
<bf us="8616" ue="8616" gi="566"/>
<bf us="8706" ue="8706" gi="152"/>
<bf us="8710" ue="8710" gi="168"/>
<bf us="8719" ue="8719" gi="154"/>
<bf us="8721" ue="8721" gi="153"/>
<bf us="8722" ue="8722" gi="237"/>
<bf us="8729" ue="8729" gi="194"/>
<bf us="8730" ue="8730" gi="165"/>
<bf us="8734" ue="8734" gi="146"/>
<bf us="8735" ue="8735" gi="567"/>
<bf us="8745" ue="8745" gi="568"/>
<bf us="8747" ue="8747" gi="156"/>
<bf us="8776" ue="8776" gi="167"/>
<bf us="8800" ue="8800" gi="143"/>
<bf us="8801" ue="8801" gi="569"/>
<bf us="8804" ue="8805" gi="148"/>
<bf us="8962" ue="8962" gi="570"/>
<bf us="8976" ue="8976" gi="571"/>
<bf us="8992" ue="8993" gi="572"/>
<bf us="9472" ue="9472" gi="574"/>
<bf us="9474" ue="9474" gi="575"/>
<bf us="9484" ue="9484" gi="576"/>
<bf us="9488" ue="9488" gi="577"/>
<bf us="9492" ue="9492" gi="578"/>
<bf us="9496" ue="9496" gi="579"/>
<bf us="9500" ue="9500" gi="580"/>
<bf us="9508" ue="9508" gi="581"/>
<bf us="9516" ue="9516" gi="582"/>
<bf us="9524" ue="9524" gi="583"/>
<bf us="9532" ue="9532" gi="584"/>
<bf us="9552" ue="9580" gi="585"/>
<bf us="9600" ue="9600" gi="614"/>
<bf us="9604" ue="9604" gi="615"/>
<bf us="9608" ue="9608" gi="616"/>
<bf us="9612" ue="9612" gi="617"/>
<bf us="9616" ue="9619" gi="618"/>
<bf us="9632" ue="9632" gi="622"/>
<bf us="9644" ue="9644" gi="623"/>
<bf us="9650" ue="9650" gi="624"/>
<bf us="9658" ue="9658" gi="625"/>
<bf us="9660" ue="9660" gi="626"/>
<bf us="9668" ue="9668" gi="627"/>
<bf us="9674" ue="9674" gi="185"/>
<bf us="9675" ue="9675" gi="628"/>
<bf us="9688" ue="9689" gi="629"/>
<bf us="9786" ue="9788" gi="631"/>
<bf us="9792" ue="9792" gi="634"/>
<bf us="9794" ue="9794" gi="635"/>
<bf us="9824" ue="9824" gi="636"/>
<bf us="9827" ue="9827" gi="637"/>
<bf us="9829" ue="9830" gi="638"/>
<bf us="9834" ue="9835" gi="640"/>
<bf us="61443" ue="61453" gi="642"/>
<bf us="63512" ue="63523" gi="653"/>
<bf us="64257" ue="64258" gi="191"/>
<bf us="65535" ue="65535" gi="0"/>
</bfranges>
<cid-widths start-index="0">
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="602"/>
<wx w="603"/>
</cid-widths>
</multibyte-extras>
</font-metrics>

+ 2
- 1
src/documentation/poster/svg/pepe-business-card.svg View File

@@ -16,7 +16,8 @@
limitations under the License.
-->
<!-- $Id$ -->
<svg xml:space="preserve" x="-3.05102in" y="-2.2459in" width="3.31009in" height="2.08961in"
<svg xmlns="http://www.w3.org/2000/svg"
xml:space="preserve" x="-3.05102in" y="-2.2459in" width="3.31009in" height="2.08961in"
style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality" viewBox="-30510 0 33101 20896">
<g>
<g>

+ 10
- 9
src/documentation/poster/xml/business-card-demo.xml View File

@@ -37,13 +37,13 @@
<fo:instream-foreign-object xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg:svg width="150mm" height="70mm" viewBox="0 0 150 70">
<svg:g transform="rotate(-7)">
<svg:image x="0" y="12" width="84" height="53" xlink:href="svg/pepe-business-card.svg"/>
<svg:image x="0" y="12" width="84" height="53" xlink:href="../svg/pepe-business-card.svg"/>
</svg:g>
</svg:svg>
</fo:instream-foreign-object>
</p>
<fo:block-container absolute-position="absolute" left="80mm" top="20mm" width="2cm" height="10cm">
<fo:block>
<fo:block-container absolute-position="absolute" left="80mm" top="20mm" width="3cm" height="10cm">
<fo:block font-size="0" line-height="0">
<fo:instream-foreign-object xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<svg xmlns="http://www.w3.org/2000/svg" version="1.0" width="1.8cm" height="10cm" viewBox="0 0 20 100">
<defs>
@@ -65,11 +65,11 @@
</fo:instream-foreign-object>
</fo:block>
</fo:block-container>
<fo:block-container absolute-position="absolute" width="100%" height="100%">
<fo:block start-indent="112mm">
<p>The XSLT stylesheet which contains the rules to convert the business card XML to XSL-FO:</p>
<fo:block text-align="start" font-family="'Lucida Console'" font-size="10pt" white-space="pre"
><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<fo:block-container absolute-position="absolute" width="100%">
<fo:block start-indent="112mm">
<p>The XSLT stylesheet which contains the rules to convert the business card XML to XSL-FO:</p>
<fo:block text-align="start" font-family="'Lucida Console'" font-size="10pt" white-space="pre"
><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
@@ -77,7 +77,8 @@
<xsl:template match="/">
<fo:root font-family="Helvetica" font-size="10pt">
<fo:layout-master-set>
<fo:simple-page-master master-name="bc" page-height="53mm" page-width="84mm" margin="3mm">
<fo:simple-page-master master-name="bc"
page-height="53mm" page-width="84mm" margin="3mm">
<fo:region-body/>
</fo:simple-page-master>
</fo:layout-master-set>

+ 5
- 6
src/documentation/poster/xml/fop-history.xml View File

@@ -39,13 +39,12 @@
</p>
<p>
In 2005, the redesign finally took a leap forward, which resulted in the first release from
the new codebase (FOP&#160;0.90alpha). Shortly thereafter, FOP&#160;0.91beta was released in December
2005 and FOP&#160;0.92beta in April&#160;2006. Although 0.92beta still carries the beta tag,
it has many advantages over the old version 0.20.5.
the new codebase (FOP&#160;0.90alpha). The project team has published a number of releases
since then. FOP made big steps forward.
</p>
<p>
The next version, to be released shortly, will be 0.93. This version should be the last release
before the long-awaited version 1.0, for which the team only has to implement a handful of
additional features.
The next version, to be released in March&#160;2008, will be 0.95. Although FOP still carries
pre&#160;1.0 version numbers it is production-ready. Some features are still missing before
version&#160;1.0 can be released.
</p>
</section>

+ 5
- 5
src/documentation/poster/xml/fop-poster.xml View File

@@ -21,11 +21,11 @@
<section href="fop-overview.xml" width="165" height="118"/>
<section href="fop-output-formats.xml" width="165" height="103"/>
<section href="fop-foreign-xml-support.xml" width="165" height="55"/>
<section href="fop-image-support.xml" width="165" height="65"/>
<section href="fop-use-cases.xml" width="165" height="96"/>
<section href="fop-history.xml" width="165" height="181"/>
<section href="fop-image-support.xml" width="165" height="66"/>
<section href="fop-use-cases.xml" width="165" height="98"/>
<section href="fop-history.xml" width="165" height="180"/>
<section href="fop-getting-help.xml" width="165" height="67"/>
<section href="fop-transformation-chain.xml" width="335" height="167"/>
<section href="fop-transformation-chain.xml" width="335" height="166"/>
<!-- section href="hello-world-in-fo.xml" width="165" height="115"/-->
<section href="business-card-demo.xml" width="335" height="181"/>
<section href="business-card-demo.xml" width="335" height="185"/>
</poster>

+ 1
- 1
src/documentation/poster/xml/fop-transformation-chain.xml View File

@@ -19,7 +19,7 @@
<section xmlns:fo="http://www.w3.org/1999/XSL/Format">
<title tab-width="80">Transformation Chain</title>
<fo:block space-before="10pt" space-before.conditionality="retain" space-after="10pt" text-align="center">
<fo:external-graphic src="svg/fop-transformation-chain.svg" width="70%" content-width="scale-to-fit"/>
<fo:external-graphic src="../svg/fop-transformation-chain.svg" width="70%" content-width="scale-to-fit"/>
</fo:block>
<p>
This diagram shows a complete transformation chain (exemplary). It begins with your data source,

+ 1
- 2
src/documentation/poster/xml/fop-use-cases.xml View File

@@ -19,8 +19,7 @@
<section xmlns:fo="http://www.w3.org/1999/XSL/Format">
<title tab-width="50">Use Cases</title>
<fo:table table-layout="fixed" width="100%" border-collapse="separate">
<fo:table-column/>
<fo:table-column/>
<fo:table-column column-width="proportional-column-width(1)" number-columns-repeated="2"/>
<fo:table-header>
<fo:table-row font-weight="bold">
<fo:table-cell border-bottom="solid 0.5mm black">

+ 3
- 3
src/documentation/poster/xslt/common.xsl View File

@@ -37,14 +37,14 @@
<xsl:choose>
<xsl:when test="ancestor::li and not(preceding-sibling::*)">
<fo:block
space-after="4pt">
space-after.optimum="0.3em" space-after.maximum="1em">
<xsl:apply-templates/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:block
space-before="4pt"
space-after="4pt">
space-before.optimum="0.3em" space-before.maximum="1em"
space-after.optimum="0.3em" space-after.maximum="1em">
<xsl:apply-templates/>
</fo:block>
</xsl:otherwise>

+ 6
- 7
src/documentation/poster/xslt/fop-poster.xsl View File

@@ -60,9 +60,6 @@
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="section"/>
<fo:block-container width="1cm" height="5cm">
<fo:block/>
</fo:block-container>
</fo:flow>
</fo:page-sequence>
</fo:root>
@@ -84,14 +81,14 @@
<path
d="M 840,575 L 280,575 c -40,0 -60,-50 -100,-50 L 0,525"
style="fill:none; stroke:blue; stroke-width:5;" />
<image x="680" y="7" width="140" height="60" xlink:href="svg/fop-logo-reconstructed.svg"/>
<image x="680" y="7" width="140" height="60" xlink:href="../svg/fop-logo-reconstructed.svg"/>
<text x="15" y="35" style="fill:black; font-weight:bold; font-size:17">
Apache FOP - The leading open source XSL-FO formatter
</text>
<text x="685" y="74" style="fill:black; font-size:5.5">
A product of the Apache XML Graphics Project
</text>
<image x="15" y="530" width="160" height="60" xlink:href="svg/asf-logo.svg"/>
<image x="15" y="530" width="160" height="60" xlink:href="../svg/asf-logo.svg"/>
<text x="360" y="560" style="fill:blue; font-size:12">
For more details, please visit: <a xlink:href="http://xmlgraphics.apache.org/fop/">http://xmlgraphics.apache.org/fop/</a>
</text>
@@ -111,7 +108,7 @@
</xsl:template>
<xsl:template match="section">
<xsl:variable name="section-content" select="exslt:node-set(document(@href))"/>
<xsl:variable name="section-content" select="exslt:node-set(document(@href, .))"/>
<fo:block
space-before.minimum="2mm" space-before.optimum="5mm" space-before.maximum="30mm"
space-before.conditionality="discard" space-after.conditionality="discard"
@@ -129,7 +126,9 @@
</fo:instream-foreign-object>
</fo:block>
</fo:block-container>
<fo:block-container width="{@width}mm - 8mm" height="{@height}mm - 20mm" padding="4mm" padding-top="16mm" margin="0pt">
<fo:block-container width="{@width}mm - 8mm" height="{@height}mm - 24mm"
padding="4mm" padding-top="16mm" padding-bottom="8mm" margin="0pt"
display-align="distribute" id="section{position()}">
<fo:block>
<xsl:apply-templates select="$section-content/section/*[local-name() != 'title']"/>
</fo:block>

+ 6
- 37
src/documentation/sitemap.xmap View File

@@ -20,44 +20,13 @@
</map:components>

<map:pipelines>
<map:pipeline>
<map:match type="regexp" pattern="^(.*?)([^/]*)changes.xml$">
<map:generate type="file" src="{project:status}" />
<map:transform src="resources/stylesheets/changes2document.xsl" >
<map:parameter name="bugtracking-url" value="{defaults:bugtracking-url}"/>
<map:parameter name="path" value="{1}{2}"/>
</map:transform>
<map:serialize type="xml-document"/>
</map:match>
<map:match type="regexp" pattern="^(.*?)([^/]*)changes_(.*).xml$">
<map:generate type="file" src="{project:status}" />
<map:transform src="resources/stylesheets/changes2document.xsl" >
<map:parameter name="bugtracking-url" value="{defaults:bugtracking-url}"/>
<map:parameter name="path" value="{1}{2}"/>
<map:parameter name="versionNumber" value="{3}"/>
</map:transform>
<map:serialize type="xml-document"/>
</map:match>

<map:match type="regexp" pattern="^(.*?)([^/]*)releaseNotes_(.*).xml$">
<map:generate type="file" src="{project:status}" />
<map:transform src="resources/stylesheets/releaseNotes2document.xsl">
<map:parameter name="versionNumber" value="{3}"/>
<map:parameter name="path" value="{1}{2}"/>
</map:transform>
<map:serialize type="xml-document"/>
</map:match>

</map:pipeline>
<!-- This is used by xinclude statements in knownissues.xml -->
<map:pipeline internal-only="true">
<map:match type="regexp" pattern="^(.*?)([^/]*)knownissues-raw-layoutengine.xml$">
<map:generate type="file" src="../../test/layoutengine/disabled-testcases.xml"/>
<map:transform src="resources/stylesheets/disabled-testcases2document.xsl" >
<map:parameter name="bugtracking-url" value="{defaults:bugtracking-url}"/>
<map:parameter name="bugtracking-url" value="{properties:bugtracking-url}"/>
<map:parameter name="path" value="{1}{2}"/>
</map:transform>
<map:serialize type="xml-document"/>
@@ -65,13 +34,13 @@
<map:match type="regexp" pattern="^(.*?)([^/]*)knownissues-raw-fotree.xml$">
<map:generate type="file" src="../../test/fotree/disabled-testcases.xml"/>
<map:transform src="resources/stylesheets/disabled-testcases2document.xsl" >
<map:parameter name="bugtracking-url" value="{defaults:bugtracking-url}"/>
<map:parameter name="bugtracking-url" value="{properties:bugtracking-url}"/>
<map:parameter name="path" value="{1}{2}"/>
</map:transform>
<map:serialize type="xml-document"/>
</map:match>
<map:match type="regexp" pattern="^(.*?)([^/]*)knownissues-raw-static.xml$">
<!--<map:generate type="file" src="{project:knownissues}"/>-->
<!--<map:generate type="file" src="{properties:knownissues}"/>-->
<map:generate type="file" src="../../known-issues.xml"/>
<map:transform src="resources/stylesheets/known-issues2document.xsl"/>
<map:serialize type="xml-document"/>
@@ -80,7 +49,7 @@
<map:match type="regexp" pattern="^(.*?)([^/]*)knownissues-raw-layoutengine_(.*).xml$">
<map:generate type="file" src="content/xdocs/{3}/layoutengine/disabled-testcases.xml"/>
<map:transform src="resources/stylesheets/disabled-testcases2document.xsl" >
<map:parameter name="bugtracking-url" value="{defaults:bugtracking-url}"/>
<map:parameter name="bugtracking-url" value="{properties:bugtracking-url}"/>
<map:parameter name="path" value="{1}{2}"/>
</map:transform>
<map:serialize type="xml-document"/>
@@ -88,13 +57,13 @@
<map:match type="regexp" pattern="^(.*?)([^/]*)knownissues-raw-fotree_(.*).xml$">
<map:generate type="file" src="content/xdocs/{3}/fotree/disabled-testcases.xml"/>
<map:transform src="resources/stylesheets/disabled-testcases2document.xsl" >
<map:parameter name="bugtracking-url" value="{defaults:bugtracking-url}"/>
<map:parameter name="bugtracking-url" value="{properties:bugtracking-url}"/>
<map:parameter name="path" value="{1}{2}"/>
</map:transform>
<map:serialize type="xml-document"/>
</map:match>
<map:match type="regexp" pattern="^(.*?)([^/]*)knownissues-raw-static_(.*).xml$">
<!--<map:generate type="file" src="{project:knownissues}"/>-->
<!--<map:generate type="file" src="{properties:knownissues}"/>-->
<map:generate type="file" src="content/xdocs/{3}/known-issues.xml"/>
<map:transform src="resources/stylesheets/known-issues2document.xsl"/>
<map:serialize type="xml-document"/>

+ 13
- 6
src/documentation/skinconf.xml View File

@@ -91,7 +91,7 @@ which will be used to configure the chosen Forrest skin.
<favicon-url></favicon-url>

<!-- The following used to construct a copyright statement -->
<year>1999-2007</year>
<year>1999-2008</year>
<vendor>The Apache Software Foundation.</vendor>
<copyright-link>http://www.apache.org/licenses/</copyright-link>
@@ -311,8 +311,8 @@ which will be used to configure the chosen Forrest skin.
portrait).
Supported text alignments are left, right, justify (default left).
-->
<page size="letter" orientation="portrait" text-align="left"/>
<page size="letter" orientation="portrait" text-align="justify"/>
<page-numbering-format>1</page-numbering-format>
<!--
Margins can be specified for top, bottom, inner, and outer
edges. If double-sided="false", the inner edge is always left
@@ -322,10 +322,10 @@ which will be used to configure the chosen Forrest skin.
Specified below are the default settings.
-->
<margins double-sided="false">
<top>1in</top>
<bottom>1in</bottom>
<top>0.5in</top>
<bottom>0.5in</bottom>
<inner>1in</inner>
<outer>1in</outer>
<outer>0.5in</outer>
</margins>

<!--
@@ -375,6 +375,13 @@ which will be used to configure the chosen Forrest skin.
<width>125</width>
<height>125</height>
</credit>
<credit box-location="alt2">
<name>ApacheCon US 2008</name>
<url>http://us.apachecon.com/</url>
<image>http://apache.org/ads/ApacheCon/2008-usa-125x125.png</image>
<width>125</width>
<height>125</height>
</credit>
<credit role="pdf">
<name>PDF created by Apache FOP</name>

+ 1
- 1
src/java/org/apache/fop/Version.java View File

@@ -41,7 +41,7 @@ public final class Version {
if (version == null) {
//Fallback if FOP is used in a development environment
String headURL
= "$HeadURL$";
= "$HeadURL: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ImagePackageRedesign/src/java/org/apache/fop/Version.java $";
version = headURL;
final String pathPrefix = "/xmlgraphics/fop/";
int pos = version.indexOf(pathPrefix);

+ 1
- 36
src/java/org/apache/fop/apps/FOUserAgent.java View File

@@ -42,11 +42,9 @@ import org.apache.fop.events.EventBroadcaster;
import org.apache.fop.events.EventListener;
import org.apache.fop.fo.FOEventHandler;
import org.apache.fop.fo.FOValidationEventListenerProxy;
import org.apache.fop.pdf.PDFEncryptionParams;
import org.apache.fop.render.Renderer;
import org.apache.fop.render.RendererFactory;
import org.apache.fop.render.XMLHandlerRegistry;
import org.apache.fop.render.pdf.PDFRenderer;

/**
* This is the user agent for FOP.
@@ -72,7 +70,7 @@ public class FOUserAgent {

/** Defines the default target resolution (72dpi) for FOP */
public static final float DEFAULT_TARGET_RESOLUTION
= FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION;
= FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION;

private static Log log = LogFactory.getLog("FOP");

@@ -136,16 +134,6 @@ public class FOUserAgent {
};
/**
* Default constructor
* @see org.apache.fop.apps.FopFactory
* @deprecated Provided for compatibility only. Please use the methods from
* FopFactory to construct FOUserAgent instances!
*/
public FOUserAgent() throws FOPException {
this(FopFactory.newInstance());
}
/**
* Main constructor. <b>This constructor should not be called directly. Please use the
* methods from FopFactory to construct FOUserAgent instances!</b>
@@ -348,29 +336,6 @@ public class FOUserAgent {
return this.uriResolver;
}

/**
* Returns the parameters for PDF encryption.
* @return the PDF encryption parameters, null if not applicable
* @deprecated Use (PDFEncryptionParams)getRendererOptions().get("encryption-params")
* instead.
*/
public PDFEncryptionParams getPDFEncryptionParams() {
return (PDFEncryptionParams)getRendererOptions().get(PDFRenderer.ENCRYPTION_PARAMS);
}

/**
* Sets the parameters for PDF encryption.
* @param pdfEncryptionParams the PDF encryption parameters, null to
* disable PDF encryption
* @deprecated Use getRendererOptions().put("encryption-params",
* new PDFEncryptionParams(..)) instead or set every parameter separately:
* getRendererOptions().put("noprint", Boolean.TRUE).
*/
public void setPDFEncryptionParams(PDFEncryptionParams pdfEncryptionParams) {
getRendererOptions().put(PDFRenderer.ENCRYPTION_PARAMS, pdfEncryptionParams);
}


/**
* Attempts to resolve the given URI.
* Will use the configured resolver and if not successful fall back

+ 4
- 60
src/java/org/apache/fop/apps/Fop.java View File

@@ -22,10 +22,8 @@ package org.apache.fop.apps;
// Java
import java.io.OutputStream;

// XML
import org.xml.sax.helpers.DefaultHandler;

// FOP
import org.apache.fop.fo.FOTreeBuilder;

/**
@@ -66,10 +64,8 @@ public class Fop {
* @param ua FOUserAgent object
* @param stream the output stream
* @throws FOPException if setting up the DefaultHandler fails
* @deprecated End-users should use {@link FopFactory#newFop(String, FOUserAgent, OutputStream)}
* instead! This constructor will become invisible with FOP 1.0.
*/
public Fop(String outputFormat, FOUserAgent ua, OutputStream stream) throws FOPException {
Fop(String outputFormat, FOUserAgent ua, OutputStream stream) throws FOPException {
this.outputFormat = outputFormat;

foUserAgent = ua;
@@ -83,56 +79,13 @@ public class Fop {
}

/**
* Constructor for use with already-created FOUserAgents. It uses MIME types to select the
* output format (ex. "application/pdf" for PDF).
* @param outputFormat the MIME type of the output format to use (ex. "application/pdf").
* @param ua FOUserAgent object
* @throws FOPException if setting up the DefaultHandler fails
* @deprecated End-users should use {@link FopFactory#newFop(String, FOUserAgent)} instead!
* This constructor will become invisible with FOP 1.0.
*/
public Fop(String outputFormat, FOUserAgent ua) throws FOPException {
this.outputFormat = outputFormat;

foUserAgent = ua;
if (foUserAgent == null) {
foUserAgent = FopFactory.newInstance().newFOUserAgent();
}
createDefaultHandler();
}

/**
* Constructor for FOP with a default FOUserAgent. It uses MIME types to select the
* output format (ex. "application/pdf" for PDF).
* @param outputFormat the MIME type of the output format to use (ex. "application/pdf").
* @deprecated End-users should use {@link FopFactory#newFop(String)} instead!
* This constructor will become invisible with FOP 1.0.
*/
public Fop(String outputFormat) {
this.outputFormat = outputFormat;
foUserAgent = FopFactory.newInstance().newFOUserAgent();
}

/**
* Get the FOUserAgent instance for this process
* Get the FOUserAgent instance associated with the rendering run represented by this instance.
* @return the user agent
*/
public FOUserAgent getUserAgent() {
return foUserAgent;
}

/**
* Set the OutputStream to use to output the result of the Render
* (if applicable)
* @param stream the stream to output the result of rendering to
* @deprecated Use one of the factory methods on {@link FopFactory} with an OutputStream
* parameter instead. This method will be removed with FOP 1.0.
*/
public void setOutputStream(OutputStream stream) {
this.stream = stream;
}

/**
* Creates a DefaultHandler object used to generate the document.
* Note this object implements the ContentHandler interface.
@@ -148,8 +101,8 @@ public class Fop {
}

/**
* Returns the DefaultHandler object used to generate the document.
* Checking for null and the exception is only for the deprecated constructor.
* Returns the DefaultHandler object that will receive the SAX stream containing the
* FO document to be rendered.
* @return the SAX DefaultHandler for handling the SAX events.
* @throws FOPException if setting up the DefaultHandler fails
*/
@@ -178,13 +131,4 @@ public class Fop {
}
}

/**
* Get the version of FOP
* @return the version string
* @deprecated Use {@link org.apache.fop.Version#getVersion()} instead!
* This method will be removed with FOP 1.0.
*/
public static String getVersion() {
return org.apache.fop.Version.getVersion();
}
}

+ 17
- 20
src/java/org/apache/fop/apps/FopFactory.java View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/

/* $Id: $ */
/* $Id$ */

package org.apache.fop.apps;

@@ -195,7 +195,7 @@ public class FopFactory implements ImageContext {
* @throws FOPException when the constructor fails
*/
public Fop newFop(String outputFormat) throws FOPException {
return new Fop(outputFormat, newFOUserAgent());
return newFop(outputFormat, newFOUserAgent());
}

/**
@@ -212,10 +212,7 @@ public class FopFactory implements ImageContext {
* @throws FOPException when the constructor fails
*/
public Fop newFop(String outputFormat, FOUserAgent userAgent) throws FOPException {
if (userAgent == null) {
throw new NullPointerException("The userAgent parameter must not be null!");
}
return new Fop(outputFormat, userAgent);
return newFop(outputFormat, userAgent, null);
}
/**
@@ -230,7 +227,7 @@ public class FopFactory implements ImageContext {
* @throws FOPException when the constructor fails
*/
public Fop newFop(String outputFormat, OutputStream stream) throws FOPException {
return new Fop(outputFormat, newFOUserAgent(), stream);
return newFop(outputFormat, newFOUserAgent(), stream);
}

/**
@@ -333,11 +330,10 @@ public class FopFactory implements ImageContext {
}

/**
* cleans the base url
* @param base
* @return
* @throws MalformedURLException
* @throws URISyntaxException
* Checks if the given base URL is acceptable. It also normalizes the URL.
* @param base the base URL to check
* @return the normalized URL
* @throws MalformedURLException if there's a problem with a file URL
*/
private String checkBaseURL(String base) throws MalformedURLException {
if (!base.endsWith("/")) {
@@ -364,8 +360,7 @@ public class FopFactory implements ImageContext {
/**
* Sets the base URL.
* @param base base URL
* @throws MalformedURLException
* @throws URISyntaxException
* @throws MalformedURLException if there's a problem with a file URL
*/
public void setBaseURL(String base) throws MalformedURLException {
this.base = checkBaseURL(base);
@@ -382,8 +377,7 @@ public class FopFactory implements ImageContext {
/**
* Sets the font base URL.
* @param fontBase font base URL
* @throws MalformedURLException
* @throws URISyntaxException
* @throws MalformedURLException if there's a problem with a file URL
*/
public void setFontBaseURL(String fontBase) throws MalformedURLException {
this.fontBase = checkBaseURL(fontBase);
@@ -402,8 +396,7 @@ public class FopFactory implements ImageContext {
/**
* Sets the hyphen base URL.
* @param hyphenBase hythen base URL
* @throws MalformedURLException
* @throws URISyntaxException
* @throws MalformedURLException if there's a problem with a file URL
* */
public void setHyphenBaseURL(final String hyphenBase) throws MalformedURLException {
if (hyphenBase != null) {
@@ -440,8 +433,8 @@ public class FopFactory implements ImageContext {
}
/**
* sets the HyphenationTreeResolver
* @param hyphResolver
* Sets the HyphenationTreeResolver to be used for resolving user-supplied hyphenation files.
* @param hyphResolver the HyphenationTreeResolver instance
*/
public void setHyphenationTreeResolver(HyphenationTreeResolver hyphResolver) {
this.hyphResolver = hyphResolver;
@@ -724,6 +717,10 @@ public class FopFactory implements ImageContext {
return (this.fontCache != null);
}

/**
* Returns the font cache instance used by this factory.
* @return the font cache
*/
public FontCache getFontCache() {
return this.fontCache;
}

+ 1
- 1
src/java/org/apache/fop/apps/FopFactoryConfigurator.java View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/

/* $Id: $ */
/* $Id$ */

package org.apache.fop.apps;


+ 85
- 85
src/java/org/apache/fop/apps/FormattingResults.java View File

@@ -1,85 +1,85 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.apps;
import java.util.List;
import org.apache.fop.fo.pagination.AbstractPageSequence;
/**
* Class for reporting back formatting results to the calling application.
*/
public class FormattingResults {
private int pageCount = 0;
private List pageSequences = null;
/**
* Constructor for the FormattingResults object
*/
public FormattingResults() {
}
/**
* Gets the number of pages rendered
*
* @return The number of pages overall
*/
public int getPageCount() {
return this.pageCount;
}
/**
* Gets the results for the individual page-sequences.
*
* @return A List with PageSequenceResults objects
*/
public List getPageSequences() {
return this.pageSequences;
}
/**
* Resets this object
*/
public void reset() {
this.pageCount = 0;
if (this.pageSequences != null) {
this.pageSequences.clear();
}
}
/**
* Reports the result of one page sequence rendering
* back into this object.
*
* @param pageSequence the page sequence which just completed rendering
* @param pageCount the number of pages rendered for that PageSequence
*/
public void haveFormattedPageSequence(AbstractPageSequence pageSequence, int pageCount) {
this.pageCount += pageCount;
if (this.pageSequences == null) {
this.pageSequences = new java.util.ArrayList();
}
this.pageSequences.add(
new PageSequenceResults(pageSequence.getId(),
pageCount));
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.apps;
import java.util.List;
import org.apache.fop.fo.pagination.AbstractPageSequence;
/**
* Class for reporting back formatting results to the calling application.
*/
public class FormattingResults {
private int pageCount = 0;
private List pageSequences = null;
/**
* Constructor for the FormattingResults object
*/
public FormattingResults() {
}
/**
* Gets the number of pages rendered
*
* @return The number of pages overall
*/
public int getPageCount() {
return this.pageCount;
}
/**
* Gets the results for the individual page-sequences.
*
* @return A List with PageSequenceResults objects
*/
public List getPageSequences() {
return this.pageSequences;
}
/**
* Resets this object
*/
public void reset() {
this.pageCount = 0;
if (this.pageSequences != null) {
this.pageSequences.clear();
}
}
/**
* Reports the result of one page sequence rendering
* back into this object.
*
* @param pageSequence the page sequence which just completed rendering
* @param pageCount the number of pages rendered for that PageSequence
*/
public void haveFormattedPageSequence(AbstractPageSequence pageSequence, int pageCount) {
this.pageCount += pageCount;
if (this.pageSequences == null) {
this.pageSequences = new java.util.ArrayList();
}
this.pageSequences.add(
new PageSequenceResults(pageSequence.getId(),
pageCount));
}
}

+ 80
- 80
src/java/org/apache/fop/apps/MimeConstants.java View File

@@ -1,80 +1,80 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.apps;
/**
* Frequently used MIME types for various file formats used when working with Apache FOP.
*/
public interface MimeConstants {
/** Portable Document Format */
String MIME_PDF = "application/pdf";
/** PostScript */
String MIME_POSTSCRIPT = "application/postscript";
/** Encapsulated PostScript (same MIME type as PostScript) */
String MIME_EPS = MIME_POSTSCRIPT;
/** HP's PCL */
String MIME_PCL = "application/x-pcl";
/** HP's PCL (alternative MIME type) */
String MIME_PCL_ALT = "application/vnd.hp-PCL";
/** IBM's AFP */
String MIME_AFP = "application/x-afp";
/** IBM's AFP (alternative MIME type) */
String MIME_AFP_ALT = "application/vnd.ibm.modcap";
/** Plain text */
String MIME_PLAIN_TEXT = "text/plain";
/** Rich text format */
String MIME_RTF = "application/rtf";
/** Rich text format (alternative 1) */
String MIME_RTF_ALT1 = "text/richtext";
/** Rich text format (alternative 2) */
String MIME_RTF_ALT2 = "text/rtf";
/** FrameMaker's MIF */
String MIME_MIF = "application/mif";
/** Structured Vector Graphics */
String MIME_SVG = "image/svg+xml";
/** GIF images */
String MIME_GIF = "image/gif";
/** PNG images */
String MIME_PNG = "image/png";
/** JPEG images */
String MIME_JPEG = "image/jpeg";
/** TIFF images */
String MIME_TIFF = "image/tiff";
/** Apache FOP's AWT preview (non-standard MIME type) */
String MIME_FOP_AWT_PREVIEW = "application/X-fop-awt-preview";
/** Apache FOP's Direct Printing (non-standard MIME type) */
String MIME_FOP_PRINT = "application/X-fop-print";
/** Apache FOP's area tree XML */
String MIME_FOP_AREA_TREE = "application/X-fop-areatree";
/** Proposed but non-registered MIME type for XSL-FO */
String MIME_XSL_FO = "text/xsl";
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.apps;
/**
* Frequently used MIME types for various file formats used when working with Apache FOP.
*/
public interface MimeConstants {
/** Portable Document Format */
String MIME_PDF = "application/pdf";
/** PostScript */
String MIME_POSTSCRIPT = "application/postscript";
/** Encapsulated PostScript (same MIME type as PostScript) */
String MIME_EPS = MIME_POSTSCRIPT;
/** HP's PCL */
String MIME_PCL = "application/x-pcl";
/** HP's PCL (alternative MIME type) */
String MIME_PCL_ALT = "application/vnd.hp-PCL";
/** IBM's AFP */
String MIME_AFP = "application/x-afp";
/** IBM's AFP (alternative MIME type) */
String MIME_AFP_ALT = "application/vnd.ibm.modcap";
/** Plain text */
String MIME_PLAIN_TEXT = "text/plain";
/** Rich text format */
String MIME_RTF = "application/rtf";
/** Rich text format (alternative 1) */
String MIME_RTF_ALT1 = "text/richtext";
/** Rich text format (alternative 2) */
String MIME_RTF_ALT2 = "text/rtf";
/** FrameMaker's MIF */
String MIME_MIF = "application/mif";
/** Structured Vector Graphics */
String MIME_SVG = "image/svg+xml";
/** GIF images */
String MIME_GIF = "image/gif";
/** PNG images */
String MIME_PNG = "image/png";
/** JPEG images */
String MIME_JPEG = "image/jpeg";
/** TIFF images */
String MIME_TIFF = "image/tiff";
/** Apache FOP's AWT preview (non-standard MIME type) */
String MIME_FOP_AWT_PREVIEW = "application/X-fop-awt-preview";
/** Apache FOP's Direct Printing (non-standard MIME type) */
String MIME_FOP_PRINT = "application/X-fop-print";
/** Apache FOP's area tree XML */
String MIME_FOP_AREA_TREE = "application/X-fop-areatree";
/** Proposed but non-registered MIME type for XSL-FO */
String MIME_XSL_FO = "text/xsl";
}

+ 59
- 59
src/java/org/apache/fop/apps/PageSequenceResults.java View File

@@ -1,59 +1,59 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.apps;
/**
* Class for reporting back formatting results to the calling application. This
* particular class is used to report the results of a single page-sequence.
*/
public class PageSequenceResults {
private String id;
private int pageCount;
/**
* Constructor for the PageSequenceResults object
*
* @param id ID of the page-sequence, if available
* @param pageCount The number of resulting pages
*/
public PageSequenceResults(String id, int pageCount) {
this.id = id;
this.pageCount = pageCount;
}
/**
* Gets the ID of the page-sequence if one was specified.
*
* @return The ID
*/
public String getID() {
return this.id;
}
/**
* Gets the number of pages that resulted by processing the page-sequence.
*
* @return The number of pages generated
*/
public int getPageCount() {
return this.pageCount;
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.apps;
/**
* Class for reporting back formatting results to the calling application. This
* particular class is used to report the results of a single page-sequence.
*/
public class PageSequenceResults {
private String id;
private int pageCount;
/**
* Constructor for the PageSequenceResults object
*
* @param id ID of the page-sequence, if available
* @param pageCount The number of resulting pages
*/
public PageSequenceResults(String id, int pageCount) {
this.id = id;
this.pageCount = pageCount;
}
/**
* Gets the ID of the page-sequence if one was specified.
*
* @return The ID
*/
public String getID() {
return this.id;
}
/**
* Gets the number of pages that resulted by processing the page-sequence.
*
* @return The number of pages generated
*/
public int getPageCount() {
return this.pageCount;
}
}

+ 14
- 5
src/java/org/apache/fop/area/AreaTreeModel.java View File

@@ -22,10 +22,8 @@ package org.apache.fop.area;
// Java
import java.util.List;

// XML
import org.xml.sax.SAXException;

// Apache
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@@ -55,10 +53,13 @@ public class AreaTreeModel {

/**
* Start a page sequence on this model.
* @param title the title of the new page sequence
* @param pageSequence the page sequence about to start
*/
public void startPageSequence(LineArea title) {
currentPageSequence = new PageSequence(title);
public void startPageSequence(PageSequence pageSequence) {
if (pageSequence == null) {
throw new NullPointerException("pageSequence must not be null");
}
this.currentPageSequence = pageSequence;
pageSequenceList.add(currentPageSequence);
currentPageSequenceIndex = pageSequenceList.size() - 1;
}
@@ -90,6 +91,14 @@ public class AreaTreeModel {
*/
public void endDocument() throws SAXException {};

/**
* Returns the currently active page-sequence.
* @return the currently active page-sequence
*/
public PageSequence getCurrentPageSequence() {
return this.currentPageSequence;
}
/**
* Get the page sequence count.
* @return the number of page sequences in the document.

+ 12
- 9
src/java/org/apache/fop/area/AreaTreeParser.java View File

@@ -141,7 +141,6 @@ public class AreaTreeParser {

private Stack areaStack = new Stack();
private boolean firstFlow;
private boolean pendingStartPageSequence;

private Stack delegateStack = new Stack();
private ContentHandler delegate;
@@ -349,8 +348,12 @@ public class AreaTreeParser {
private class PageSequenceMaker extends AbstractMaker {

public void startElement(Attributes attributes) {
pendingStartPageSequence = true;
//treeModel.startPageSequence(null); Done after title or on the first viewport
PageSequence pageSequence = new PageSequence(null);
String lang = attributes.getValue("language");
pageSequence.setLanguage(lang);
String country = attributes.getValue("country");
pageSequence.setCountry(country);
areaStack.push(pageSequence);
}
}

@@ -364,19 +367,19 @@ public class AreaTreeParser {

public void endElement() {
LineArea line = (LineArea)areaStack.pop();
treeModel.startPageSequence(line);
pendingStartPageSequence = false;
PageSequence pageSequence = (PageSequence)areaStack.peek();
pageSequence.setTitle(line);
}


}

private class PageViewportMaker extends AbstractMaker {

public void startElement(Attributes attributes) {
if (pendingStartPageSequence) {
treeModel.startPageSequence(null);
pendingStartPageSequence = false;
if (!areaStack.isEmpty()) {
PageSequence pageSequence = (PageSequence)areaStack.peek();
treeModel.startPageSequence(pageSequence);
areaStack.pop();
}
if (currentPageViewport != null) {
throw new IllegalStateException("currentPageViewport must be null");

+ 12
- 3
src/java/org/apache/fop/area/Block.java View File

@@ -19,7 +19,6 @@
package org.apache.fop.area;

import java.util.ArrayList;

// block areas hold either more block areas or line
// areas can also be used as a block spacer
@@ -59,6 +58,8 @@ public class Block extends BlockParent {
private int stacking = TB;
private int positioning = STACK;

protected transient boolean allowBPDUpdate = true;
// a block with may contain the dominant styling info in
// terms of most lines or blocks with info

@@ -78,7 +79,7 @@ public class Block extends BlockParent {
* @param autoHeight increase the height of the block.
*/
public void addBlock(Block block, boolean autoHeight) {
if (autoHeight) {
if (autoHeight && allowBPDUpdate) {
bpd += block.getAllocBPD();
}
addChildArea(block);
@@ -112,6 +113,14 @@ public class Block extends BlockParent {
return positioning;
}

/**
* Indicates whether this block is stacked, rather than absolutely positioned.
* @return true if it is stacked
*/
public boolean isStacked() {
return (getPositioning() == Block.STACK || getPositioning() == Block.RELATIVE);
}
/**
* @return the start-indent trait
*/
@@ -119,6 +128,6 @@ public class Block extends BlockParent {
Integer startIndent = (Integer)getTrait(Trait.START_INDENT);
return (startIndent != null ? startIndent.intValue() : 0);
}
}


+ 9
- 0
src/java/org/apache/fop/area/BlockViewport.java View File

@@ -34,6 +34,15 @@ public class BlockViewport extends Block {
* Create a new block viewport area.
*/
public BlockViewport() {
this(false);
}

/**
* Create a new block viewport area.
* @param allowBPDUpdate true allows the BPD to be updated when children are added
*/
public BlockViewport(boolean allowBPDUpdate) {
this.allowBPDUpdate = allowBPDUpdate;
}

/**

+ 3
- 1
src/java/org/apache/fop/area/NormalFlow.java View File

@@ -37,7 +37,9 @@ public class NormalFlow extends BlockParent {
/** {@inheritDoc} */
public void addBlock(Block block) {
super.addBlock(block);
bpd += block.getAllocBPD();
if (block.isStacked()) {
bpd += block.getAllocBPD();
}
}
}


+ 52
- 1
src/java/org/apache/fop/area/PageSequence.java View File

@@ -28,13 +28,15 @@ public class PageSequence {

private List pages = new java.util.ArrayList();
private LineArea title;
private String language;
private String country;
/**
* Main constructor
* @param title the title for the page-sequence, may be null
*/
public PageSequence(LineArea title) {
this.title = title;
setTitle(title);
}
/**
@@ -44,6 +46,14 @@ public class PageSequence {
return this.title;
}
/**
* Sets the page sequence's title.
* @param title the title
*/
public void setTitle(LineArea title) {
this.title = title;
}
/**
* Adds a new page to the page sequence
* @param page the page to be added
@@ -76,4 +86,45 @@ public class PageSequence {
public boolean isFirstPage(PageViewport page) {
return page.equals(getPage(0));
}

/**
* Returns the language of the page-sequence.
* @return the language (the value of the language property, "none" is mapped to null)
*/
public String getLanguage() {
return this.language;
}

/**
* Sets the language that applies to this page-sequence.
* @param language the language to set ("none" is mapped to null)
*/
public void setLanguage(String language) {
if ("none".equals(language)) {
this.language = null;
} else {
this.language = language;
}
}
/**
* Returns the country of the page-sequence.
* @return the country (the value of the country property, "none" is mapped to null)
*/
public String getCountry() {
return this.country;
}

/**
* Sets the country that applies to this page-sequence.
* @param country the country to set ("none" is mapped to null)
*/
public void setCountry(String country) {
if ("none".equals(country)) {
this.country = null;
} else {
this.country = country;
}
}
}

+ 6
- 11
src/java/org/apache/fop/area/RenderPagesModel.java View File

@@ -81,16 +81,11 @@ public class RenderPagesModel extends AreaTreeModel {
}
}

/**
* Start a new page sequence.
* This tells the renderer that a new page sequence has
* started with the given title.
* @param title the title of the new page sequence
*/
public void startPageSequence(LineArea title) {
super.startPageSequence(title);
/** {@inheritDoc} */
public void startPageSequence(PageSequence pageSequence) {
super.startPageSequence(pageSequence);
if (renderer.supportsOutOfOrder()) {
renderer.startPageSequence(title);
renderer.startPageSequence(getCurrentPageSequence());
}
}

@@ -112,7 +107,7 @@ public class RenderPagesModel extends AreaTreeModel {
boolean ready = renderer.supportsOutOfOrder() && page.isResolved();
if (ready) {
if (!renderer.supportsOutOfOrder() && page.getPageSequence().isFirstPage(page)) {
renderer.startPageSequence(this.currentPageSequence.getTitle());
renderer.startPageSequence(getCurrentPageSequence());
}
try {
renderer.renderPage(page);
@@ -159,7 +154,7 @@ public class RenderPagesModel extends AreaTreeModel {
if (pageViewport.isResolved() || renderUnresolved) {
if (!renderer.supportsOutOfOrder()
&& pageViewport.getPageSequence().isFirstPage(pageViewport)) {
renderer.startPageSequence(this.currentPageSequence.getTitle());
renderer.startPageSequence(getCurrentPageSequence());
}
try {
renderer.renderPage(pageViewport);

+ 59
- 59
src/java/org/apache/fop/area/inline/SpaceArea.java View File

@@ -1,59 +1,59 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.area.inline;
/**
* A space
*/
public class SpaceArea extends InlineArea {
/**
* The space for this space area
*/
protected String space;
/**
* Is this space adjustable?
*/
protected boolean isAdjustable;
/**
* Create a space area
* @param s the space character
* @param o the offset for the next area
* @param a is this space adjustable?
*/
public SpaceArea(char s, int o, boolean a) {
space = new String() + s;
offset = o;
isAdjustable = a;
}
/**
* @return Returns the space.
*/
public String getSpace() {
return new String(space);
}
/** @return true if the space is adjustable (WRT word-space processing) */
public boolean isAdjustable() {
return this.isAdjustable;
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.area.inline;
/**
* A space
*/
public class SpaceArea extends InlineArea {
/**
* The space for this space area
*/
protected String space;
/**
* Is this space adjustable?
*/
protected boolean isAdjustable;
/**
* Create a space area
* @param s the space character
* @param o the offset for the next area
* @param a is this space adjustable?
*/
public SpaceArea(char s, int o, boolean a) {
space = new String() + s;
offset = o;
isAdjustable = a;
}
/**
* @return Returns the space.
*/
public String getSpace() {
return new String(space);
}
/** @return true if the space is adjustable (WRT word-space processing) */
public boolean isAdjustable() {
return this.isAdjustable;
}
}

+ 72
- 72
src/java/org/apache/fop/area/inline/WordArea.java View File

@@ -1,72 +1,72 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.area.inline;
/**
* A string of characters without spaces
*/
public class WordArea extends InlineArea {
/** The text for this word area */
protected String word;
/** The correction offset for the next area */
protected int offset = 0;
/** An array of width for adjusting the individual letters (optional) */
protected int[] letterAdjust;
/**
* Create a word area
* @param w the word string
* @param o the offset for the next area
* @param la the letter adjust array (may be null)
*/
public WordArea(String w, int o, int[] la) {
word = w;
offset = o;
this.letterAdjust = la;
}
/**
* @return Returns the word.
*/
public String getWord() {
return word;
}
/**
* @return Returns the offset.
*/
public int getOffset() {
return offset;
}
/**
* @param o The offset to set.
*/
public void setOffset(int o) {
offset = o;
}
/** @return the array of letter adjust widths */
public int[] getLetterAdjustArray() {
return this.letterAdjust;
}
}
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* $Id$ */
package org.apache.fop.area.inline;
/**
* A string of characters without spaces
*/
public class WordArea extends InlineArea {
/** The text for this word area */
protected String word;
/** The correction offset for the next area */
protected int offset = 0;
/** An array of width for adjusting the individual letters (optional) */
protected int[] letterAdjust;
/**
* Create a word area
* @param w the word string
* @param o the offset for the next area
* @param la the letter adjust array (may be null)
*/
public WordArea(String w, int o, int[] la) {
word = w;
offset = o;
this.letterAdjust = la;
}
/**
* @return Returns the word.
*/
public String getWord() {
return word;
}
/**
* @return Returns the offset.
*/
public int getOffset() {
return offset;
}
/**
* @param o The offset to set.
*/
public void setOffset(int o) {
offset = o;
}
/** @return the array of letter adjust widths */
public int[] getLetterAdjustArray() {
return this.letterAdjust;
}
}

+ 31
- 3
src/java/org/apache/fop/cli/InputHandler.java View File

@@ -21,9 +21,13 @@ package org.apache.fop.cli;

// Imported java.io classes
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Vector;

import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.transform.ErrorListener;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
@@ -31,9 +35,14 @@ import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.sax.SAXResult;
import javax.xml.transform.sax.SAXSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource;

import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@@ -133,11 +142,30 @@ public class InputHandler implements ErrorListener, Renderable {
}
/**
* Creates a Source for the main input file.
* Creates a Source for the main input file. Processes XInclude if
* available in the XML parser.
*
* @return the Source for the main input file
*/
protected Source createMainSource() {
return new StreamSource(this.sourcefile);
Source result;
try {
InputSource is = new InputSource(new FileInputStream(
this.sourcefile));
is.setSystemId(this.sourcefile.toURI().toASCIIString());
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setFeature("http://xml.org/sax/features/namespaces", true);
spf.setFeature("http://apache.org/xml/features/xinclude", true);
XMLReader xr = spf.newSAXParser().getXMLReader();
result = new SAXSource(xr, is);
} catch (SAXException e) {
result = new StreamSource(this.sourcefile);
} catch (IOException e) {
result = new StreamSource(this.sourcefile);
} catch (ParserConfigurationException e) {
result = new StreamSource(this.sourcefile);
}
return result;
}
/**
@@ -196,7 +224,7 @@ public class InputHandler implements ErrorListener, Renderable {
* {@inheritDoc}
*/
public void warning(TransformerException exc) {
log.warn(exc.toString());
log.warn(exc.getLocalizedMessage());
}

/**

+ 12
- 0
src/java/org/apache/fop/datatypes/LengthBase.java View File

@@ -130,5 +130,17 @@ public class LengthBase implements PercentBase {
return baseLen;
}

/** {@inheritDoc} */
public String toString() {
return super.toString()
+ "[fo=" + fobj + ","
+ "baseType=" + baseType + ","
+ "baseLength=" + baseLength + "]";
}
/**@return the base length as a {@link Length} */
public Length getBaseLength() {
return baseLength;
}
}


+ 1
- 1
src/java/org/apache/fop/fo/FONode.java View File

@@ -380,7 +380,7 @@ public abstract class FONode implements Cloneable {
* @param problem text to display that indicates the problem
* @deprecated Not localizable!
*/
protected void attributeWarning(String problem) {
public void attributeWarning(String problem) {
log.warn(warningText(locator) + getName() + ", " + problem);
}


+ 29
- 7
src/java/org/apache/fop/fo/FOPropertyMapping.java View File

@@ -26,7 +26,7 @@ import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.datatypes.LengthBase;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.fo.flow.table.TableFObj.ColumnNumberPropertyMaker;
import org.apache.fop.fo.properties.BackgroundPositionShorthandParser;
import org.apache.fop.fo.properties.BackgroundPositionShorthand;
import org.apache.fop.fo.properties.BorderSpacingShorthandParser;
import org.apache.fop.fo.properties.BorderWidthPropertyMaker;
import org.apache.fop.fo.properties.BoxPropShorthandParser;
@@ -66,6 +66,7 @@ import org.apache.fop.fo.properties.TextDecorationProperty;
import org.apache.fop.fo.properties.ToBeImplementedProperty;
import org.apache.fop.fo.properties.VerticalAlignShorthandParser;
import org.apache.fop.fo.properties.WhiteSpaceShorthandParser;
import org.apache.fop.fo.properties.XMLLangShorthandParser;

/**
* This class creates and returns an array of Property.Maker instances
@@ -1060,12 +1061,14 @@ public final class FOPropertyMapping implements Constants {
m = new StringProperty.Maker(PR_COUNTRY);
m.setInherited(true);
m.setDefault("none");
m.addShorthand(s_generics[PR_XML_LANG]);
addPropertyMaker("country", m);

// language
m = new StringProperty.Maker(PR_LANGUAGE);
m.setInherited(true);
m.setDefault("none");
m.addShorthand(s_generics[PR_XML_LANG]);
addPropertyMaker("language", m);

// script
@@ -1150,7 +1153,7 @@ public final class FOPropertyMapping implements Constants {
m.useGeneric(genericSpace);
corr = new SpacePropertyMaker(m);
corr.setCorresponding(PR_MARGIN_BOTTOM, PR_MARGIN_BOTTOM, PR_MARGIN_LEFT);
corr.setUseParent(true);
corr.setUseParent(false);
corr.setRelative(true);
addPropertyMaker("space-after", m);

@@ -1160,7 +1163,7 @@ public final class FOPropertyMapping implements Constants {
m.setDefault("0pt");
IndentPropertyMaker sCorr = new IndentPropertyMaker(m);
sCorr.setCorresponding(PR_MARGIN_LEFT, PR_MARGIN_RIGHT, PR_MARGIN_TOP);
sCorr.setUseParent(true);
sCorr.setUseParent(false);
sCorr.setRelative(true);
sCorr.setPaddingCorresponding(new int[] {
PR_PADDING_LEFT, PR_PADDING_RIGHT, PR_PADDING_TOP
@@ -1176,7 +1179,7 @@ public final class FOPropertyMapping implements Constants {
m.setDefault("0pt");
IndentPropertyMaker eCorr = new IndentPropertyMaker(m);
eCorr.setCorresponding(PR_MARGIN_RIGHT, PR_MARGIN_LEFT, PR_MARGIN_BOTTOM);
eCorr.setUseParent(true);
eCorr.setUseParent(false);
eCorr.setRelative(true);
eCorr.setPaddingCorresponding(new int[] {
PR_PADDING_RIGHT, PR_PADDING_LEFT, PR_PADDING_BOTTOM
@@ -2531,15 +2534,33 @@ public final class FOPropertyMapping implements Constants {
addPropertyMaker("background", m);

// background-position
m = new ListProperty.Maker(PR_BACKGROUND_POSITION);
m = new BackgroundPositionShorthand.Maker(PR_BACKGROUND_POSITION);
m.setInherited(false);
m.addKeyword("left", "0% 50%");
m.addKeyword("left center", "0% 50%");
m.addKeyword("center left", "0% 50%");
m.addKeyword("right", "100% 50%");
m.addKeyword("right center", "100% 50%");
m.addKeyword("center right", "100% 50%");
m.addKeyword("center", "50% 50%");
m.addKeyword("center center", "50% 50%");
m.addKeyword("top", "50% 0%");
m.addKeyword("top center", "50% 0%");
m.addKeyword("center top", "50% 0%");
m.addKeyword("bottom", "50% 100%");
m.addKeyword("bottom center", "50% 100%");
m.addKeyword("center bottom", "50% 100%");
m.addKeyword("top left", "0% 0%");
m.addKeyword("left top", "0% 0%");
m.addKeyword("top right", "100% 0%");
m.addKeyword("right top", "100% 0%");
m.addKeyword("bottom left", "0% 100%");
m.addKeyword("left bottom", "0% 100%");
m.addKeyword("bottom right", "100% 100%");
m.addKeyword("right bottom", "100% 100%");
m.setDefault("0% 0%");
m.setDatatypeParser(new BackgroundPositionShorthandParser());
m.setPercentBase(LengthBase.CUSTOM_BASE);
m.setDatatypeParser(new BackgroundPositionShorthand.Parser());
addPropertyMaker("background-position", m);

// border
@@ -2722,9 +2743,10 @@ public final class FOPropertyMapping implements Constants {
addPropertyMaker("white-space", m);
// xml:lang
m = new ToBeImplementedProperty.Maker(PR_XML_LANG);
m = new StringProperty.Maker(PR_XML_LANG);
m.setInherited(true);
m.setDefault("");
m.setDatatypeParser(new XMLLangShorthandParser());
addPropertyMaker("xml:lang", m);

}

+ 35
- 64
src/java/org/apache/fop/fo/FOTreeBuilder.java View File

@@ -59,9 +59,7 @@ public class FOTreeBuilder extends DefaultHandler {
/** The registry for ElementMapping instances */
protected ElementMappingRegistry elementMappingRegistry;

/**
* The root of the formatting object tree
*/
/** The root of the formatting object tree */
protected Root rootFObj = null;

/** Main DefaultHandler that handles the FO namespace. */
@@ -70,10 +68,7 @@ public class FOTreeBuilder extends DefaultHandler {
/** Current delegate ContentHandler to receive the SAX events */
protected ContentHandler delegate;
/**
* The class that handles formatting and rendering to a stream
* (mark-fop@inomial.com)
*/
/** The object that handles formatting and rendering to a stream */
private FOEventHandler foEventHandler;

/** The SAX locator object managing the line and column counters */
@@ -88,14 +83,18 @@ public class FOTreeBuilder extends DefaultHandler {
private int depth;
/**
* FOTreeBuilder constructor
* <code>FOTreeBuilder</code> constructor
*
* @param outputFormat the MIME type of the output format to use (ex. "application/pdf").
* @param foUserAgent in effect for this process
* @param stream OutputStream to direct results
* @throws FOPException if the FOTreeBuilder cannot be properly created
* @param foUserAgent the {@link FOUserAgent} in effect for this process
* @param stream the <code>OutputStream</code> to direct the results to
* @throws FOPException if the <code>FOTreeBuilder</code> cannot be properly created
*/
public FOTreeBuilder(String outputFormat, FOUserAgent foUserAgent,
OutputStream stream) throws FOPException {
public FOTreeBuilder(
String outputFormat,
FOUserAgent foUserAgent,
OutputStream stream)
throws FOPException {

this.userAgent = foUserAgent;
this.elementMappingRegistry = userAgent.getFactory().getElementMappingRegistry();
@@ -110,40 +109,25 @@ public class FOTreeBuilder extends DefaultHandler {
});
}

/**
* This method enables to reduce memory consumption of the FO tree slightly. When it returns
* true no Locator is passed to the FO tree nodes which would copy the information into
* a SAX LocatorImpl instance.
* @return true if no context information should be stored on each node in the FO tree.
* @deprecated Use FOUserAgent.isLocatorEnabled() instead.
*/
protected boolean isLocatorDisabled() {
return !userAgent.isLocatorEnabled();
}
/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
public void setDocumentLocator(Locator locator) {
this.locator = locator;
}
/** @return a Locator instance if it is available and not disabled */
/**
* @return a {@link Locator} instance if it is available and not disabled
*/
protected Locator getEffectiveLocator() {
return (userAgent.isLocatorEnabled() ? this.locator : null);
}
/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
public void characters(char[] data, int start, int length)
throws SAXException {
delegate.characters(data, start, length);
}

/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
public void startDocument() throws SAXException {
if (used) {
throw new IllegalStateException("FOTreeBuilder (and the Fop class) cannot be reused."
@@ -170,9 +154,7 @@ public class FOTreeBuilder extends DefaultHandler {
this.delegate = this.mainFOHandler;
}

/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
public void endDocument() throws SAXException {
this.delegate.endDocument();
if (this.rootFObj == null && empty) {
@@ -190,18 +172,14 @@ public class FOTreeBuilder extends DefaultHandler {
imageFactory.removeContext(this.userAgent);
}

/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
public void startElement(String namespaceURI, String localName, String rawName,
Attributes attlist) throws SAXException {
this.depth++;
delegate.startElement(namespaceURI, localName, rawName, attlist);
}

/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
public void endElement(String uri, String localName, String rawName)
throws SAXException {
this.delegate.endElement(uri, localName, rawName);
@@ -217,7 +195,8 @@ public class FOTreeBuilder extends DefaultHandler {
}

/**
* Finds the Maker used to create node objects of a particular type
* Finds the {@link Maker} used to create {@link FONode} objects of a particular type
*
* @param namespaceURI URI for the namespace of the element
* @param localName name of the Element
* @return the ElementMapping.Maker that can create an FO object for this element
@@ -229,7 +208,7 @@ public class FOTreeBuilder extends DefaultHandler {

/** {@inheritDoc} */
public void warning(SAXParseException e) {
log.warn(e.toString());
log.warn(e.getLocalizedMessage());
}

/** {@inheritDoc} */
@@ -244,7 +223,8 @@ public class FOTreeBuilder extends DefaultHandler {
}

/**
* Provides access to the underlying FOEventHandler object.
* Provides access to the underlying {@link FOEventHandler} object.
*
* @return the FOEventHandler object
*/
public FOEventHandler getEventHandler() {
@@ -255,6 +235,7 @@ public class FOTreeBuilder extends DefaultHandler {
* Returns the results of the rendering process. Information includes
* the total number of pages generated and the number of pages per
* page-sequence.
*
* @return the results of the rendering process.
*/
public FormattingResults getResults() {
@@ -268,23 +249,17 @@ public class FOTreeBuilder extends DefaultHandler {
}
/**
* Main DefaultHandler implementation which builds the FO tree.
* Main <code>DefaultHandler</code> implementation which builds the FO tree.
*/
private class MainFOHandler extends DefaultHandler {
/**
* Current formatting object being handled
*/
/** Current formatting object being handled */
protected FONode currentFObj = null;

/**
* Current propertyList for the node being handled.
*/
/** Current propertyList for the node being handled */
protected PropertyList currentPropertyList;
/**
* Current marker nesting-depth
*/
/** Current marker nesting-depth */
private int nestedMarkerDepth = 0;

/** {@inheritDoc} */
@@ -309,11 +284,7 @@ public class FOTreeBuilder extends DefaultHandler {
} else { // check that incoming node is valid for currentFObj
if (namespaceURI.equals(FOElementMapping.URI)
|| namespaceURI.equals(ExtensionElementMapping.URI)) {
try {
currentFObj.validateChildNode(locator, namespaceURI, localName);
} catch (ValidationException e) {
throw e;
}
currentFObj.validateChildNode(locator, namespaceURI, localName);
}
}
@@ -402,12 +373,11 @@ public class FOTreeBuilder extends DefaultHandler {
if (currentFObj.getParent() == null) {
log.debug("endElement for top-level " + currentFObj.getName());
}
currentFObj = currentFObj.getParent();
}

/**
* {@inheritDoc}
*/
/** {@inheritDoc} */
public void characters(char[] data, int start, int length)
throws FOPException {
if (currentFObj != null) {
@@ -416,6 +386,7 @@ public class FOTreeBuilder extends DefaultHandler {
}
}

/** {@inheritDoc} */
public void endDocument() throws SAXException {
currentFObj = null;
}

+ 4
- 2
src/java/org/apache/fop/fo/PropertyList.java View File

@@ -309,11 +309,13 @@ public abstract class PropertyList {
String attributeNS;
FopFactory factory = getFObj().getUserAgent().getFactory();
for (int i = 0; i < attributes.getLength(); i++) {
/* convert all attributes with the same namespace as the fo element for this fObj */
/* convert all attributes with the same namespace as the fo element
* the "xml:lang" property is a special case */
attributeNS = attributes.getURI(i);
attributeName = attributes.getQName(i);
attributeValue = attributes.getValue(i);
if (attributeNS == null || attributeNS.length() == 0) {
if (attributeNS == null || attributeNS.length() == 0
|| "xml:lang".equals(attributeName)) {
convertAttributeToProperty(attributes, attributeName, attributeValue);
} else if (!factory.isNamespaceIgnored(attributeNS)) {
ElementMapping mapping = factory.getElementMappingRegistry().getElementMapping(

+ 26
- 23
src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java View File

@@ -68,12 +68,9 @@ public class XMLWhiteSpaceHandler {
/** Counter, increased every time a non-white-space is encountered */
private int nonWhiteSpaceCount;
private Block currentBlock;
private FObj currentFO;
private int linefeedTreatment;
private int whiteSpaceTreatment;
private int whiteSpaceCollapse;
private FONode nextChild;
private boolean endOfBlock;
private boolean nextChildIsBlockLevel;
private RecursiveCharIterator charIter;
@@ -87,19 +84,28 @@ public class XMLWhiteSpaceHandler {
* firstTextNode
* @param fo the FO for which to handle white-space
* @param firstTextNode the node at which to start
* @param nextChild the node that will be added to the list
* after firstTextNode
*/
public void handleWhiteSpace(FObjMixed fo, FONode firstTextNode) {
public void handleWhiteSpace(FObjMixed fo, FONode firstTextNode, FONode nextChild) {
Block currentBlock = null;
int foId = fo.getNameId();
if (foId == Constants.FO_BLOCK) {
if (nextChild != null && currentBlock != null) {
/* if already in a block, push the current block
* onto the stack of nested blocks
*/
nestedBlockStack.push(currentBlock);
}
currentBlock = (Block) fo;
if (nestedBlockStack.isEmpty() || fo != nestedBlockStack.peek()) {
if (nextChild != null) {
/* if already in a block, push the current block
* onto the stack of nested blocks
*/
nestedBlockStack.push(currentBlock);
}
} else {
if (nextChild == null) {
nestedBlockStack.pop();
}
}
} else if (foId == Constants.FO_RETRIEVE_MARKER) {
/* look for the nearest block ancestor, if any */
FONode ancestor = fo;
@@ -111,6 +117,8 @@ public class XMLWhiteSpaceHandler {
if (ancestor.getNameId() == Constants.FO_BLOCK) {
currentBlock = (Block) ancestor;
}
} else if (!nestedBlockStack.isEmpty()) {
currentBlock = (Block) nestedBlockStack.peek();
}
if (currentBlock != null) {
@@ -123,8 +131,6 @@ public class XMLWhiteSpaceHandler {
whiteSpaceTreatment = Constants.EN_IGNORE_IF_SURROUNDING_LINEFEED;
}
currentFO = fo;

if (firstTextNode == null) {
//nothing to do but initialize related properties
return;
@@ -133,20 +139,20 @@ public class XMLWhiteSpaceHandler {
charIter = new RecursiveCharIterator(fo, firstTextNode);
inWhiteSpace = false;
if (currentFO == currentBlock
if (fo == currentBlock
|| currentBlock == null
|| (foId == Constants.FO_RETRIEVE_MARKER
&& currentFO.getParent() == currentBlock)) {
&& fo.getParent() == currentBlock)) {
afterLinefeed = (
(firstTextNode == fo.firstChild)
|| (firstTextNode.siblings[0].getNameId()
== Constants.FO_BLOCK));
}
endOfBlock = (nextChild == null && currentFO == currentBlock);
endOfBlock = (nextChild == null && fo == currentBlock);
if (nextChild != null) {
int nextChildId = this.nextChild.getNameId();
int nextChildId = nextChild.getNameId();
nextChildIsBlockLevel = (
nextChildId == Constants.FO_BLOCK
|| nextChildId == Constants.FO_TABLE_AND_CAPTION
@@ -159,7 +165,7 @@ public class XMLWhiteSpaceHandler {
handleWhiteSpace();
if (currentFO == currentBlock
if (fo == currentBlock
&& pendingInlines != null
&& !pendingInlines.isEmpty()) {
/* current FO is a block, and has pending inlines */
@@ -183,7 +189,7 @@ public class XMLWhiteSpaceHandler {
}
if (nextChild == null) {
if (currentFO != currentBlock) {
if (fo != currentBlock) {
/* current FO is not a block, and is about to end */
if (nonWhiteSpaceCount > 0 && pendingInlines != null) {
/* there is non-white-space text between the pending
@@ -204,7 +210,6 @@ public class XMLWhiteSpaceHandler {
} else {
currentBlock = null;
}
currentFO = null;
charIter = null;
}
}
@@ -218,10 +223,8 @@ public class XMLWhiteSpaceHandler {
* @param nextChild the child-node that will be added to the list after
* the last text-node
*/
public void handleWhiteSpace(FObjMixed fo, FONode firstTextNode, FONode nextChild) {
this.nextChild = nextChild;
handleWhiteSpace(fo, firstTextNode);
this.nextChild = null;
public void handleWhiteSpace(FObjMixed fo, FONode firstTextNode) {
handleWhiteSpace(fo, firstTextNode, null);
}
private void handleWhiteSpace() {

+ 64
- 18
src/java/org/apache/fop/fo/expr/ICCColorFunction.java View File

@@ -18,7 +18,8 @@
/* $Id$ */
package org.apache.fop.fo.expr;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.datatypes.PercentBase;
import org.apache.fop.datatypes.PercentBaseContext;
import org.apache.fop.fo.pagination.ColorProfile;
import org.apache.fop.fo.pagination.Declarations;
import org.apache.fop.fo.properties.ColorProperty;
@@ -38,40 +39,85 @@ class ICCColorFunction extends FunctionBase {
return -4;
}
/** {@inheritDoc} */
public PercentBase getPercentBase() {
return new ICCPercentBase();
}

/** {@inheritDoc} */
public Property eval(Property[] args,
PropertyInfo pInfo) throws PropertyException {
StringBuffer sb = new StringBuffer();

// Map color profile NCNAME to src from declarations/color-profile element
String colorProfileName = args[3].getString();
Declarations decls = pInfo.getFO().getRoot().getDeclarations();
ColorProfile cp = decls.getColorProfile(colorProfileName);
if (cp == null) {
PropertyException pe = new PropertyException("The " + colorProfileName
+ " color profile was not declared");
pe.setPropertyInfo(pInfo);
throw pe;
ColorProfile cp = null;
if (decls == null) {
//function used in a color-specification
//on a FO occurring:
//a) before the fo:declarations,
//b) or in a document without fo:declarations?
//=> return the sRGB fallback
Property[] rgbArgs = new Property[3];
System.arraycopy(args, 0, rgbArgs, 0, 3);
return new RGBColorFunction().eval(rgbArgs, pInfo);
} else {
cp = decls.getColorProfile(colorProfileName);
if (cp == null) {
PropertyException pe = new PropertyException("The " + colorProfileName
+ " color profile was not declared");
pe.setPropertyInfo(pInfo);
throw pe;
}
}
String src = cp.getSrc();
float red = 0, green = 0, blue = 0;
red = args[0].getNumber().floatValue();
green = args[1].getNumber().floatValue();
blue = args[2].getNumber().floatValue();
/* Verify rgb replacement arguments */
if ((red < 0 || red > 255)
|| (green < 0 || green > 255)
|| (blue < 0 || blue > 255)) {
throw new PropertyException("Color values out of range. "
+ "Arguments to rgb-icc() must be [0..255] or [0%..100%]");
}
// rgb-icc is replaced with fop-rgb-icc which has an extra fifth argument containing the
// color profile src attribute as it is defined in the color-profile declarations element.
sb.append("fop-rgb-icc(" + args[0]);
for (int ix = 1; ix < args.length; ix++) {
StringBuffer sb = new StringBuffer();
sb.append("fop-rgb-icc(");
sb.append(red / 255f);
sb.append(',').append(green / 255f);
sb.append(',').append(blue / 255f);
for (int ix = 3; ix < args.length; ix++) {
if (ix == 3) {
sb.append("," + colorProfileName);
sb.append(",\"" + src + "\"");
sb.append(',').append(colorProfileName);
sb.append(',').append(src);
} else {
sb.append("," + args[ix]);
sb.append(',').append(args[ix]);
}
}
sb.append(")");
FOUserAgent ua = (pInfo == null
? null
: (pInfo.getFO() == null ? null : pInfo.getFO().getUserAgent()));
return ColorProperty.getInstance(ua, sb.toString());
return ColorProperty.getInstance(pInfo.getUserAgent(), sb.toString());
}

private static final class ICCPercentBase implements PercentBase {
/** {@inheritDoc} */
public int getBaseLength(PercentBaseContext context) throws PropertyException {
return 0;
}

/** {@inheritDoc} */
public double getBaseValue() {
return 255f;
}

/** {@inheritDoc} */
public int getDimension() {
return 0;
}
}
}

+ 2
- 1
src/java/org/apache/fop/fo/expr/NumericProperty.java View File

@@ -25,6 +25,7 @@ import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.PercentBaseContext;
import org.apache.fop.datatypes.Numeric;
import org.apache.fop.fo.properties.FixedLength;
import org.apache.fop.fo.properties.Property;

/**
@@ -121,7 +122,7 @@ public class NumericProperty extends Property implements Numeric, Length {
/** {@inheritDoc} */
public String toString() {
if (dim == 1) {
return (int) value + "mpt";
return (int) value + FixedLength.MPT;
} else {
return value + "^" + dim;
}

+ 29
- 0
src/java/org/apache/fop/fo/expr/PPColWidthFunction.java View File

@@ -19,6 +19,8 @@

package org.apache.fop.fo.expr;

import org.apache.fop.datatypes.PercentBase;
import org.apache.fop.datatypes.PercentBaseContext;
import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.flow.table.Table;
import org.apache.fop.fo.properties.Property;
@@ -38,6 +40,13 @@ public class PPColWidthFunction extends FunctionBase {
return 1;
}

/**
* @return the {@link PercentBase} for the proportional-column-width()
* function
*/
public PercentBase getPercentBase() {
return new PPColWidthPercentBase();
}
/**
*
* @param args array of arguments for this function
@@ -69,4 +78,24 @@ public class PPColWidthFunction extends FunctionBase {
return new TableColLength(d.doubleValue(), pInfo.getFO());
}

private static class PPColWidthPercentBase implements PercentBase {

/** {@inheritDoc} */
public int getBaseLength(PercentBaseContext context) throws PropertyException {
return 0;
}

/** {@inheritDoc} */
public double getBaseValue() {
//make sure percentage-arguments are interpreted
//as numerics (1% = 1 * 0.01)
return 1;
}

/** {@inheritDoc} */
public int getDimension() {
return 0;
}
}
}

+ 0
- 0
src/java/org/apache/fop/fo/expr/PropertyException.java View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save