ThinkGeo.com    |     Documentation    |     Premium Support

Bing Maps layers shifts when printing

We are using TG 10 for WinForms.

Recently we began using Bing Maps. Everything works fine in the Map view and with Print Preview also. However, when we print to a hard-copy printer or ‘Microsoft Print To PDF’ the Bing Maps layer appears shifted. I have attached a sample project and would appreciate any help.

Thanks!

Steve
PageLayoutSample (Bing Maps Printing).zip (47.6 KB)

Hi Steven,

Thanks for your sample, it’s a very good sample for reproduce this issue and saved our time to research it.

We found the solution for match it is like this:

If you try to print it to printer for example “Print to PDF”, please set the dpi equal 100.

    Dim oPrinterCanvas As PrinterGeoCanvas = New PrinterGeoCanvas()
    oPrinterCanvas.Dpi = 100

It should works.

The left one is the result after set dpi and the right is default dpi.

Regards,

Ethan

Ethan,

Thanks for the help. I have tested with the sample and it works fine now. I have a question. Is this a bug? If we implement this as a permanent fix in our application will it stop working correctly if a bug is fixed?

Thanks!

Steve

Hi Steve,

It’s a known problem and we won’t modify the logic for it in MapSuite 10.0 because some reason.

It should get solved in coming Version 11.

Regards,

Ethan

Hi Ethan,

When I set the Dpi to 100 on the PrinterGeoCanvas, the Bing Maps correctly align with the shapefile. However, recently I discovered that this causes another problem. I created a map that has a narrow margin of about 1/4 inch. I also set the Background Mask of the MapPrinterLayer to have a red outline to make it easy to see. Also I specified a red outline for the PrinterPageLayer and print it so we can see where the edge of the page should be. Also I placed a label in the center close to the bottom of the page.

When I make a PDF with the Microsoft PDF driver. The bottom of the label is cut off. Also the red border does not draw all the way to the right or across the bottom of the page. This also happens if you print a hard copy. It looks like everything is shifted slightly to the left and down. Is there a workaround?

I have attached another sample so you can see what I am talking about.

Thanks!

Steve

PageLayoutSample (Bing Maps Printing).zip (50.5 KB)

Hi Steven,

Thanks for your sample.

I tried to find a workaround for it but failed. I think we need to double check the logic in PrinterGeoCanvas and modify the logic of it to solve this problem.

Any update I will let you know.

Regards,

Don

Hi Steven,

That’s more complex than I thought, it looks the PagePrinterLayer and PageGeoCanvas don’t have DPI related logic and it’s not easy to add.

I think we will enhancement the LabelPrinterLayer first to solve the cut problem.

And then we can go on work for solve the red edge problem.

Regards,

Ethan

Hi Steven,

Our developer had fixed it, when you set DPI equal 100, the label, border will print correct also.

Please upgrade your package to https://www.nuget.org/packages/ThinkGeo.MapSuite.Layers.Printers/11.0.0-beta016.

Regards,

Ethan

Ethan,

Thank-you, it seems to be working fine. Do you know when the fix will be available in a production release?

Thanks!

Steve

Hi Steve,

We had moved the changes into https://www.nuget.org/packages/ThinkGeo.MapSuite.Layers.Printers/10.5.1, please try it and let us know if you met any problem.

Regards,

Ethan