How to Prevent Data Driven Pages From Hanging on Subsequent Export?
Based on comments from @Adam, I used a Python script to export my Data Driven Pages MXD with no problems with hanging on subsequent exports. Using Python for the exports appears to have solved the problems I was having.
I used the following script which I added to an ArcMap Toolbox as a script. (The script will only run through Toolbox, since there are parameters included.)
#Set Input Parameters
mxd = arcpy.GetParameterAsText(0)
PDFpath = arcpy.GetParameterAsText(1)
PDFname = arcpy.GetParameterAsText(2)
#Create an MXD object
mxd_doc = arcpy.mapping.MapDocument(mxd)
#Export to DDP
ddp = mxd_doc.dataDrivenPages
ddp.exportToPDF(PDFpath + r"\\" + PDFname + ".pdf", "ALL")
del mxd, mxd_doc, PDFname, PDFpath
I would like to further modify my script to be able to specify which pages should be exported (instead of defaulting to "ALL") but this works sufficiently for what I need now.
Since this has gotten only comments so far (including one of my own) I'll take a chance and figure the problem (if not some mystery of Windows OS) is caused by up to four interrelated things.
- Your background raster(s) are very high resolution
- Your export DPI is very large
- Your Output Image Quality/Resample Ratio is set to 1:1
- The location(s) of your data server(s) and/or connection speed is(are) causing a hiccup
Some combination of these is hanging your DDP export. And by "some combination" it could mean only one of them.
If I had to pick one I would look into the last one, especially if I were using an ESRI Online product or have extremely large data sets on a network or remote drive - even vector data and especially so if we're talking Shapefile (just try using the Measure Tool when there are half a million vertices in your view:).
Unfortunately this hang-up also seems to simultaneously corrupt the .mxd file. At root this seems to actually be a Bug-in-ArcMap™ but I cannot find any indication that ESRI knows of or is doing something about this.
That leaves a labor intensive work-around of
- Saving your .mxd when you have something ready for publishing,
- Exporting one time (whether it be a single page, range of pages, or all pages),
- Then closing without saving,
- Then opening the .mxd again to repeat the 2nd and 3rd steps for each subsequent export.
>EDIT
Based on the recently linked question (how did I miss that one?) and ESRI being officially unaware - see this PDF here, I'd say it has something to do with the Basemap Service interacting with DDP (especially if the pages rotate the data frame). This problem seems to be unique to 10.3 and 10.3.1 and may not be resolvable without a formal fix.
I ran into the same issue today. I called ESRI support and came up with a workaround. The issue is with exporting all data driven pages to PDF, geoprocessing results and scale dependent pages.
The workaround:
Instead of adding the imagery basemap thru the typical basemap button, I added a new ArcGIS server in ArcCatalog and connected to http://services.arcgisonline.com/arcgis/services and dragged the "World_Imagery" layer into my table of contents, then cleared my geoprocessing results and then removed the scale dependent option in data driven pages.