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

PDF output converts text to outline, rendering them un-searchable

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 4.8.x, 5.3.0
    • 4.8.5, 5.1.1, 5.2.0
    • None
    • Mac OS X 10.8.3, Mac OX 10.9
    • macOS

    Description

      When printing to PDF, all text in the resulting PDF are converted to outline path instead of character strings. This makes it impossible to search for text in the PDF.

      Run the sample code below and open the resulted PDF in Acrobat. Search for any text and none will be found. It also disallows coping text from the PDF. See the attached PDF.

      #include <QApplication>
      #include <QPrinter>
      #include <QPrintDialog>
      #include <QPainter>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QPrinter p;
          p.setOutputFileName("test.pdf");
          QPainter painter(&p);
          QFont f("Helvetica", 30);
          qDebug() << f.exactMatch();
          painter.setFont(f);
          painter.drawText(50, 150, "This text is not seachable.");
          painter.end();
          return 0;//a.exec();
      }
      
      

      Attachments

        1. test.pdf
          9 kB
          Stephen Chu

        Issue Links

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

          Activity

            People

              johnlayt John Layt
              stephenju Stephen Chu
              Votes:
              3 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes