From f9c2f96e554bbb4a626b949307c82ed25762ce7b Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Fri, 4 Jul 2003 19:59:16 +0000 Subject: [PATCH] Make resolution configurable git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196597 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fo/FOUserAgent.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/fop/fo/FOUserAgent.java b/src/java/org/apache/fop/fo/FOUserAgent.java index c88fd609d..9fbcf9ae4 100644 --- a/src/java/org/apache/fop/fo/FOUserAgent.java +++ b/src/java/org/apache/fop/fo/FOUserAgent.java @@ -94,6 +94,7 @@ public class FOUserAgent implements LogEnabled { private Map handlers = new java.util.HashMap(); private String baseURL; private PDFEncryptionParams pdfEncryptionParams; + private float px2mm = 0.35277777777777777778f; //72dpi (=25.4/dpi) /** * Sets the logger. @@ -168,7 +169,15 @@ public class FOUserAgent implements LogEnabled { * @return float conversion factor */ public float getPixelUnitToMillimeter() { - return 0.35277777777777777778f; + return this.px2mm; + } + + /** + * Sets the resolution in dpi. + * @param dpi resolution in dpi + */ + public void setResolution(int dpi) { + this.px2mm = (float)(25.4 / dpi); } /** -- 2.39.5