HOW TO

Batch export map series pages as separate PDFs using Python in ArcGIS Pro

Last Published: April 9, 2025

Summary

In ArcGIS Pro, a map series can be exported individually as PDF files using Python, automating the repetitive task and ensuring consistency across outputs. This automation benefits large projects that require standardized map outputs for reporting or analysis. Complete the workflow provided to export each page of a map series as multiple PDF files using Python in ArcGIS Pro versions 3.5 and earlier.

The image below shows the project with a layout containing map series pages.

The Map series pages in a layout

Procedure

  1. Open the project in ArcGIS Pro.
  2. Create a Python Notebook. Refer to Learn ArcGIS: Get started with notebooks in ArcGIS Pro for instructions.
Note: 
Alternatively, the Python script can be executed in ArcGIS Pro through the Python window. Refer to Learn ArcGIS: Get started with Python in ArcGIS Pro for instructions.
  1. On the New Notebook tab, click an empty cell in the notebook and paste the following code:
import arcpy
import os
  1. On the toolbar above the cell, click Insert a cell below (B) The Insert a new cell icon  to add a new cell. Specify and replace the following:
    1. <C:\Path\To\Your\Project.aprx> with the path of the current project.
    2. <C:\Path\To\Output\Folder> with the path of the desired output folder.
ProProject = r"<C:\Path\To\Your\Project.aprx>"  
OutFolder = r"<C:\Path\To\Output\Folder>"  
  1. Click Insert a cell below (B) The Insert a new cell icon to add a new cell. Specify and replace <Layout_name> with the name of the map series layout.
if not os.path.exists(OutFolder):
    os.makedirs(OutFolder)

try:
    aprx = arcpy.mp.ArcGISProject(ProProject)
   
    layouts = aprx.listLayouts('<Layout_name>')

    if not layouts:
        raise Exception("Error: Layout 'Layout' not found.")
    
    mapSeriesLayout = layouts[0]  
    print(f"Using Layout: {mapSeriesLayout.name}")

    if mapSeriesLayout.mapSeries is not None:
        mapSeriesL = mapSeriesLayout.mapSeries
        mapSeriesL.refresh()

        if mapSeriesL.enabled:
            print(f"Exporting {mapSeriesL.pageCount} pages...")

            for pageNumber in range(1, mapSeriesL.pageCount + 1):
                mapSeriesL.currentPageNumber = pageNumber  # Set the current page
                
                # Since Bookmark Map Series has no attributes, use page number
                pdfPath = os.path.join(OutFolder, f"Layout_Page{pageNumber}.pdf")

                # Export to PDF
                mapSeriesLayout.exportToPDF(pdfPath)
                print(f"Exported: {pdfPath}")

            print("Export completed successfully.")

        else:
            raise Exception("Error: Map Series is not enabled for this layout.")
    else:
        raise Exception("Error: No Map Series found in this layout.")

except Exception as e:
    print(f"An error occurred: {str(e)}")
    print(arcpy.GetMessages())

The image below shows the example of the full working Python script.

The full working script in using the Python notebook
  1. On the toolbar above the cell, click Run all cells The Run all cells icon.

The image below shows the exported map series pages in individual PDF files.

The exported map series pages

Article ID: 000035258

Software:
  • ArcGIS Pro

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options