7 Replies Latest reply on May 1, 2014 1:26 AM by Test Screen Name

    Problem with trusted function

    DocSnyder

      Hi,

      My problem is I've created a form with a button to save it under a different filename.

      So from what I've read I'd to create a script with a trusted function, so far so good, in Adobe Acrobat XI anything works fine, I can save the form without any trouble.

      I've put the script inside: (Windows 7)

       

      C:\Program Files\Adobe\Acrobat 11.0\Acrobat\Javascripts

       

      The script itself had the follwing content (found here on the forum, just modified it so that an invoice number is added to the filename which is generated after form printing):

       

      var ProcessDocument4 = app.trustedFunction(function(cPath, InvoiceNb) { app.beginPriv();  // Build path root from current documen  // Split off the ".pdf" at the end (this is just one way it can be done)  var aPth = this.path.split(".");  aPth.pop();  var cPathRoot = aPth.join("."); // Now run the extraction loop  for ( var i = 0; i < this.numPages; i++ ) this.extractPages({nStart: i, cPath: util.printf("%s_%s.pdf", cPathRoot, InvoiceNb)}) ;  app.endPriv(); });

       

      Form on Button click:

       

      ProcessDocument4(aPth+"/", InvoiceNumber);

       

      Now the problem:

       

      What do I 've to do, to make the script work in Reader X on Windows 7?

       

      When I click the button there, I've got an error message telling me thats not allowed to save a copy of a filled form instead I've to ptint it out.

      So I thought I've to place the trusted function script for Reader X too, so I did and placed i here:

       

      C:\Program Files\Adobe\Reader 10.0\Reader\Javascripts

       

      Which didn't solved the problem.

      Then I was reading about that I've to save the PDF with additional rights for reader, so I did, no error but it still doesn't save the form.

       

      Now I'm a bit clueless how to make it work in both programs.