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

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 4.6.2
    • GUI: Printing
    • None
    • 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

              Unassigned Unassigned
              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