1 Reply Latest reply on May 6, 2008 6:42 AM by (Rod_Ryner)

    call jscript on an html page from withing a pdf?

      My situation is this: I need to print a document that is opened from a web site via javascript and close the browser-window that is hosting the PDF after the print has been finished. Currently I'm using an FDF to open the PDF, inject form values and some inject script. The script is starting the print action. Unfortunately I seem to cannot close the browser from within the PDF via script - did I miss something? is that not possible?
        • 1. Re: call jscript on an html page from withing a pdf?
          Level 1
          I do this via fdf, under page properties, on page open it runs the following javascript, I actually have a lot you do not need, I print the same form addressed to multiple clients by importing data, also have a few loop break checks added so if program loops I will not print 1000s of pages.

          var procdoc = this.getField("pCloseDoc");
          if (procdoc.value == "y")
          {
          var xcopy = this.getField("pCopies");
          for (i=1;i<=xcopy.value; i++){
          this.print({bUI: false, bSilent: true, bSchrinkToFit: true});
          }
          xi=0;
          var xlastpath = "";
          var xpath = this.getField("pImportPath");
          while (xpath.value != "")
          {
          xi++;
          if (xi>500) break;
          this.importAnFDF({cPath: xpath.value});
          for (i=1;i<=xcopy.value; i++){
          this.print({bUI: false, bSilent: true, bSchrinkToFit: true});
          }
          if (xlastpath.value == xpath.value) break;
          xlastpath.value = xpath.value;
          }
          this.closeDoc({bNoSave: true});
          }