[Layout] Geospatial PDF has slightly incorrect dimensions (e.g. A4: 297 x 210.3 instead of 297 x 210) #60267
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Print Layouts
Related to QGIS Print Layouts, Atlas or Reporting frameworks
What is the bug or the crash?
Exporting a layout as Geospatial PDF, the exported PDF may have slightly incorrect dimensions e.g.:
Steps to reproduce the issue
Versions
Supported QGIS version
New profile
Additional context
It looks like the issue may be due to the fact that the "page size in PDF units" written in the composition.xml file is rounded using the
std::ceil
function instead ofstd::round
QGIS/src/core/qgsabstractgeopdfexporter.cpp
Lines 518 to 525 in f75d66f
That leads to e.g. an A4 landascape Geospatial PDF having
/MediaBox [ 0 0 842 596 ]
instead of/MediaBox [ 0 0 842 595 ]
or an A0 portrait Geospatial PDF having/MediaBox [ 0 0 2384 3371 ]
instead of/MediaBox [ 0 0 2384 3370 ]
See, for reference: "International standard paper sizes in PostScript and PDF"
The text was updated successfully, but these errors were encountered: