aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/java/org/apache/fop/svg/PDFTranscoder.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/java/org/apache/fop/svg/PDFTranscoder.java b/src/java/org/apache/fop/svg/PDFTranscoder.java
index 000312c2c..2d0bd7cc2 100644
--- a/src/java/org/apache/fop/svg/PDFTranscoder.java
+++ b/src/java/org/apache/fop/svg/PDFTranscoder.java
@@ -64,6 +64,7 @@ import org.apache.avalon.framework.container.ContainerUtil;
import org.apache.batik.bridge.BridgeContext;
import org.apache.batik.bridge.BridgeException;
import org.apache.batik.bridge.GVTBuilder;
+import org.apache.batik.bridge.UserAgent;
import org.apache.batik.bridge.ViewBox;
import org.apache.batik.dom.svg.SVGOMDocument;
import org.apache.batik.gvt.GraphicsNode;
@@ -116,10 +117,21 @@ public class PDFTranscoder extends AbstractFOPTranscoder
public PDFTranscoder() {
super();
this.handler = new FOPErrorHandler();
-
}
/**
+ * @see org.apache.fop.svg.AbstractFOPTranscoder#createUserAgent()
+ */
+ protected UserAgent createUserAgent() {
+ return new SVGAbstractTranscoderUserAgent() {
+ // The PDF stuff wants everything at 72dpi
+ public float getPixelUnitToMillimeter() {
+ return 0.3427778f;
+ }
+ };
+ }
+
+ /**
* @see org.apache.avalon.framework.configuration.Configurable#configure(Configuration)
*/
public void configure(Configuration cfg) throws ConfigurationException {
@@ -158,7 +170,7 @@ public class PDFTranscoder extends AbstractFOPTranscoder
try {
graphics.setupDocument(output.getOutputStream(), w, h);
- graphics.setSVGDimension(width, height);
+ graphics.setSVGDimension(w, h);
if (hints.containsKey(ImageTranscoder.KEY_BACKGROUND_COLOR)) {
graphics.setBackgroundColor