5

Judging from the answer to Changing page layout from portrait to landscape using ArcPy with ArcMap?, one cannot change the page size etc from ArcPy, so I set up my "template" mxds so my script can save a new copy of it, change data sources etc. This methods works perfectly for my A4 maps.

However, my A0 mxds are losing the printer and page settings from the template. My A0_template.mxd is set to print from the plotter on A0 paper using the default printer settings. After the copy of the mxd is produced and I open it, the printer has somehow changed to the normal small printer with the paper size matching the default tray. I am simply using the saveACopy(filename) method which is part of the MapDocument class.

Why would the correct settings for the A4 mxd be saved, but not for the A0?

7
  • 2
    this problem happens to me using the save() too, any solution ?
    – geogeek
    Commented Sep 16, 2012 at 14:48
  • Thank you, I thought I was going crazy. I haven't found a solution, it's still bugging me that I have to physically open the A0 document myself and change the settings. I'm thinking it's do with the fact that the plotter is not the default printer, so when it saves the new mxd and finds that the printer is not the default, it changes it to the default. Commented Sep 18, 2012 at 5:16
  • yes the problem comes from the default printer, in my case i'm PDF creator, now when i set PDF creator to default printer, it works Fine.
    – geogeek
    Commented Sep 19, 2012 at 7:45
  • So in your script/model, do you set the printer you want as the default printer before save()? Commented Sep 19, 2012 at 8:16
  • no,i set the default printer throught "windows printers" , then the default printer is used in arcgis by default
    – geogeek
    Commented Sep 19, 2012 at 8:52

2 Answers 2

2

Bug and workaround with arcview 10.0: when using the save() or the saveACopy(filename) functions, the mxd paper size must be present in the windows default printer settings. If not, these functions will replace the current page settings with a default A4.

Easiest workaround: change default printer before save operation.

win32print.SetDefaultPrinter(printer) should be helpfull to programatically change the default printer.

0
2

I was able to get this to stop happening by unchecking the "Use Printer Paper Settings" box.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.