Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Including (and viewing) PDF file in Qt Help Collection
Forum Updated to NodeBB v4.3 + New Features

Including (and viewing) PDF file in Qt Help Collection

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 7.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    toralf
    wrote on last edited by
    #1

    This is something I find conflicting information on when I search the 'net:

    If I include a PDF file in a Qt Help Collection, is Qt Assistant supposed to be able to let me view it (possibly with the help of an external application)?

    I've actually packaged a couple of PDFs and one of my collections, and seem to remember having been able to view them in the past, but I could be wrong... What I do know is that currently, when I press links to the files in question in assistant, nothing whatsoever will happen - there is not even an error message on the console. This is using Qt Assistant 4.7.3 under CentOS Linux.

    Any help would be appreciated.

    TIA,

    • Toralf
    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Qt has no builtin means of viewing PDFs. There are two options:

      First:
      Include a pdf viewer like "poppler":http://poppler.freedesktop.org/ - be aware of license restrictions that can arise of the GPL.

      Second:
      Use a [[Doc:QWebView]] to display the help contents, connect a slot to signal "linkClicked() ":http://doc.qt.nokia.com/4.7/qwebview.html#linkClicked of that webview and in the slot, check whether the URL ends with .pdf and call "QDesktopServices::openUrl() ":http://doc.qt.nokia.com/4.7/qdesktopservices.html#openUrl on that URL. This will open the standard application associated with that file type. This is the way I do it (not with help contents, but "regular" html).

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • T Offline
        T Offline
        toralf
        wrote on last edited by
        #3

        I didn't ask for a built-in means of viewing PDF as such. I wanted to know if Qt Assistant can open links to PDF files, by opening a helper application if necessary.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          "https://bugreports.qt.nokia.com/browse/QTBUG-2514":https://bugreports.qt.nokia.com/browse/QTBUG-2514

          bq. We do not support showing pdf files inside Assistant, we basically dump them out of the compressed help file and use the corresponding desktop application to show it.

          [quote author="toralf" date="1316443967"]I've actually packaged a couple of PDFs and one of my collections, and seem to remember having been able to view them in the past, but I could be wrong...[/quote]

          Looks like you aren't. If it has worked for you but it doesn't anymore you should file a bug-report.

          1 Reply Last reply
          0
          • T Offline
            T Offline
            toralf
            wrote on last edited by
            #5

            [quote author="Lukas Geyer" date="1316504075"]"https://bugreports.qt.nokia.com/browse/QTBUG-2514":https://bugreports.qt.nokia.com/browse/QTBUG-2514

            bq. We do not support showing pdf files inside Assistant, we basically dump them out of the compressed help file and use the corresponding desktop application to show it.
            [/quote]

            Ah, yes, that's what I thought. I was a bit confused by posts like this, though:
            http://stackoverflow.com/questions/6947172/how-to-link-to-a-pdf-file-in-qt-assistant

            [quote author="Lukas Geyer" date="1316504075"]
            [quote author="toralf" date="1316443967"]I've actually packaged a couple of PDFs and one of my collections, and seem to remember having been able to view them in the past, but I could be wrong...[/quote]

            Looks like you aren't. If it has worked for you but it doesn't anymore you should file a bug-report.[/quote]
            https://bugreports.qt.nokia.com/browse/QTBUG-21559 ;-)

            I've found that as a workaround, PDFs may be packaged with a non-standard filename suffix - I've used ".pdf_". Qt Assistant will then fail to understand that the files have PDF format and will thus not assume they may be viewed internally. The desktop support routine that is called as a consequence, to open the files with an external application, will on the other hand still recognise them (based on content, I suppose) - at least on my setup.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved