diff options
author | Glen Mazza <gmazza@apache.org> | 2003-11-04 21:56:23 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2003-11-04 21:56:23 +0000 |
commit | a2056453e3b648eb7d58ed8f487a0b87023de504 (patch) | |
tree | 49a6a0ed7c124b8f5d42f09c2575412b3f61cb0e | |
parent | cfda23fd7b48deb9af1024ac8242b285cc78e311 (diff) | |
download | xmlgraphics-fop-a2056453e3b648eb7d58ed8f487a0b87023de504.tar.gz xmlgraphics-fop-a2056453e3b648eb7d58ed8f487a0b87023de504.zip |
Tom DeWeese's changes made;
See: http://marc.theaimsgroup.com/?l=fop-dev&m=106795227230411&w=2
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196980 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/java/org/apache/fop/svg/PDFTranscoder.java | 16 |
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 |