0 Replies Latest reply on Feb 24, 2011 4:30 AM by chitrabhanu

    How to show print dialog as soon as it opens in browser

    chitrabhanu

      I need to open a pdf with print dialog through AcroJS. The code that I used is:

       

      console.show();

      var pp = this.getPrintParams();

      pp.interactive = pp.constants.interactionLevel.full;

      this.print(pp);

       

      In order to add the script I used iText. I made a PdfAction object which add the javascript  to the file. I used PdfWriter to set the open action as:


      writer.setOpenAction(PdfAction.javaScript(<script>));

       

      But it is not working. It gives the following error when I open the pdf.

       

      InvalidArgsError: Invalid arguments.

      Global.print:1:Doc undefined:Open

       

      The acrobat reader version is 7. Any help will be appreciated. Thanks in advance.