/* output mode */
private int outputmode = NOT_SET;
- private java.util.HashMap rendererOptions;
-
+ private FOUserAgent foUserAgent;
+
private Log log;
private Vector xsltParams = null;
log = LogFactory.getLog("FOP");
boolean optionsParsed = true;
- rendererOptions = new java.util.HashMap();
+
+ foUserAgent = new FOUserAgent();
+
try {
optionsParsed = parseOptions(args);
if (optionsParsed) {
case SVG_OUTPUT:
return Driver.RENDER_SVG;
case AREA_OUTPUT:
- rendererOptions.put("fineDetail", isCoarseAreaXml());
+ foUserAgent.getRendererOptions().put("fineDetail", isCoarseAreaXml());
return Driver.RENDER_XML;
case RTF_OUTPUT:
return Driver.RENDER_RTF;
}
/**
- * Get the renderer specific options.
- * @return hash map with option/value pairs.
+ * Get the FOUserAgent for this Command-Line run
+ * @return FOUserAgent instance
*/
- public java.util.HashMap getRendererOptions() {
- return rendererOptions;
+ protected FOUserAgent getFOUserAgent() {
+ return foUserAgent;
}
/**
package org.apache.fop.apps;
// Java
+import java.util.HashMap;
import java.util.Map;
import java.io.IOException;
import java.io.InputStream;
private String baseURL;
private PDFEncryptionParams pdfEncryptionParams;
private float px2mm = 0.35277777777777777778f; //72dpi (=25.4/dpi)
+ private HashMap rendererOptions = new java.util.HashMap();
+
+ /**
+ * Returns the renderer options
+ * @return renderer options
+ */
+ public HashMap getRendererOptions() {
+ return rendererOptions;
+ }
/**
* Sets the base URL.
Driver driver = new Driver();
options = new CommandLineOptions(args);
+ driver.setUserAgent(options.getFOUserAgent());
inputHandler = options.getInputHandler();
try {
}
}
- if (driver.getRenderer() != null) {
- driver.getRenderer().setOptions(options.getRendererOptions());
- }
driver.render(inputHandler);
} finally {
if (bos != null) {
// XML
import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
// FOP
import org.apache.fop.fo.FONode;
super(parent);
}
+ /**
+ * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
+ * XSL/FOP Content Model: empty
+ */
+ protected void validateChildNode(Locator loc, String nsURI, String localName) {
+ invalidChildError(loc, nsURI, localName);
+ }
+
/**
* @see org.apache.fop.fo.FObj#addProperties
*/
*/
protected Date creationDate = null;
- /**
- * renderer configuration
- */
- protected Map options;
-
/**
* block progression position
*/
creationDate = date;
}
- /** @see org.apache.fop.render.Renderer */
- public void setOptions(Map opt) {
- options = opt;
- }
-
/** @see org.apache.fop.render.Renderer */
public void startRenderer(OutputStream outputStream)
throws IOException { }
*/
void setupFontInfo(FontInfo fontInfo);
- /**
- * Set up renderer options.
- *
- * @param options The Configuration for the renderer
- */
- void setOptions(Map options);
-
/**
* Set the producer of the rendering. If this method isn't called the
* renderer uses a default. Note: Not all renderers support this feature.
}
private boolean isCoarseXml() {
- return ((Boolean) options.get("fineDetail")).booleanValue();
+ return ((Boolean)
+ userAgent.getRendererOptions().get("fineDetail")).booleanValue();
}
/**
driver.setRenderer(Driver.RENDER_XML);
}
- Map rendererOptions = new java.util.HashMap();
- rendererOptions.put("fineDetail", new Boolean(false));
- rendererOptions.put("consistentOutput", new Boolean(true));
- driver.getRenderer().setOptions(rendererOptions);
+ userAgent.getRendererOptions().put("fineDetail", new Boolean(false));
+ userAgent.getRendererOptions().put("consistentOutput", new Boolean(true));
driver.getRenderer().setProducer("Testsuite Converter");
String outname = res;