Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.8.5, 5.1.1, 5.2.0 Beta1
-
None
-
OS X 10.8.3
-
-
26a0a3ed85008c3a0edae125fca48c7c36a7437f
Description
Build and run the following code on Mac. Open the resulting PDF file. Note that the paper is still in the default letter or A4 size even though it reports the custom size is set.
Change the output format to PdfFormat and it will be in correct size. But all text are converted to outline.
#include <QtGui> #if QT_VERSION >= 0x050000 #include <QtPrintSupport> #endif #include <QDebug> int main(int argc, char *argv[]) { QApplication a(argc, argv); QPrinter p; p.setOutputFileName("/tmp/test.pdf"); #if defined(Q_OS_MAC) p.setOutputFormat(QPrinter::NativeFormat); #endif p.setPaperSize(QSizeF(5, 5), QPrinter::Inch); p.setMargins({0,0,0,0}); qDebug() << p.printerName() << p.paperSize() << p.paperSize(QPrinter::Inch) << p.paperRect() << p.pageRect(); QPainter pp(&p); pp.drawRect(p.pageRect()); return 0;//a.exec(); }
Attachments
Issue Links
- is replaced by
-
QTBUG-34276 Setting the paper size for QPrinter to a custom size has no effect on the final printed page size
- Closed