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

Generating large pdf files when using pen with zero width

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.7, 6.2.1, 6.3.0 Alpha
    • 5.12.9
    • PDF
    • None
    • Windows
    • 6d41b64d45cda12370653300fdc2d2685c450014 (qt/qtbase/dev) 7befef2588be12137b7b82b2b82954b637c0fbef (qt/qtbase/6.2) c93c8e84a1aae1ef5762047fb1f3f84af8166b2c (qt/tqtc-qtbase/5.15)

    Description

      When Qt exports pdf with pen of zero width, the output file will be very large.
      QPen (QBrush(Qt::black), 0, Qt::DashLine) file size: 1504k
      QPen (QBrush(Qt::black), 1, Qt::DashLine) file size: 6k

      QPdfWriter *writer = new QPdfWriter("c:/a.pdf");
      
      QPainter *painter = new QPainter(writer);
      
      QPen pen(QBrush(Qt::black), 0, Qt::DashLine);
      
      painter->setPen(pen);
      
      for (int i = 0; i < 1000; i++) 
      { 
           painter->drawLine(100, i, 500, i); 
      }
      
      delete painter;
      
      delete writer;
      

      Attachments

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

        Activity

          People

            vgt Eirik Aavitsland
            piggestbaby lei chen
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: