<div dir="ltr">Hi Devs,<div><br></div><div>We may experience a difference regarding to the (visual) image size when saving the map to pdf vs png. The problem is already described in the following issue: </div><a href="https://github.com/mapserver/mapserver/issues/4487">Cairo SVG and PDF output larger than PNG</a> which is related to the pdf/svg canvas where the size is specified in points and not in pixels. That means: each point has a fixed size of 1/72 inches regardless of the device used.<div><br></div><div>Our problem here is that we pass the image size directly to <a href="http://cairographics.org/manual/cairo-PDF-Surfaces.html#cairo-pdf-surface-create">cairo_pdf_surface_create</a> or <a href="http://cairographics.org/manual/cairo-SVG-Surfaces.html#cairo-svg-surface-create">cairo_svg_surface_create</a> which is incorrect. We should rather pass </div><div>72.0 / map->resolution * map->width and 72.0 / map->resolution * map->height respectively. And we should also set map->resolution to 72 before the image is drawn to let the symbols scale with the image size correctly.</div><div><br></div><div>My question is what would be the correct handling for this in MapServer?</div><div><br></div><div>1. Don't do anything in MapServer let the client programs (like mapscript applications) to change the image size and scale.</div><div>2. Apply these corrections at the beginning of msDrawMap (for the pdf/svg renderers specifically) and restore the original values at the end of the drawing operation.</div><div>3. Apply these corrections at driver level (createImageCairo etc.)</div><div><br></div><div>For me #2 seems to be the most reasonable approach (with just a few lines of code). </div><div>#1 would not help for the existing apps (mapserv, shp2img) which should be fixed separately. And I cannot really see how #3 would work, since the image size and resolution is not wired directly into the drivers (createImage doesn't get the resolution for example).</div><div><br></div><div>Any ideas or alternatives?</div><div><br></div><div>Thanks,</div><div><br></div><div>Tamas</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div>