Hi Guys,
I have implemented a page layout user interface that creates and displays a multiple page map. It uses a separate PrinterInteractiveOverlay for each of the maps. My problem is that I would like to print all of the maps as a multiple page document. How do I do that with the PrinterGeoCanvas?
Thanks!
Steve
Print multiple pages with PrinterGeoCanvas
Hi Steve,
I read the code of PrinterGeoCanvas today, it looks it’s hard to find a solution to implement that, because we directly draw the shapes on e.Graphics and I have no idea about how we can handle the layers from PrinterInteractiveOverLays if you put them in same PrinterGeoCanvas.
Do you think that’s possible we loop the PrinterInteractiveOverLays and print each of them? I think that should be simple but maybe takes much more memory.
In fact maybe we can bind event to PrintPage, call “e.HasMorePages = true; return;” in it, then replace original shapes, maybe we can simulator print the multiple page, but I am not sure whether it can work, and there is a big problem here is that we cannot clear original shapes.
Regards,
Don
Hi Don,
Thanks for your response, I was afraid it might be a problem. I have a couple of ideas for a workaround that might work.
Thanks,
Steve
Hi Steve,
Could you please share to us if you found any workaround can work well? Because we met a same issue before but finally haven’t found a good solution for multiple page print.
Thanks,
Don
Hi Don,
I have attached a sample project I used in developing my workaround. My main problem was to create a multi-page PDF. I am using two third party controls to achieve this. You might be able to use PdfSharp for this.
So I use PDF995 to create a separate pdf for each page, then merge the pages together with a separate third party tool, Debenu Quick Pdf Library.
Look at the Print routine, I have added a few comments. I think it would be easy to apply the same idea to printing to a hardware printer.
Steve
002_001_PageLayoutPrintTest.zip (86.1 KB)
Hi Steve,
Thanks for your share!
Our developer have downloaded your sample and I am sure your solution is helpful for him about this problem.
Thanks,
Don
Steve,
I did something similar to what you are talking about a month ago or so. I’ll try and dig up the code for it. In my case I had one overlay but added multiple page layers offset from each other so the user could move between pages on one map. I then implemented multipage based on each page in the overlay. If you have multiple overlays you could just go in and print each layer from each overlay and do each on a different page. It was a bit tricky because of the way .net does their printer support. The end effect was perfect and we sent the output to pdf and xps and the multipage worked fine.
David
David,
Thanks, I would appreciate a look at your solution.
Steve
Steve,
I was onsite at a customer when I did it and asked them if they remember so I don’t have to re-invent it. If not I will write a new sample showing it. This time I’m gonna put it into the code community… I hate doing things twice! :-)
David