Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-103891

investigate what PDF "named destinations" are good for and whether we need to support them in QtPDF

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P4: Low
    • None
    • 6.4.0 FF
    • PDF
    • None

    Description

      We got a code contribution for this: https://codereview.qt-project.org/c/qt-labs/qtpdf/+/264016

      A named destination is an anchor within a document. So far I haven't seen a PDF that has named destinations that are not bookmarks, so QPdfBookmarkModel works fine. But a hypothetical scenario could be that a piece of software ships with a manual in PDF format, and context-sensitive help could be provided by jumping to named destinations in the manual. If those are not bookmarks, maybe we need to add API for this. At any rate, Pdfium has a separate API for some reason: the patch uses FPDF_CountNamedDests FPDF_GetNamedDest and FPDFDest_GetDestPageIndex (was FPDFDest_GetPageIndex) whereas bookmarks use FPDFBookmark_GetFirstChild FPDFBookmark_GetTitle FPDFBookmark_GetDest FPDFDest_GetDestPageIndex FPDFDest_GetLocationInPage and FPDFBookmark_GetNextSibling. I.e. bookmarks are hierarchical, and can point to named dests, which in themselves are not hierarchical; but it could also be that named dests can exist separately.

      The hypothetical help system would use strings for anchor names and then search the known named dest objects to find the place to which to jump. If we don't need to display a list, we don't need a QAIM though. We could get by with an overload of QPdfPageNavigator::jump(QString), for example. But the application might need the list anyway, to populate the help links or validate them ahead of time or something like that. Perhaps we should build an example with a help system like that, at some point; but on the other hand, PDF format is best suited for material that's meant to be printed, or perhaps for small "reference cards" if the help is broken up into small snippets that would fit on them. For on-screen help of any length, I'd rather have continuous reflowable text, uninterrupted by page breaks: markdown or html.

      https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/html2015/index.html#t=Acro12_MasterBook%2Fpdfmark_Actions%2FDefining_named_destinations.htm

      https://forum.openoffice.org/en/forum/viewtopic.php?f=7&t=20448

      https://www.helpandmanual.com/help/hm_advanced_contexthelp_pdfdestinations.html

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-103891
          # Subject Branch Project Status CR V

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              srutledg Shawn Rutledge
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change