4 Replies Latest reply on Aug 11, 2009 10:41 PM by ra_be

    Open another PDF at different pages

    ra_be

      Hello,

       

      I have a PDF document (A) and I would like to open another PDF (B) via a link or button (with a script) or whatever is practicable. This link/button however must open the PDF document B on a certain page (e.g. 34). Another link/button within PDF document A shall open the PDF document B on a different page (e.g. 45).

       

      A doubleclick on the PDF document B in the Windows Explorer shall open it "normal" on page 1.

       

      How can I open the same PDF document (from another PDF) at different pages? Is there script like "app.open ("file.pdf", page=34);"?

       

      Hoping someone can help.

      Thanks a lot.

      Regards,
      ra_be

        • 1. Re: Open another PDF at different pages
          try67 MVP & Adobe Community Professional

          You should use the Acrobat JavaScript Scripting Reference. There's no sense in trying to guess how it works.

          In this reference it says that the app.openDoc method returns a Document object, so you can do something like this:

           

          var newDoc = app.openDoc({cPath:"/c/temp/mydoc.pdf"}); // Open the file

          if (newDoc!=null) newDoc.pageNum = 33; // If it opened, go to page 34

          • 2. Re: Open another PDF at different pages
            ra_be Level 1

            Hello try67,

             

            thanks for your quick response.

             

            Indeed your are right, a look into the reference will shorten up quite a while.

             

            I have done and found the following:

             

            "var newDoc = app.openDoc("file.pdf", this);"

             

            But "if (newDoc!=null) newDoc.pageNum=10;" is not working.

             

            I need tha path relative to the "this"-file as the user must have the option to install the pdf where the want to.

             

            I was trying to find out something about the "pageNum", but not successful.

             

            Furthermore I need to open the new file in the same Adobe Acrobat (or Reader) window as the old pdf is "existing in". I.e. no new Adobe Acrobat or Reader instance.

             

             

            May you can help once more.

             

            Thanks.

            Regards,

            ra_be

            • 3. Re: Open another PDF at different pages
              try67 MVP & Adobe Community Professional

              Are you trying to use the code I wrote in LiveCycle? It's a JavaScript code,

              not FormCalc.

              • 4. Re: Open another PDF at different pages
                ra_be Level 1

                I am not using this code in LiveCycle. And yes it is Javascript (I don't think FormCalc will work out in Adobe Acrobat).

                 

                I have solved the problem by using the "link"-tool of Adobe Acrobat and invisible buttons on my document.

                 

                Nevertheless many thanks for kind assistance.

                 

                Regards,

                ra_be