Select to view content in your preferred language

Is there a way to set the pagesize with python?

1961
2
Jump to solution
02-14-2017 06:17 AM
petegillard
Regular Contributor

Updating 34x22 mxd's with new data paths/orthos and legend fixes, working great (with some help from the GeoNet community), except it defaults to 8.5x11 pagesize!

Any ideas?

thanks,

Pete

0 Kudos
1 Solution

Accepted Solutions
IanMurray
Honored Contributor

Hi Pete,

If you have the Production Mapping extension(available 10.3+ I believe), then there is a python function for setting a map documents page size.

http://desktop.arcgis.com/en/arcmap/latest/extensions/production-mapping/setpagesize-function.htm

If you don't have it or are using below 10.3, then unfortunately, you can read the page size property using the arcpy.mapping module by creating a Map Document object, but it is read only.

http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/mapdocument-class.htm

What is your current workflow you are using to update your maps?  Can you link to the other questions you have had answered?  Can you create a template 34x22 map to copy your layers over to or something similar(I've done this before, when I needed to move several hundred map documents from an old template to a new one.)? 

Edit:  As always there seems to be an ArcObjects solution.  If you want to dig into it at all there is a blog post about doing this https://clubgis.net/python-to-change-page-size-and-layout-for-arcmap/

View solution in original post

2 Replies
IanMurray
Honored Contributor

Hi Pete,

If you have the Production Mapping extension(available 10.3+ I believe), then there is a python function for setting a map documents page size.

http://desktop.arcgis.com/en/arcmap/latest/extensions/production-mapping/setpagesize-function.htm

If you don't have it or are using below 10.3, then unfortunately, you can read the page size property using the arcpy.mapping module by creating a Map Document object, but it is read only.

http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/mapdocument-class.htm

What is your current workflow you are using to update your maps?  Can you link to the other questions you have had answered?  Can you create a template 34x22 map to copy your layers over to or something similar(I've done this before, when I needed to move several hundred map documents from an old template to a new one.)? 

Edit:  As always there seems to be an ArcObjects solution.  If you want to dig into it at all there is a blog post about doing this https://clubgis.net/python-to-change-page-size-and-layout-for-arcmap/

petegillard
Regular Contributor

Thanks again, Ian. I did see the 'read only' option. We hope to get 10.5 going here soon, so maybe it will work then. Mostly I'm just testing out a way to preemptively update mxd's. as our old server hasn't been disconnected yet (I think there's more on it than GIS stuff, so the IT folks are hesitant to remove it). In the mean time some of the users here are opening older mxd's and not realizing they are still on the older server, which doesn't have some of the updated data on it. Once the data links are broken, it might be an easier fix (though i'm also trying to get up to speed on my Python skills).

0 Kudos