3 Replies Latest reply on Apr 18, 2011 9:06 PM by gkaiseril

    PDDoc Save Problem

    Ken Krugh Level 1

      I have a script written in VBA (Outlook 2003, Win XP, Acrobat 9) that works on one machine but not another. The problematic part is the PDDoc.Save with which I'm saving the file to a new path and filename.

       

      When it doesn't work the PDDoc.Save returns True as if it DID save but no PDF is produced and the name of the open PDF doesn't change.

       

      Again, this works on one machine but not another and I've been unable to figure out what the difference.

       

      Any ideas?

       

      Thanks!

      Ken

        • 1. Re: PDDoc Save Problem
          George_Johnson MVP & Adobe Community Professional

          This question is more appropriate for the Acrobat SDK forum here. You should also provide more details, such as what versio of Acrobat is being used on each machine, the code you're using, more info about the file and what your code is doing with it, etc.

          • 2. Re: PDDoc Save Problem
            Ken Krugh Level 1

            I've posted the question to the SDK forum, though I'm not sure why this would fall under the guise of the SDK and not just scripting.

             

            I mentioned in the initial post that the Acrobat version is 9, 9.4.3 to be exact, on both machines. I've also since tested it on a third machine and, again, it worked just fine.

             

            The code is pretty straight forward:

                Set AcroAVDoc = Acro.GetActiveDoc
                Set AcroPDDoc = AcroAVDoc.GetPDDoc
                WasSaved = AcroPDDoc.Save(AcroSave.WebOptimized, CheckPath$ & PDFName$)

            I've double and triple checked all the parameters and they're correct when the PDDoc.Save is executed so I'm at a loss as to why it's not actually doing anything.

             

            Is there some sort of setting in Acrobat that might be preventing the scripting from saving the file?

             

            Thanks again

            • 3. Re: PDDoc Save Problem
              gkaiseril MVP & Adobe Community Professional

              This forum is for Acrobat JavaScript within a PDF form and not a part of a plug-in or using IAC.

               

              If you check the Acrobat JS API Reference included with the SDK, you will note there is a feature called the Quick Bar and this includes a box that indicated if a method or property has any security restriction associated with it. For the 'doc' object's 'saveAs' method there are 2 security restrictions noted. The first indicates that 'saveAs' method must be executed through the 'trustedFunction' of the 'app' object, more details are included in the Acrobat JS API Reference. The second notation indicates that the PDF will also need special rights applied to it if this method is used in a form opened in Adobe Reader.

               

              The Acrobat JS API Reference also includes information about when an object, property, or method was added the Acrobat JS model by version or when a change to the object, method, or property was made by version.

               

              The use of the 'trustedFunciton' was introduced in version 6.