[gdal-dev] Confusion regarding GeoPDF composition.xml units
Nyall Dawson
nyall.dawson at gmail.com
Mon Sep 21 19:52:14 PDT 2020
Hi list,
While attempting to fix https://github.com/qgis/QGIS/issues/33465 I'm
running into some confusion about the meaning of pdfCoordinateType
values in GeoPDF composition.xml files.
The example composition.xml from
https://gdal.org/drivers/raster/pdf.html includes:
<Page id="page_1">
<DPI>72</DPI>
<Width>10</Width>
<Height>15</Height>
....
This would suggest to me that the Width and Height (and accordingly
all pdfCoordinateType) values are in inches. But that doesn't match
with the actual behavior I'm seeing, where it seems like Width/Height
and other pdfCoordinateType values need to be specific in pixels (i.e.
size in inches * dpi).
Actually it's a bit more complex than this, because regardless of the
DPI specified for the page, the width/height have to be specified in
size in inches * 72! (i.e. there's a hardcoded 72 dpi assumption
somewhere).
Can anyone clarify exactly how PDF coordinates and sizes should be
calculated in composition.xml?
Thanks!
Nyall
More information about the gdal-dev
mailing list