View Full Version : Need to print to a file

01-13-2006, 04:05 PM

I need to use PrintOut() to print the map to a file, but find that it's locking up when I make the call. Here are the parameters I'm using.

MapPoint.GeoPrintQuality.geoPrintQualityPresentati on,

Can someone please point out what I'm doing wrong with this? I'm using C#, and I find the program hangs on that command, indefinitely. When I select "Break" from the "Debug" menu, it's as if the program is active at the cursor, but if I press F10, it hangs all over again.

Thanks for the help,

01-13-2006, 10:55 PM
I have moved my program to another computer, and the file is being written. (I realized the file format is tif.) So it works. But oddly, without my prompting, Microsoft Office Document Imaging viewer opens automatically, and displays the image.

Has anybody got any idea why it's opening? How about to block it from opening? And on my main development machine it still hangs when I call PriotOut(). Could it be hanging, perhaps, because there is no default viewer? And it works on my second machine because there is a default viewer?

I'd appreciate anybody's help.


01-14-2006, 06:54 AM

I did exacly same test on my development machine, it does not block, the file is written to. Nothing is opened but I dont have that viewer installed.

mp.ActiveMap.PrintOut("c:\\test.ptm", "test", 1,
false, false, false, false);

I have no idea wy it should block on your other machine. Did you tryed to print to a printer also to test ?

About the auto opning. I'm pretty sure you can set this in registry that it would not, or maybe do not use it as default opener.

As an alternative you can probably copy the map image to clipboard, then copy it into an image object and save to file.