In this article you will learn how to convert your ArcMap (ArcGIS) MXD files stored in a folder to portable document format (PDF) that allows the consumption of maps to users outside the geographic information systems using Python.
This will help in your productivity because as you develop a geographic information system tends to generate several maps either to accompany the results of a study and / or field exploration, as an example let's say you and I are 500 maps, in case of a change in any element within the spatial database and it is necessary to update these maps the normal solution would be:
How to export a MXD to PDF
1) Open one of the MXD files.
2) Go to File.
3) Click on “Export Map...” in the displayed submenu.
4) Choose the file name (a), the file type (b) and the resolution (c). Then press the “Save” button (d).
5) Repeat this procedure for each MXD file.
This procedure multiplied by 500 times can consume a lot of your valuable time, so I will show you how it can be much more efficient using Python code (don't worry, you don't need to know how to program to do it).
How to batch export MXD to PDF files?
Step 1: Identify the path where the MXD graphic outputs are stored.
Step 2: Open ArcMap.
Step 3: Open the Python window in the Standard toolbar.
Step 4: Copy the following code into a notepad and replace the text C:\EJEMPLO\EJEMPLO in line #03 with the path to the folder identified in step 1.
Step 5: Copy the modified code into the Python window and press the Enter key twice.
After a few seconds you will see the PDF files start to appear in the folder where the MXD files are stored and you can automatically export any number of these native ArcMap files.
Notes:
a) In line #11 you can modify the dpi with which the PDF files are exported, currently it is set to 300 dpi, which according to my experience is the best resolution for PDF files considering an ISO B1 paper size (707 x 1000 mm), The export time is directly proportional to the amount of dpi.
I hope you enjoyed this article, soon I will upload a video explaining the procedure that you can consult in this blog. Save my blog among your favorite links, I will be uploading many more tricks of this style, remember that you can send me your concerns in the contact page or leave your comment, I will be attentive to respond.




