aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2009-10-27 18:16:31 +0000
committerVincent Hennebert <vhennebert@apache.org>2009-10-27 18:16:31 +0000
commitcea774bc9129a1e2b6f47cff523cf0e1c13fa832 (patch)
tree6dae7917216bc637f01ea1e690d0e4a4467b504f
parent04cd4fd9439395fdf5250f0978b288d9003be6fd (diff)
parentd7b69927f611f4da9cc9b26396e1eb0a1bdae39e (diff)
downloadxmlgraphics-fop-cea774bc9129a1e2b6f47cff523cf0e1c13fa832.tar.gz
xmlgraphics-fop-cea774bc9129a1e2b6f47cff523cf0e1c13fa832.zip
Merged changes from Trunk up to revision 830265Temp_Accessibility
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_Accessibility@830280 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--conf/fop.xconf4
-rw-r--r--src/documentation/content/xdocs/trunk/output.xml9
-rw-r--r--src/java/org/apache/fop/cli/CommandLineOptions.java6
-rw-r--r--src/java/org/apache/fop/cli/InputHandler.java30
-rw-r--r--src/java/org/apache/fop/events/EventFormatter.xml2
-rw-r--r--src/java/org/apache/fop/events/ResourceEventProducer.java14
-rw-r--r--src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java4
7 files changed, 38 insertions, 31 deletions
diff --git a/conf/fop.xconf b/conf/fop.xconf
index 86b72a811..439636049 100644
--- a/conf/fop.xconf
+++ b/conf/fop.xconf
@@ -443,10 +443,6 @@ the location of this file.
</renderer>
-->
- <renderer mime="text/plain">
- <pageSize columns="80"/>
- </renderer>
-
</renderers>
</fop>
diff --git a/src/documentation/content/xdocs/trunk/output.xml b/src/documentation/content/xdocs/trunk/output.xml
index 0516d05ea..01af40a56 100644
--- a/src/documentation/content/xdocs/trunk/output.xml
+++ b/src/documentation/content/xdocs/trunk/output.xml
@@ -704,8 +704,15 @@ out = proc.getOutputStream();]]></source>
]]></source>
<p>When the native attribute is specified and set to "true", all image resources will be natively injected
into the datastream using an object container rather than being converted into an IOCA FS45 image.
- Support for native image formats (e.g. JPEG, GIF) is not always available on printer implementations
+ Support for native image formats (e.g. JPEG, TIFF, GIF) is not always available on printer implementations
so by default this configuration option is set to "false".</p>
+ <p>
+ Setting <code>cmyk="true"</code> on the <code>images</code> element will enable CMYK
+ colors. This will only have an effect if the color mode is set to "color". Example:
+ </p>
+ <source><![CDATA[
+ <images mode="color" cmyk="true"/>
+]]></source>
</section>
<section id="afp-shading-config">
<title>Shading</title>
diff --git a/src/java/org/apache/fop/cli/CommandLineOptions.java b/src/java/org/apache/fop/cli/CommandLineOptions.java
index 2e6e204a8..011e84008 100644
--- a/src/java/org/apache/fop/cli/CommandLineOptions.java
+++ b/src/java/org/apache/fop/cli/CommandLineOptions.java
@@ -1028,7 +1028,11 @@ public class CommandLineOptions {
case IF_INPUT:
return new IFInputHandler(iffile);
case XSLT_INPUT:
- return new InputHandler(xmlfile, xsltfile, xsltParams, useCatalogResolver);
+ InputHandler handler = new InputHandler(xmlfile, xsltfile, xsltParams);
+ if (useCatalogResolver) {
+ handler.createCatalogResolver(foUserAgent);
+ }
+ return handler;
case IMAGE_INPUT:
return new ImageInputHandler(imagefile, xsltfile, xsltParams);
default:
diff --git a/src/java/org/apache/fop/cli/InputHandler.java b/src/java/org/apache/fop/cli/InputHandler.java
index a1ff1715b..363cd0767 100644
--- a/src/java/org/apache/fop/cli/InputHandler.java
+++ b/src/java/org/apache/fop/cli/InputHandler.java
@@ -51,6 +51,7 @@ import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.apps.Fop;
import org.apache.fop.apps.FopFactory;
+import org.apache.fop.events.ResourceEventProducer;
import org.apache.fop.render.awt.viewer.Renderable;
/**
@@ -64,8 +65,8 @@ public class InputHandler implements ErrorListener, Renderable {
protected File sourcefile;
private File stylesheet; // for XML/XSLT usage
private Vector xsltParams; // for XML/XSLT usage
- private EntityResolver entityResolver;
- private URIResolver uriResolver;
+ private EntityResolver entityResolver = null;
+ private URIResolver uriResolver = null;
/** the logger */
protected Log log = LogFactory.getLog(InputHandler.class);
@@ -85,23 +86,6 @@ public class InputHandler implements ErrorListener, Renderable {
}
/**
- * Constructor for XML->XSLT->FO input
- *
- * @param xmlfile XML file
- * @param xsltfile XSLT file
- * @param params Vector of command-line parameters (name, value,
- * name, value, ...) for XSL stylesheet, null if none
- * @param useCatalogResolver if true, use a catalog resolver
- * for XML parsing and XSLT URI resolution
- */
- public InputHandler(File xmlfile, File xsltfile, Vector params, boolean useCatalogResolver) {
- this(xmlfile, xsltfile, params);
- if (useCatalogResolver) {
- createCatalogResolver();
- }
- }
-
- /**
* Constructor for FO input
* @param fofile the file to read the FO document.
*/
@@ -213,10 +197,12 @@ public class InputHandler implements ErrorListener, Renderable {
* Tries the Apache Commons Resolver, and if unsuccessful,
* tries the same built into Java 6.
*/
- private void createCatalogResolver() {
+ public void createCatalogResolver(FOUserAgent userAgent) {
String[] classNames = new String[] {
"org.apache.xml.resolver.tools.CatalogResolver",
"com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver"};
+ ResourceEventProducer eventProducer =
+ ResourceEventProducer.Provider.get(userAgent.getEventBroadcaster());
Class resolverClass = null;
for (int i = 0; i < classNames.length && resolverClass == null; ++i) {
try {
@@ -226,7 +212,7 @@ public class InputHandler implements ErrorListener, Renderable {
}
}
if (resolverClass == null) {
- log.error("Could not find catalog resolver in class path");
+ eventProducer.catalogResolverNotFound(this);
return;
}
try {
@@ -234,8 +220,10 @@ public class InputHandler implements ErrorListener, Renderable {
uriResolver = (URIResolver) resolverClass.newInstance();
} catch (InstantiationException e) {
log.error("Error creating the catalog resolver: " + e.getMessage());
+ eventProducer.catalogResolverNotCreated(this, e.getMessage());
} catch (IllegalAccessException e) {
log.error("Error creating the catalog resolver: " + e.getMessage());
+ eventProducer.catalogResolverNotCreated(this, e.getMessage());
}
}
diff --git a/src/java/org/apache/fop/events/EventFormatter.xml b/src/java/org/apache/fop/events/EventFormatter.xml
index 7561f1548..341dd1395 100644
--- a/src/java/org/apache/fop/events/EventFormatter.xml
+++ b/src/java/org/apache/fop/events/EventFormatter.xml
@@ -79,6 +79,8 @@ Any reference to it will be considered a reference to the first occurrence in th
<message key="org.apache.fop.events.ResourceEventProducer.foreignXMLNoHandler">Some XML content will be ignored. No handler defined for XML with namespace "{namespaceURI}".</message>
<message key="org.apache.fop.events.ResourceEventProducer.imageWritingError">Error while writing an image to the target file.[ Reason: {e}]</message>
<message key="org.apache.fop.events.ResourceEventProducer.cannotDeleteTempFile">Temporary file could not be deleted: {tempFile}</message>
+ <message key="org.apache.fop.events.ResourceEventProducer.catalogResolverNotFound">Catalog resolver not found along the classpath</message>
+ <message key="org.apache.fop.events.ResourceEventProducer.catalogResolverNotCreated">Error creating the catalog resolver: {message}</message>
<message key="org.apache.fop.layoutmgr.inline.InlineLevelEventProducer.leaderWithoutContent">fo:leader is set to "use-content" but has no content.{{locator}}</message>
<message key="org.apache.fop.layoutmgr.inline.InlineLevelEventProducer.lineOverflows">Line {line} of a paragraph overflows the available area by {overflowLength,choice,50000#{overflowLength} millipoints|50000&lt;more than 50 points}.{{locator}}</message>
<message key="org.apache.fop.layoutmgr.BlockLevelEventProducer.rowTooTall">The contents of table-row {row} are taller than they should be (there is a block-progression-dimension or height constraint on the indicated row). Due to its contents the row grows to {effCellBPD} millipoints, but the row shouldn't get any taller than {maxCellBPD} millipoints.{{locator}}</message>
diff --git a/src/java/org/apache/fop/events/ResourceEventProducer.java b/src/java/org/apache/fop/events/ResourceEventProducer.java
index 607d2fab1..3753e83da 100644
--- a/src/java/org/apache/fop/events/ResourceEventProducer.java
+++ b/src/java/org/apache/fop/events/ResourceEventProducer.java
@@ -133,4 +133,18 @@ public interface ResourceEventProducer extends EventProducer {
*/
void cannotDeleteTempFile(Object source, File tempFile);
+ /**
+ * Catalog Resolver not found along the class path
+ * @param source the event source
+ * @event.severity ERROR
+ */
+ void catalogResolverNotFound(Object source);
+
+ /**
+ * Catalog Resolver not created, due to InstantiationException or IllegalAccessException
+ * @param source the event source
+ * @param message the exception message
+ * @event.severity ERROR
+ */
+ void catalogResolverNotCreated(Object source, String message);
}
diff --git a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
index 83dea01bf..cab68a13f 100644
--- a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
+++ b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
@@ -117,10 +117,6 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
this.layoutListener = layoutListener;
best = new BestPageRecords();
this.footnoteSeparatorLength = (MinOptMax) footnoteSeparatorLength.clone();
- // add some stretch, to avoid a restart for every page containing footnotes
- if (footnoteSeparatorLength.min == footnoteSeparatorLength.max) {
- footnoteSeparatorLength.max += 10000;
- }
this.autoHeight = autoHeight;
this.favorSinglePart = favorSinglePart;
}