From 792c66ee02b239b857d72669697312e5e7d82932 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 10 Nov 2005 16:09:03 +0000 Subject: [PATCH] Scale factor was wrong. Base must be 72dpi, not the default resolution of the PDFDocumentGraphics2D. 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java b/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java index 43d0cdf3c..ffe99b8f2 100644 --- a/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java +++ b/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java @@ -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"); -- 2.39.5