ThinkGeo.com    |     Documentation    |     Premium Support

Problem with scale when printing with Print Preview

I have a map with a WMTS layer background and some vector layers. I created a print preview that includes a legend, a scale line, a couple of ImagePrinterLayers and some text and graphics. Everything looks fine on the screen, but when printing to a PDF or hard copy the scale is off. The vector layers appear to be OK, but the WMTS layer no longer lines up with the vector layers. The ScaleLinePrinterLayer is shorter and no longer properly represents the scale. Also, the two ImagePrinterLayers are much larger. There are some other problems as well, as you can see by the images I’ve includes. We are at the tail end of converting our application from TG10 to TG14 so I’m wondering if there is some setting I’m missing. We don’t have any of these problems in the TG10 version of our application. We are at version 14.5.4. I have included a png file that is a screenshot of the Print Preview and also a pdf that I created from it.

Any thoughts?

Thanks!

Steve

Printing Problem.zip (3.9 MB)

Hi Steve,

Thanks for the screenshot and the PDF. Here is what I found.

First, could you check whether your print code sets printerGeoCanvas.Dpi to anything other than the default 96? If it does, remove that line (or set it to 96) and print again. If it doesn’t, please send me the printing part of your code, where the PrintDocument and PrinterGeoCanvas are created and the layers are drawn.

Dpi only matters for content that has to be rasterized on its way to the printer, such as GeoTiff/ECW-type raster layers or a layer with opacity/color effects. It does nothing for vectors, text or tiled layers like WMTS(set the requests to x2 if the server supports), so you lose no quality at 96. That said, a different Dpi should never throw the raster layers off. That is a bug, and it is fixed in beta130.

About the scale line: the printed bar is the correct one. On a display with Windows scaling above 100%, the preview draws it too long. Could you confirm your display scaling (150%?) and check the printed bar against a known distance in your data? This is also fixed in beta130.

Could you try beta130 and confirm it fixes both issues? We will then put the fixes into the next hotfix as usual.

Thanks,
Ben

Hi Steve,

Just FYI we’ve added whole bunch of new features in the latest beta branch, with 3d and GPU rendering. Check this out whenever you have a chance: ThinkGeo 15 in 1 Minute — Unleash Your GPU, here is the new sample: ThinkGeo HowDoI v15.

It’s in beta and we are planning to have it released in October.

Thanks,
Ben

Thanks Ben!

We are in the middle of testing to get ready of a Fall release of our application. I’m sure we will be moving to v15 in the not too distant future.

Steve

Sounds good! And just FYI the current CPU renderer will go side by side with the new GPU renderer (at least for quite a while), so your current code will also work with the new version.

Ben