AnsweredAssumed Answered

MapSeries - exporting multiple files via arcpy

Question asked by Alistair.Quinn_qgsp on Jun 25, 2019

Have a ArcGIS Pro project with multiple layouts and mapseries, I'm trying to write a script that will allow you to specify a layout and range and export the corresponding maps as a PDF.

import arcpy.mp
arcpy.env.overwriteOutput = True

 

#project
aprx = arcpy.mp.ArcGISProject(r"D:\Project.aprx")

 

#choose mapseries, range and output folder
MapSeriesCurrent = 'MS1'
MapSeriesRange = '1-5'
Output = r"D:\Users\JoeBloggs"

 

#export map series as PDF
for lyt in aprx.listLayouts():
    ms = lyt.mapSeries
    if MapSeriesCurrent in lyt.name and ms.enabled:
               ms.exportToPDF(Output+"\\Map","RANGE",MapSeriesRange,"PDF_MULTIPLE_FILES_PAGE_NAME",resolution=300)

This script works fine - except for the multiple_files parameter ("PDF_MULTIPLE_FILES_PAGE_NAME"). When I remove that the script produces the pdfs as expected in single file but once I add that parameter there is no output or error message.

 

I've checked the MapSeries in the project and they have set Name and Sort Fields,changing to PDF_MULTIPLE_FILES_PAGE_NUMBER doesn't work either. 

 

Any suggestions?

Outcomes