0 Replies Latest reply on Nov 16, 2010 11:00 PM by roswell@mail.bg

    How to report current page number to the browser...


      I need to dynamicaly attach a script in a bunch of PDF files. The script will be attached when the user requests the document and the document will be embeded in the page like this:


      <embed id="PDFObj" src="test.pdf" width="100%" height="100%">


      I have a JavaScript in my webpage with a message handler:


      var PDFObject = document.getElementById("PDFObj");

      PDFObject.messageHandler =

        onMessage: function(aMessage)
          switch (aMessage[0])
            case "_pdf_PageOpened":
              alert("!_pdf_PageOpened!\n" + aMessage[1]);


      I'm using hostContainer.postMessage on Page/Open event and it works just fine when the event(action) is manualy attached.


      My question is:

      How to attach the Page/Open event on every page in the PDF file using script that runs on Acrobat Reader?

      In Acrobat Pro I can use Doc.setPageAction() but it doesn't work in Acrobat Reader that is embeded in the browser window.




      Is there any other way to report the current page number to the webbrowser for an embeded PDF?