none
Is there a way to determine the page number of a PDF file shown in Access 2016 WebBrowser Control? RRS feed

  • Question

  • Hello,

    I am using Access 2016 and using the web browser control for opening one web site for data fathering and it is also used for viewing some long pdf files.. 

    My question is sometimes I need to determine the number of the current displayed page so I can make some operations on that single page.

    Is there a way to determine the current shown page number?

    Thanks in advance


    Ehab, Egy.

    Saturday, December 9, 2017 1:08 PM

Answers

  • Just a stab in the dark, but can you not get this from the URL?  Extract the current URK of the webbrowser and check if there is a Page parameter.

    Daniel Pineault, 2010-2017 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    • Marked as answer by Ehab_EGY Wednesday, December 20, 2017 5:16 AM
    Sunday, December 10, 2017 12:08 PM
  • Once displayed in a WebBrowser control you wouldn't really be able to retrieve this information from Adobe Reader. I suspect the only way would be to use an Acrobat API, which would not be directly accessible through the WebBrowser control.

    If you display directly in Acrobat Reader, which can done using Shell or ShellExecute, then it looks like you can use the old DDE IAC mechanism:

    https://stackoverflow.com/questions/7777238/get-currently-open-document-and-page-in-view-for-adobe-reader-instance


    Paul ~~~~ Microsoft MVP (Visual Basic)

    • Marked as answer by Ehab_EGY Wednesday, December 20, 2017 5:16 AM
    Monday, December 11, 2017 3:36 PM
  • Hello Ehab,

    You could try to add page number like "#page=10" at the end of the pdf file path.

    Such as 

    file:///C:/Users/Admin/Desktop/Test.pdf#page=10

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Terry Xu - MSFT Wednesday, December 20, 2017 2:19 AM
    • Marked as answer by Ehab_EGY Wednesday, December 20, 2017 5:16 AM
    Monday, December 11, 2017 2:40 AM

All replies

  • Just a stab in the dark, but can you not get this from the URL?  Extract the current URK of the webbrowser and check if there is a Page parameter.

    Daniel Pineault, 2010-2017 Microsoft MVP
    Professional Support: http://www.cardaconsultants.com
    MS Access Tips and Code Samples: http://www.devhut.net

    • Marked as answer by Ehab_EGY Wednesday, December 20, 2017 5:16 AM
    Sunday, December 10, 2017 12:08 PM
  • Hello Ehab,

    You could try to add page number like "#page=10" at the end of the pdf file path.

    Such as 

    file:///C:/Users/Admin/Desktop/Test.pdf#page=10

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Terry Xu - MSFT Wednesday, December 20, 2017 2:19 AM
    • Marked as answer by Ehab_EGY Wednesday, December 20, 2017 5:16 AM
    Monday, December 11, 2017 2:40 AM
  • Once displayed in a WebBrowser control you wouldn't really be able to retrieve this information from Adobe Reader. I suspect the only way would be to use an Acrobat API, which would not be directly accessible through the WebBrowser control.

    If you display directly in Acrobat Reader, which can done using Shell or ShellExecute, then it looks like you can use the old DDE IAC mechanism:

    https://stackoverflow.com/questions/7777238/get-currently-open-document-and-page-in-view-for-adobe-reader-instance


    Paul ~~~~ Microsoft MVP (Visual Basic)

    • Marked as answer by Ehab_EGY Wednesday, December 20, 2017 5:16 AM
    Monday, December 11, 2017 3:36 PM
  • Hi Ehab_EFY,

    Has your original issue been resolved? If it has, I would suggest you mark the helpful reply as answer or provide your solution and mark as answer to close this thread. If not, please feel free to let us know your current issue.

    Best Regards,

    Terry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, December 20, 2017 2:19 AM