HOW TO
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.
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.
import arcpy import os
ProProject = r"<C:\Path\To\Your\Project.aprx>" OutFolder = r"<C:\Path\To\Output\Folder>"
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 image below shows the exported map series pages in individual PDF files.
Article ID: 000035258
Get help from ArcGIS experts
Download the Esri Support App