3 Replies Latest reply on Jan 7, 2011 1:03 AM by Dave Merchant

    How to set Bookmark Panel shown by default when page is loaded?




      I have a report generated with bookmarks and shown in webpage (.aspx) using Acrobat Reader.


      What I need is to show Bookmark panel by default when the webpage is first loaded (instead of user click on the button) and unwrap the long bookmark text.


      I am very new to AcrobatReader Javascript API, I am not sure how to access the Reader object and it's Bookmark Panel etc.



      Please advise,


      Thank you.

        • 1. Re: How to set Bookmark Panel shown by default when page is loaded?
          gkaiseril MVP & Adobe Community Professional

          With Acrobat you can set the initial view to show the bookmarks. This is done by editing the 'properties' of an open PDF.


          For a web page hyper link you can can the 'pagemode=bookmarks' parameter.




          You can even add an document level JavaScript action to use the undocumented 'pane' property to open the bookmark navigation pane.


          this.pane = "bookmarks";

          • 2. Re: How to set Bookmark Panel shown by default when page is loaded?
            accca Level 1

            Thank you so much GKaiseril for your response.


            I need to make my request clearer:


            the report it is not a PDF doc, (i.e with a .pdf extension), it is dynamically generated by ActiveReports engine, it displays in ActiveReports WebViewer control, and this WebViewer control has set to shown report in AcrobatReader.


            this report is over 100 pages long, so it is very important to have Bookmarks panel shown by default to users (these Bookmarks serves like a Table of Contents.)



            so I guess this



            not apply to my case, because the report is not a static .pdf doc.



            so I am wondering how you other suggestion works.


            this.pane = "bookmarks";








            what is 'this' referring to?  how to access it?


            the ActiveReports WebViewer control render to browser as:  (using ViewSource from the Browser)



            <div id="WebViewer2" style="height:900px;width:100%;">
            <input name="WebViewer2ReportReceipt" type="hidden" value="RptMain;129388129784305980;975193086"/>
            <input name="WebViewer2ViewerType" type="hidden" value="AcrobatReader"/>
            <DIV id="WebViewer2_controlDiv">
              <iframe src="230877205_1999741824_1627437866_1885748823.ArCacheItem" style="width:100%;height:900px;"></iframe>


            so which object should I access?


            Please advise,

            Thank you in advance.

            • 3. Re: How to set Bookmark Panel shown by default when page is loaded?
              Dave Merchant MVP & Adobe Community Professional

              If your report is opening in Adobe Reader, then it most certainly IS a PDF file. Adobe Reader can't open anything else.


              The HTML fragment you quote uses an IFRAME tag, which means that the content which actually embeds the PDF into the page is on a separate URL, namely "230877205_1999741824_1627437866_1885748823.ArCacheItem".


              If you have control over how the PDF data is assembled by ActiveReports before it's sent to the browser, then you may be able to insert the initial view tag. If you can edit the IFRAME source but not the PDF, you can add the #pagemode attribute to the SRC attribute passed to the OBJECT tag that loads Reader.


              Adding a JavaScript to a dynamically-created PDF file is a far more complex process, so I'd ignore all the mentions of this.pane. In the context of Adobe Reader, "this" refers to the PDF file which contains the script; however very few server-side PDF libraries have the functions necessary to add scripting to PDFs, and quite frankly the use of this.pane is a cheap hack, because the Acrobat JS API doesn't have control over the initial view settings in the Properties dialog.