0 Replies Latest reply on Feb 18, 2009 10:48 AM by Lumpia

    iText + Silent Print

    Lumpia
      I know my iText issue sounds like a broken record, but we've narrowed down the problem. To sum up, the user can merge multiple documents via checkboxes and also choose a watermark via a dropdown. The problem occurs when after the documents are merged, if the user leaves the document open on their desktop, then if another user attempts to merge a different document, then they are presented with the same document that the first user merged. As soon as the first user closes the document down, all future documents merge successfully.

      One way we are going about resolving this issue is to utilize Acrobats' Scripting function: Silent Printing, in conjunction with a document.close() function. The reason is that after our users merge, they continue by printing the paperwork out. So, if we can autoprint without user interaction, and then immediately close the merged document, then this should resolve the issue. Please advise if you think I should go in a different direction.

      That being said, here is the code Acrobat says to use:

      var pp = this.getPrintParams();
      pp.interactive = pp.constants.interactionLevel.silent;
      this.print(pp);
      document.close();

      I figure that this function will need to be enclosed in a <cfscript> tag, so I tried this:

      <cfscript>
      function testPrint() {
      var pp = this.getPrintParams();
      pp.interactive = pp.constants.interactionLevel.silent;
      this.print(pp);
      document.close();
      }
      </cfscript>

      <cfoutput>#testPrint()#</cfoutput>

      This did not work. I realize my javascript is not that strong, so please understand. I was also thinking that somehow, I need to put the name of the merged document (concatenation.pdf) within the function, so I messed with this:

      <cfscript>
      function testPrint(concatenation.pdf) {
      var pp = this.getPrintParams();
      pp.interactive = pp.constants.interactionLevel.silent;
      this.print(pp);
      document.close();
      }
      </cfscript>

      <cfoutput>#testPrint()#</cfoutput>

      But, it doesn't work either. Please assist in how to properly add silent printing to my code. If you can be specific in your answer, that would be appreciated. Thanks.