4 Replies Latest reply on Oct 11, 2009 8:42 AM by gkaiseril

    Saving A Called PDF On Close When Using Reader9

    Jim MacD Level 1

      Is there a way to save a PDF in READER9 in it’s current directory without being prompted as to what directory to save it in? When a called PDF in Reader9 is modified (ie by adding/deleting data), then closed, the user is prompted to save the PDF and THEN prompted with SAVE AS and asked in what directory it is to be saved in.

       

      If the same PDF is called and modified in adobe pro, the user is prompted only to save changes.

       

      The 'disclosed' property of the called PDF (PFSL-18. 06.96.pdf) is set to 'true'. 

       

      Code used to call the pdf is:

      var otherDoc = app.openDoc("../Mutual Fund Forms/PFSL-18, 06.96.pdf", this);

        • 1. Re: Saving A Called PDF On Close When Using Reader9
          Patrick Leckey Level 3

          The Doc.saveAs method allows you to specify a path and filename to save as, in Reader this is only available if the proper rights have been applied to the document since Reader does not allow saving a normal document.

          1 person found this helpful
          • 2. Re: Saving A Called PDF On Close When Using Reader
            gkaiseril MVP & Adobe Community Professional

            If you are going to save using JavaScript, you will need to provide the user with a special application level script that the user must install on their system.
            This security restriction was added with version 6 for all variations of Acrobat/Reader so there can be no silent saves from a PDF without the end user being aware of the possibility of a silent save. The user is aware because they installed the script.

            • 3. Re: Saving A Called PDF On Close When Using Reader
              Jim MacD Level 1

              I did not make myself clear enough - my mistake. The user is prompted with the following code - which does not save the modified document on YES.

               

              {

              var cMsg = "Do you want to save changes to ‘PFSL-18, 06.96.pdf’ before closing?";

              var nRtn = app.alert(cMsg,1,3,"PFSL-18");

               

              //Yes

              if(nRtn==4)

              {

              this.saveAs("../Mutual Fund Forms/PFSL-18, 06.96.pdf", this);

              this.closeDoc("../Mutual Fund Forms/PFSL-18, 06.96.pdf", this);

              }

               

              else

               

              //No

              {

              this.closeDoc("../Mutual Fund Forms/PFSL-18, 06.96.pdf", this);

              }

               

              }

               

              • 4. Re: Saving A Called PDF On Close When Using Reader
                gkaiseril MVP & Adobe Community Professional

                What errors are you getting?

                 

                There is only one parameter for the 'closeDoc' option.

                 

                See you other post for more information abuot the 'bSave' logical value, it is either 'true' or 'flase' to indicate the prompt for save action.

                 

                There are also some added restrictions to the 'closeDoc' method explained in then Acrobat JS API Reference.