]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Make resolution configurable
authorJeremias Maerki <jeremias@apache.org>
Fri, 4 Jul 2003 19:59:16 +0000 (19:59 +0000)
committerJeremias Maerki <jeremias@apache.org>
Fri, 4 Jul 2003 19:59:16 +0000 (19:59 +0000)
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

index c88fd609ded4f09664cdcc2525c407c8fdf34061..9fbcf9ae497fc576b23f288a8e1f8a75f8834020 100644 (file)
@@ -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);
     }
 
     /**