Select to view content in your preferred language

Need help getting maps to export

931
5
11-16-2010 12:30 PM
SeanCook
Emerging Contributor
Hello all,

I am trying to export about 50 maps using a python script, and am having serious trouble. The exported maps consistently drop elements...scale bars, graphics, etc, and often export half a data frame and then simply stop. I have tried both PDF's and PNG's and neither work properly. Is there some sort of secret to exporting?

Any help would be very, very much appreciated. All I need to do is turn 50 MXD's into 50 PDFs in an automated fashion.

TIA,

Sean
0 Kudos
5 Replies
JeffBarrette
Esri Regular Contributor
Hi Sean,

Could you share a snippet of your code so I can see what you are trying to do.  Also if you want, please feel free to send me an MXD along with your code so I can take a look: jbarrette@esri.com.

Thanks,
Jeff
0 Kudos
JeffBarrette
Esri Regular Contributor
Sean,

Have you tried applying SP1?  There was a memory leak that was patched that may address your issue.

Jeff
0 Kudos
SeanCook
Emerging Contributor
Code is at bottom. I will also send you an MXD and a PDF which exported with errors so you can get an idea of what is going on.

I think I have installed SP1... I tried to, and assume it worked properly. Is there an easy way to verify, just in case?

import arcpy, glob, os
filelist = glob.glob('H:\\FINANCE\\Analysis\\ESRI\\MXD Files\\Atlas Project Templates\\Seans\\*.mxd')
for mxdfile in filelist:
    mxdname = os.path.basename(mxdfile)
    mxd = arcpy.mapping.MapDocument(mxdfile)
    arcpy.mapping.ExportToPDF(mxd, r"H:\\FINANCE\\Analysis\\ESRI\\MXD Files\\Atlas Project Templates\\Seans\\PDFs\\"+mxdname, image_quality = 'normal',picture_symbol = 'VECTORIZE_BITMAP', georef_info = False)
    print "PDF Exported: ", mxdname
    del mxd


Note: My code is not displaying tabbed over lines correctly here, but it is correct in that sense.
0 Kudos
JeffBarrette
Esri Regular Contributor
Sean,

The way to verify if SP1 is installed is to check via the ArcGIS Administrator.

1) Open ArcGIS Administrator
2) Click the root node
3) Read the Service Pack information section. It should read SP1 (build 10.0.1.2800)

We had a memory leak issue that that has similar symptoms as yours.

Does this fail at all when you run the Export on 1, 2 or just a few MXDs?  If it happens with just one MXD then this may be a different issue.

Thanks,
Jeff
0 Kudos
SeanCook
Emerging Contributor
I do have SP1 installed, and no, it does not have the same issue when doing just one mxd. I haven't tried a few but assume it works better. It also does it with PNGs, which seem to be less memory intensive, based on export speed at least.
0 Kudos