Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.PdfWriter.addJavaScript()


      try {
        PdfWriter writer = PdfWriter.getInstance(document, baos);
        document.open();
        if (requ.getParameter("preview") == null)
          writer.addJavaScript("this.print(false);", false);
        document.add(new Chunk("Silent Auto Print"));
        document.close();
      } catch (DocumentException e) {
        e.printStackTrace();
      }
View Full Code Here


          cb.addTemplate(page, 1f, 0, 0, 1f, 0, 0);
        }
        System.out.printf("Processed page %s\n", i);
      }
      // --Add JS code
      writer
          .addJavaScript(
              "this.print({bUI: false, bSilent: true, bShrinkToFit: true});",
              false);
      // --Close document and stream
      document.close();
View Full Code Here

      try {
        PdfWriter writer = PdfWriter.getInstance(document, baos);
        document.open();
        if (requ.getParameter("preview") == null)
          writer.addJavaScript("this.print(false);", false);
        document.add(new Chunk("Silent Auto Print"));
        document.close();
      } catch (DocumentException e) {
        e.printStackTrace();
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.