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

PDF creation through QPdfWriter, QTextDocument with HTML and QPainter results in white-only text

    XMLWordPrintable

Details

    • Windows

    Description

      Hello. There is a bug with QPdfWriter, QPainter, QTextDocument. Basically, I'm creating QPdfWriter and QTextDocument with HTML. Than I'm creating QPainter and using QTextDocument::drawContents method. This results in valid PDF file, but all texts in it always stays white. Text becames black only when I'm using QTextDocument::print method. I tried to tweak QTextDocument blocks text foreground color, set up QPalette on QTextDocument & globally, setting QPen & QBrush on QPainter - nothing works to make text black. I could produce black text only with manual QPainter calls, like QPainter::drawText. I will also attach a simplified version of my code where problem persists. Thank you.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            graullon Sergey Hrushak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes