From: Jeremias Maerki Date: Fri, 4 Jul 2003 19:59:16 +0000 (+0000) Subject: Make resolution configurable X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1344 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f9c2f96e554bbb4a626b949307c82ed25762ce7b;p=xmlgraphics-fop.git Make resolution configurable git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196597 13f79535-47bb-0310-9956-ffa450edef68 --- 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); } /**