Solved QPrinter, PDF and margins ...
-
In my sample program https://github.com/Schachigel/QtLetter I found out, that using a printer in pdf mode creates different results with QPrintPreview then with a pdf file.
Actually the file has additional margins added.I know that the print function of QTextDocuments docu talks about additional margins .. but I only use "drawContent" ...
Any idea why this is the case?
regards
Holger -
Sorry I did not read careful enough. Thought this would be included there https://doc.qt.io/qt-5/qpdfwriter.html
-
The same as in https://forum.qt.io/topic/119833/font-size-in-qprinter/2
Printing into a pdf is basically a printer driver.
Are you aware of https://doc.qt.io/qt-5/qtpdf-module.html ?
-
Thx you for this comment.
Are you aware of https://doc.qt.io/qt-5/qtpdf-module.html ?
This is for reading pdf, not writing, right?
Regards
Holger -
Sorry I did not read careful enough. Thought this would be included there https://doc.qt.io/qt-5/qpdfwriter.html
-
@koahnig Thx! That is much better. The add. margins do not show up in a pdf created with QPdfWriter (everything else the same as with QPrinter in "PDF mode"). I will update my sample on GitHub - maybe others can benefit, too.