]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Scale factor was wrong. Base must be 72dpi, not the default resolution of the PDFDocu...
authorJeremias Maerki <jeremias@apache.org>
Thu, 10 Nov 2005 16:09:03 +0000 (16:09 +0000)
committerJeremias Maerki <jeremias@apache.org>
Thu, 10 Nov 2005 16:09:03 +0000 (16:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@332319 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java

index 43d0cdf3caa23c2b83524a2bee2096643c927360..ffe99b8f28a2807357084709ce1c8d7000b38550 100644 (file)
@@ -67,6 +67,8 @@ public class PDFDocumentGraphics2D extends PDFGraphics2D
     private float svgWidth;
     private float svgHeight;
 
+    /** Normal PDF resolution (72dpi) */
+    public static final int NORMAL_PDF_RESOLUTION = 72;
     /** Default device resolution (300dpi is a resonable quality for most purposes) */
     public static final int DEFAULT_NATIVE_DPI = 300;
   
@@ -343,8 +345,8 @@ public class PDFDocumentGraphics2D extends PDFGraphics2D
             currentStream.write("" + PDFNumber.doubleOut(scaleX) + " 0 0 "
                                 + PDFNumber.doubleOut(scaleY) + " 0 0 cm\n");
         }
-        if (deviceDPI != DEFAULT_NATIVE_DPI) {
-            double s = DEFAULT_NATIVE_DPI / deviceDPI;
+        if (deviceDPI != NORMAL_PDF_RESOLUTION) {
+            double s = NORMAL_PDF_RESOLUTION / deviceDPI;
             at.scale(s, s);
             currentStream.write("" + PDFNumber.doubleOut(s) + " 0 0 "
                                 + PDFNumber.doubleOut(s) + " 0 0 cm\n");