You are not logged in.

#26 2019-01-06 20:00:07

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

seth wrote:

Yes, definitively - and "again": https://bugreports.qt.io/browse/QTBUG-24949 (this is a Qt 4.8 bug I googled up)

Yes I managed to reproduce it with this source code (you can compile it with QtCreator) :
https://bugreports.qt.io/secure/attachm … estPdf.zip


#include <QGuiApplication>
#include <QTextDocument>
#include <QPrinter>

int main(int argc, char **argv) {
    QGuiApplication app (argc, argv);
    QTextDocument document;
    document.setHtml("<a href=\"http://www.google.com/\">Google</a>");
    QPrinter printer(QPrinter::HighResolution);
    printer.setOutputFormat(QPrinter::PdfFormat);
    printer.setOutputFileName("out.pdf");
    document.print(&printer);
    return 0;
}

the PDF generated has numbers with comma instead dot on PC where locale and region are set to "fr_FR.UTF-8" (numbers displayed with comma separator instead point) :

/MediaBox [0 0 595,000000 842,000000] 

Last edited by Potomac (2019-01-06 20:04:16)

Offline

#27 2019-01-06 20:08:34

seth
Member
Registered: 2012-09-03
Posts: 49,951

Re: [solved] Can not print text with Qt5 applications

It's actually not the exact same bug, it's just the same thing that happened to the MediaBox object which before happened to the Annot Rect - maybe it's lingering around for even more things.

Offline

#28 2019-01-08 19:53:16

Potomac
Member
Registered: 2011-12-25
Posts: 526

Re: [solved] Can not print text with Qt5 applications

Qt developpers have released a patch in order to fix this bug :

https://codereview.qt-project.org/#/c/249357/

https://codereview.qt-project.org/#/c/2 … g/qpdf.cpp

thanks Seth for your help smile

Last edited by Potomac (2019-01-08 20:01:41)

Offline

Board footer

Powered by FluxBB