mapfish-print
mapfish-print copied to clipboard
72/90 DPI related issue?
@tsauerwein and I looked at the MapFish Print code this morning, and we might have found a problem related to the use of 72 as the PDF_DPI
. For posterity, I thought I could create an issue summarizing our findings.
In the createMapContext
function a larger map context is created if the DPI is higher than PDF_DPI
(72). I think this is correct if the author of the print template assumed 72 DPI when defining the map dimensions in the template.
But, then, in the WMS code, we add an extra DPI parameter (MAP_RESOLUTION
for MapServer) if the serverType
is specified and known and if the DPI is different from the PDF_DPI
. But, in that case, the WMS would assume 90 rather than 72 when interpreting the extra DPI parameter, resulting in incorrectly sized symbols in returned image.
Do people agree that there may be a problem here?
Another possible issue related to this: When WMS layers with a MAXSCALEDENOM
or MINSCALEDENOM
constraint are printed, they might not be shown because MapFish Print and MapServer use a different DPI value to calculate the scale.
For me the code about the PDF_DPI on this line should be removed! https://github.com/mapfish/mapfish-print/blob/b29dcc21afb709a7bcb3abc52e9c715f4c12b350/core/src/main/java/org/mapfish/print/map/image/wms/WmsUtilities.java#L89 there isn't any relation between the default DPI on the WMS server and on the PDF...
Then +1 @elemoine