3 Replies Latest reply on Apr 21, 2011 9:09 AM by Dave Merchant

    pass pdf pageNum to SWF or EXE

    tx51chevy

      I'm new to acrobat and acrobat's scripting API to say the least. Please forgive me if this is a NOOBIE question... but I just can't find any forums online that explain how to do this.

       

      Basically, I have PDF files that range between 100 and 1000 pages at my workplace. What I'm trying to do is add a button that dynamically opens a corresponding swf or exe file for that page.


      I know you can pass flashVars using the Multimedia Flash Tool option... but as far as I know you have to manually set a static value to pass. If there was a method you could use to dynamically send the current pageNum of the PDF file... that would work...

       

      The other way I've tried is to create a button and onMouseUp Run a JavaScript... problem here is, I can't figure out how to open a file other than another PDF file. I used the method this.pageNum to get the current page of the PDF file... but I can't open a SWF or EXE this way. Theoretically what I would be trying to do here is something like this:

       

       

      var currentPageNum = this.pageNum+1;
      app.openDoc('myswf'+currentPageNum+'.swf');

       

      Your help is greatly appreciated!

      Again, I apologize if this is noob stuff. Just started reading about all this last week!

      Thanks,

      Brad

        • 1. Re: pass pdf pageNum to SWF or EXE
          Dave Merchant MVP & Adobe Community Professional

          You can't open anything other than a PDF file with the app.openDoc method.

          • 2. Re: pass pdf pageNum to SWF or EXE
            tx51chevy Level 1

            Thanks Dave for replying.

            Unfortunately, I am aware that openDoc will only open PDF's. That example is what I'm trying to do theoretically.

             

            Is there a way programmatically to do what I'm trying to do. It seems like it would be something simple, especially since you can link to swf files using the flash tool and pass flashVars to it using the built in tools. But you can only pass static values that way... which is why I'm trying to do this programmatically.

             

            Basically, I need to open a SWF or EXE file and pass a parameter (the current page of the pdf file) to it.

             

            Any ideas?

             

            Thanks again for the reply!

            • 3. Re: pass pdf pageNum to SWF or EXE
              Dave Merchant MVP & Adobe Community Professional

              You can manually insert an "open file" link using the tools in Acrobat and point at anything you want, but the security settings in Acrobat and Reader will block any attempt to open executables, no matter how you make the link. Scripts cannot open non-PDF files nor can they browse the file system, again for security reasons.