Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.7, 5.15.1, 5.15.2, 6.0.0
-
None
-
macOS Catalina and macOS Big Sur
Description
On macOS, the PageSize reported by a printer via CUPS is not accurate due to a qRound used in the code.
I have a card printer that supports only the paper size CR80 (54.86 x 86.02mm). This is the size mentioned by the manufacturer and the size seen in CUPS web page.
In the printer PPD file, the page size is correctly being defined as 155.52 243.84 (in points).
Being a point 1/72 of an inch, we can check that:
- The expected page size height is: 155.52 * (1/72) * 25.4 = 54.86 mm
- The expected page size width is: 243.84 * (1/72) * 25.4 = 86.02 mm
However, the reported size in QPageSize is 54,68mm x 85,73mm.
When printing at 300 DPIs, the final image size sent to the printer has less pixels then expected.
I've isolated the problem to qRound being used when values are read from PPD file:
qtbase\src\plugins\printsupport\cups\qppdprintdevice.cpp (line 156/180 on Qt 5.15 branch and line 160/184 on Qt 6 branch)
QSize size = QSize(qRound(ppdSize->width), qRound(ppdSize->length));
Instead of a QSize, it will be necessary to use a QSizeF.
I can help with the fix, if necessary.