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

QPdfEngine does not encode /Title field according PDF specification

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.6.2
    • 4.6.0
    • GUI: Printing
    • None
    • 9ba9308a997bac90c30b766a48f44451e86e14d9

    Description

      The code that writes out the title of a PDF file is located in QPdfEnginePrivate::writeInfo() and looks like the following:
      xprintf("<<\n"
      "/Title (%1)", title.toUtf8().constData());

      However that's wrong according to PDF spec. In '14.3.3 Document Information Dictionary' it is stated that the Title field must be of type 'text string'. In '7.9.2.2 Text String Type' it is defined that a string of this type must be encoded either by UTF-16BE or PDFDocEncoding. UTF-8 seems to be completely wrong here and results in the bug that Okular and Acrobat show gibberish in the window title or document information if the title contains non-latin1 characters.

      A bug report for KDE with an example document can be found at https://bugs.kde.org/show_bug.cgi?id=207749

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kjernase Trond Kjernåsen (Inactive)
            tokoe Tobias Koenig
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes