Select to view content in your preferred language

Layout and page setup

583
5
Jump to solution
12-18-2012 09:10 AM
JonPedder
Deactivated User
I???m using a script to allow the users to select from different map templates, the templates range in paper size from Letter to ansi D.

My script finds a chosen attribute and zooms the map to that location, then exports to map as a pdf. My problem is that the page/paper size doesn???t appear to change when switching to the target mxd.

I notice the same behavior when using the ???switch layout??? function in the Layout toolbar.

Any idea how to use the page and paper settings of my target MXD?

Thanks
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JonPedder
Deactivated User
Thanks for your help. I'm wondering if

from arcpy import env

Might be my issue, I'll run through it again.

Thanks again

Jon

UPDATE - Yup that was it!

View solution in original post

0 Kudos
5 Replies
MathewCoyle
Honored Contributor
The page size property of mxds are read only in arcpy. You would have to set these manually, or use ArcObjects.
0 Kudos
JonPedder
Deactivated User
I have the page size set manually on my target mxd.

I'm in an mxd, lets call it default.mxd which is set at size letter, I want to print a ansi C sized map and have a template for that on my HD. Template is called ansiC.mxd and is set.

I run a python script that selects the ansiC.mxd and exports it to a PDF. However the page size used appers to be from Default.mxd rather than the template ansiC.mxd

I just want to honor the settings in my template mxd

Thanks
0 Kudos
MathewCoyle
Honored Contributor
What interaction is there between the two mxds?
0 Kudos
JeffBarrette
Esri Regular Contributor
If you call multiple MXDs and export, the export functions will use the settings saved in each MXD.  For example:
mxd1 = arcpy.mapping.MapDocument("c:/path/largeSize.mxd")
arcpy.mapping.ExportToPDF(mxd1, outputPath)
mxd2 = arcpy.mapping.MapDocument("c:/path/smallSize.mxd")
arcpy.mapping.ExportToPDF(mxd2, outputPath)

Will produce two different PDFs, each at different page sizes.

If you are using "CURRENT" and trying to load properties from other MXDs, that is NOT possible.  As suggested, pagesize and orientation can not be modified within an MXD.

Jeff
0 Kudos
JonPedder
Deactivated User
Thanks for your help. I'm wondering if

from arcpy import env

Might be my issue, I'll run through it again.

Thanks again

Jon

UPDATE - Yup that was it!
0 Kudos