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

Pdf print engine draws an excessive border for objects in images with transparent background

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 4.6.2
    • Fix Version/s: None
    • Component/s: GUI: Printing
    • Labels:
      None
    • Environment:
      all platforms

      Description

      The following code will produce a pdf file where the yellow line is contoured by a grey frame:

      #include <QtGui>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
      
          QPixmap pixmap(200, 100);
          pixmap.fill(Qt::transparent);
          QPainter pixPainter(&pixmap);
          QPen pen(Qt::yellow);
          pen.setWidth(5);
          pixPainter.setPen(pen);
          pixPainter.drawLine(10, 10, 100, 10);
          pixmap.save("pixmap.png");
      
          QPrinter printer;
          printer.setOutputFileName("output.pdf");
          QPainter painter(&printer);
          painter.drawPixmap(pixmap.rect(), pixmap);
          painter.end();
      
          return 0;
      }
      

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mpejcoch Martin Pejcoch (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes