JAL-1807 test
[jalviewjs.git] / bin / javajs / img / PdfEncoder.js
index 0a468dc..664879f 100644 (file)
@@ -1,58 +1,58 @@
-Clazz.declarePackage ("javajs.img");\r
-Clazz.load (["javajs.img.ImageEncoder"], "javajs.img.PdfEncoder", ["java.util.Hashtable", "javajs.export.PDFCreator"], function () {\r
-c$ = Clazz.decorateAsClass (function () {\r
-this.isLandscape = false;\r
-this.pdf = null;\r
-this.comment = null;\r
-Clazz.instantialize (this, arguments);\r
-}, javajs.img, "PdfEncoder", javajs.img.ImageEncoder);\r
-Clazz.makeConstructor (c$, \r
-function () {\r
-Clazz.superConstructor (this, javajs.img.PdfEncoder, []);\r
-});\r
-Clazz.overrideMethod (c$, "setParams", \r
-function (params) {\r
-this.isLandscape = (this.quality > 1);\r
-this.comment = "Jmol " + params.get ("comment");\r
-}, "java.util.Map");\r
-Clazz.overrideMethod (c$, "generate", \r
-function () {\r
-this.pdf =  new javajs["export"].PDFCreator ();\r
-var pageWidth = 576;\r
-var pageHeight = 792;\r
-this.pdf.setOutputStream (this.out);\r
-this.pdf.newDocument (pageWidth, pageHeight, this.isLandscape);\r
-this.addMyImage (pageWidth, pageHeight);\r
-var ht =  new java.util.Hashtable ();\r
-if (this.comment != null) ht.put ("Producer", this.comment);\r
-ht.put ("Author", "JMol");\r
-ht.put ("CreationDate", this.date);\r
-this.pdf.addInfo (ht);\r
-this.pdf.closeDocument ();\r
-});\r
-Clazz.defineMethod (c$, "addMyImage", \r
-($fz = function (pageWidth, pageHeight) {\r
-this.pdf.addImageResource ("img1", this.width, this.height, this.pixels, true);\r
-var w = (this.isLandscape ? pageHeight : pageWidth);\r
-var h = (this.isLandscape ? pageWidth : pageHeight);\r
-var iw = this.width;\r
-var ih = this.height;\r
-if (iw > 0.9 * w) {\r
-ih = Clazz.doubleToInt (ih * 0.9 * w / iw);\r
-iw = Clazz.doubleToInt (w * 0.9);\r
-}if (ih > 0.9 * h) {\r
-iw = Clazz.doubleToInt (iw * 0.9 * h / ih);\r
-ih = Clazz.doubleToInt (h * 0.9);\r
-}var x = 0;\r
-var y = 0;\r
-var x1 = iw;\r
-var y1 = ih;\r
-if (w > iw) {\r
-x = Clazz.doubleToInt ((w - iw) / 2);\r
-x1 = iw + x;\r
-}if (h > ih) {\r
-y = Clazz.doubleToInt ((h - ih) / 2);\r
-y1 = ih + y;\r
-}this.pdf.drawImage ("img1", x, y, x1, y1, 0, 0, this.width, this.height);\r
-}, $fz.isPrivate = true, $fz), "~N,~N");\r
-});\r
+Clazz.declarePackage ("javajs.img");
+Clazz.load (["javajs.img.ImageEncoder"], "javajs.img.PdfEncoder", ["java.util.Hashtable", "javajs.export.PDFCreator"], function () {
+c$ = Clazz.decorateAsClass (function () {
+this.isLandscape = false;
+this.pdf = null;
+this.comment = null;
+Clazz.instantialize (this, arguments);
+}, javajs.img, "PdfEncoder", javajs.img.ImageEncoder);
+Clazz.makeConstructor (c$, 
+function () {
+Clazz.superConstructor (this, javajs.img.PdfEncoder, []);
+});
+Clazz.overrideMethod (c$, "setParams", 
+function (params) {
+this.isLandscape = (this.quality > 1);
+this.comment = "Jmol " + params.get ("comment");
+}, "java.util.Map");
+Clazz.overrideMethod (c$, "generate", 
+function () {
+this.pdf =  new javajs["export"].PDFCreator ();
+var pageWidth = 576;
+var pageHeight = 792;
+this.pdf.setOutputStream (this.out);
+this.pdf.newDocument (pageWidth, pageHeight, this.isLandscape);
+this.addMyImage (pageWidth, pageHeight);
+var ht =  new java.util.Hashtable ();
+if (this.comment != null) ht.put ("Producer", this.comment);
+ht.put ("Author", "JMol");
+ht.put ("CreationDate", this.date);
+this.pdf.addInfo (ht);
+this.pdf.closeDocument ();
+});
+Clazz.defineMethod (c$, "addMyImage", 
+($fz = function (pageWidth, pageHeight) {
+this.pdf.addImageResource ("img1", this.width, this.height, this.pixels, true);
+var w = (this.isLandscape ? pageHeight : pageWidth);
+var h = (this.isLandscape ? pageWidth : pageHeight);
+var iw = this.width;
+var ih = this.height;
+if (iw > 0.9 * w) {
+ih = Clazz.doubleToInt (ih * 0.9 * w / iw);
+iw = Clazz.doubleToInt (w * 0.9);
+}if (ih > 0.9 * h) {
+iw = Clazz.doubleToInt (iw * 0.9 * h / ih);
+ih = Clazz.doubleToInt (h * 0.9);
+}var x = 0;
+var y = 0;
+var x1 = iw;
+var y1 = ih;
+if (w > iw) {
+x = Clazz.doubleToInt ((w - iw) / 2);
+x1 = iw + x;
+}if (h > ih) {
+y = Clazz.doubleToInt ((h - ih) / 2);
+y1 = ih + y;
+}this.pdf.drawImage ("img1", x, y, x1, y1, 0, 0, this.width, this.height);
+}, $fz.isPrivate = true, $fz), "~N,~N");
+});