Details
-
Bug
-
Resolution: Unresolved
-
P4: Low
-
None
-
4.7.1
-
None
Description
Hello,
when I creating and print an QTextDocument with pictures, witch are stored in the resource system to PDF. the resulting PDF file are very lage. 2 JPEG files with 220kb together will result in an PDF file with 600KB.
Sample:
QPrinter *printer=new QPrinter();
printer->setOutputFormat(QPrinter::PdfFormat);
printer->setPaperSize(QPrinter::A4);
printer->setOutputFileName(/tmp/foo.pdf");
printer->setColorMode(QPrinter::Color);
QTextDocument *doc=new QTextDocument();
doc->setPageSize(printer->paperSize(QPrinter::Millimeter));
QTextCursor cursor(doc);
QTextImageFormat picture1;
picture1.setName(":/picture/top.jpg");
picture1.setWidth(150);
cursor.insertImage(picture1,QTextFrameFormat::FloatLeft);
QTextImageFormat picture2;
picture2.setName(":/picture/right.jpg");
picture2.setWidth(45);
cursor.insertImage(picture2,QTextFrameFormat::FloatRight);
doc->print(printer);
Attachments
Issue Links
- is required for
-
QTBUG-25379 QtPrintSupport - PDF Issues
- Open