Open Pdf Within Qt application and go to specific page.



  • I have spent couple of days to search my answer but not lucky to get the answer.so i need help to all my friends.

    Within my Qt application I'm able to open a PDF using the OS default viewer thru the following code:

      QDesktopServices::openUrl(QUrl::fromLocalFile(filePath));
    

    This works fine.but now i want the functionality like if i want to directly go to specific page eg page number 20 so we can directly go to that page.
    So basicly i want a function in my class where we can specify the page number of pdf file and directly jump to that page number.

    thanks for help in advance


  • Qt Champions 2016

    Hi
    I dont think u can as you just tell system,
    "please open what ever application that like this file."

    It also depends on viewer how to go to a page.,

    For Acrobat reader, it takes
    Acrobat /A "page=<pagenum>" %1.pdf

    /A command line to open at a page but for other viewers it will be different.
    http://partners.adobe.com/public/developer/en/acrobat/PDFOpenParameters.pdf


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.