4 Replies Latest reply on Aug 27, 2012 5:45 PM by Sean_Wilson

    How do I open to a specific page or destination in a pdf file using Buddy API Xtra?

    DanEdmonds Level 1



      I'm working with a CD ROM catalog that utilizes the Buddy API Xtra to open PDF files when a link is clicked. The client would like to be able to open to a specific page within a pdf file.


      I can open a pdf file using the Buddy API baOpenfile() function but I'm having trouble opening to a specific page when I add #page=4:


      baOpenfile("@\pdfs\Powder Cores\Magnetics_Powder_Core_Catalog_2011.pdf#page=4","normal")


      I've also tried working with the code below which seems to me like it should work... I didn't realize that the "open..." part of it was a function in Director.


      on mouseUp me
        pageNum = 4
        theApp = baShortFileName(baFindApp("pdf"))
        theDoc = baShortFileName("@\pdfs\Powder Cores\Magnetics_Powder_Core_Catalog_2011.pdf") 
        theArgs = "/s /A page=" & string(pageNum)   & "&pagemode=bookmarks"
        -- (translates to "/A page=4" in this example)
        open theApp && theArgs && theDoc




      Thank you in advance!