Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Nico Burgerhart made a fantastic script called "Batch export MXD to PDF" back in 2008. Any ideas how to implement it in ArcGIS 10? Something using Python perhaps? Data Driven Pages does not have anything comparable that i could find.

Here's the steps in read me text file which doesn't jive with ArcGIS 10's new menu bar:

Tool: Batch export MXD to PDF
Purpose: Saves all MXDs in the selected directory to PDFs in the selected output folder
Author: Nico Burgerhart (
Date: 31 Jan. 2007
1. Open ArcMap
2. Select Tools > Macro's > Visual Basic Editor
3. Select File > Import file
4. Import BatchExportMXDToPDF.bas
5. Select File > Close and Return to ArcMap
6. Select Tools > Macro's > Macro's
7. Select the BatchExportMXDToPDF mactro
8. Click Run 
share|improve this question
up vote 5 down vote accepted

Export Map Document to PDF is now included in the arcpy.mapping sample script tools

Source Code is available to Automate/Batch MXD for Export to PDF.

share|improve this answer
Thanks Mapperz, lots of good ones there look like.... keep getting Invalid Mxd filename error for some reason when using 'Export Map Document to PDF', any ideas? screen shot: – sirgeo Mar 11 '11 at 22:28
Do you have spaces or special characters in your .mxd? – Mapperz Mar 13 '11 at 2:19
yes.... spaces, underscores, and a hyphen. Here's a few examples: PLR11001200_1101A-BO.mxd 1101A_ LT 314.mxd 1101A_BB 300B.mxd 1101A_BO.mxd Do you think i need to take out the spaces and hyphens? i'll give it shot tomorrow morning when i go into work to do some overtime. – sirgeo Mar 13 '11 at 4:58
Thanks Mapperz.... It indeed works fine after removing all the spaces, underscores, and hyphens. – sirgeo Mar 13 '11 at 20:55

Looks like this is a VBA module. If you install VBA with ArcGIS 10 you should be able to run it just the same. (VBA is still supported, but will not be in the next release.) Better approach would be to re-write this as an add-on.

share|improve this answer
Thanks Jakub, is there a link with step by step instructions on how to install VBA with ArcGIS 10? any suggestion on how to re-write as an add-on? – sirgeo Mar 11 '11 at 22:46
You will need a license file from ESRI and VBA installer is one of the items on the main installation DVD. As for the Add-In (sorry not Add On) there is a bit of learning curve with VB .NET but it's well worth the effort. Here is a link for the walkthrough:… – Jakub Mar 11 '11 at 23:07

Look in this set of GP tools on the ESRI Resource Center, there may be something in there for exporting to PDF in batch.

share|improve this answer
like minds - same link as me. – Mapperz Mar 11 '11 at 22:18
Thanks Chad, i keep getting Invalid Mxd filename error for some reason when using 'Export Map Document to PDF', any ideas? screen shot: – sirgeo Mar 11 '11 at 22:45
@Mapperz - D'OH! My mistake! – Chad Cooper Mar 12 '11 at 14:33
keep getting Invalid Mxd filename error when using 'Export Map Document to PDF', any ideas? screen shot: – sirgeo Mar 12 '11 at 16:24

Add the script to a toolbox, then setup two paramters by right clicking on the script tool and typing in the display named like below image and picking data type of folder like in below image: enter image description here

#Export a folder of maps to PDFs at their Map Document set sizes
#Written using ArcGIS 10 and Python 2.6.5
#by: Guest

import arcpy, os

#Read input parameter from user.
path = arcpy.GetParameterAsText(0)

#Write MXD names in folder to txt log file.
for fileName in os.listdir(path):
    fullPath = os.path.join(path, fileName)
    if os.path.isfile(fullPath):
        basename, extension = os.path.splitext(fullPath)
        if extension == ".mxd":
            mxd = arcpy.mapping.MapDocument(fullPath)
            print fileName + "\n"
del mxd
print "Done"

exportPath =arcpy.GetParameterAsText(1)
for line in MXDread:
    #Strip newline from line.
    if os.path.isfile(line):
        basename, extension = os.path.splitext(line)
        if extension.lower() == ".mxd":
            print "Basename:" +newName
            mxd = arcpy.mapping.MapDocument(line)
            print newPDF
            print line + "Export Done"
del mxd
share|improve this answer

protected by Community Aug 18 '15 at 14:56

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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