Export Multiple Layouts to .pdf/.emf etc in ArcGIS Pro

9086
17
05-10-2018 08:07 AM
Status: Open
Labels (1)
SeanHlousek
Occasional Contributor III

It would be a nice feature to select multiple layouts and then right-click and choose "Export All".  (To .pdf or other formats).  

Then, while ArcGIS Pro is exporting the different layouts be able to continue working as this process is handled in the background.

Basically a "Batch Export" is what I'm suggesting.

17 Comments
ElishevaWalters

Yes, this is VERY IMPORTANT to speed up workflow

caleb-thomas-smith

Yes! This would be very helpful, especially for the GIS students I TA who are creating 10-12 layouts per lab.

bsanders69

As someone has mentioned, there is a method out there that you provide a folder and it will open, save (to update all dynamic texts, etc.) and export to pdf every ArcMap file layout in the map folder (may be 200 maps in a folder, but the amount of time saved is significant!  Different folder structure now as the new layouts are within the Pro folder structure, but, I agree that this functionality was utilized constantly updating the City Police, Fire, Code, Engineering, City Council, Parks, etc. wall maps.  Please bring back a way to batch export these layouts.

Thank you

DaveTaylor011

Hey folks,

I realize this is an older thread, but I've actually created some Python scripts to handle this (I make a lot of layouts). I've copied the code for the Batch Export to PDF tool below, and the toolbox includes this and a Batch Export to PNG tool too. You can download the toolbox here: https://drive.google.com/file/d/1tYhxNO8SOimc5h_N2BqXg4097Rx7ymrl/view?usp=sharing. I suggest using the toolbox because it took a little while to set up all the parameters for the PDF tool. Both tools export only from the current open project, and use value tables so you can export as many layouts as you want and name the output files however you want. Hopefully this helps someone!

 

#-------------------------------------------------------------------------------
# Name: Batch Export Layout to PDF
# Purpose: Generate Layout PDFs in bulk.
#
# Author: Dave Taylor
#
# Created: 2022-05-11
# Copyright: (c) Dave Taylor 2022
#-------------------------------------------------------------------------------

import arcpy, os, sys
arcpy.env.overwriteOutput = True
aprx = arcpy.mp.ArcGISProject("CURRENT")
listLayouts = aprx.listLayouts()

inputRows = arcpy.GetParameter(0)
outputFolder = arcpy.GetParameter(1)
clipToGraphicsExtent = arcpy.GetParameter(2)
outputAsImage = arcpy.GetParameter(3)
imageCompression = arcpy.GetParameter(4)
compressionQuality = arcpy.GetParameter(5)
compressVectorGraphics = arcpy.GetParameter(6)
resolution = arcpy.GetParameter(7)
imageQuality = arcpy.GetParameter(8)
embedFonts = arcpy.GetParameter(9)
exportGeoreferenceInformation = arcpy.GetParameter(10)
layersAndAttributes = arcpy.GetParameter(11)
embedColourProfile = arcpy.GetParameter(12)

tbleRow = 0
numRows = inputRows.rowCount
arcpy.AddMessage ("Generating "+str(numRows)+" PDFs . . .")

while tbleRow < numRows:
rowStr = inputRows.getRow(tbleRow)
rowSplit = rowStr.split("' '")
rowClean = [s.replace("'","") for s in rowSplit]
layoutName = rowClean[0]
exportName = rowClean[1]
arcpy.AddMessage (layoutName)
arcpy.AddMessage (exportName)
for lyt in listLayouts:
if lyt.name == layoutName:
'''outputPDF = lyt.exportToPDF(os.path.join(str(outputFolder),str(exportName)))'''
outputPDF = lyt.exportToPDF(os.path.join(str(outputFolder),str(exportName)),resolution,imageQuality,compressVectorGraphics,imageCompression,embedFonts,layersAndAttributes,exportGeoreferenceInformation,compressionQuality,clipToGraphicsExtent,outputAsImage,embedColourProfile)
tbleRow += 1

KyleGonterwitz

I agree batch exporting layouts to pdf is a great idea, and it was pretty easy to do with python, here is an example in a python notebook

https://github.com/gontek/CMED/blob/main/LayoutExport.ipynb

In this example rather than export all layouts I am controlling the desired layouts to be output by explicitly listing those layouts by name.  To export all layouts I suppose you could change the logic to "not in" on line 9 and have an empty list.

SuzyFer

@DaveTaylor011 I have been using your toolbox for batch PDF export and it works great! One thing I was wondering about - it doesn't take map series into consideration. Some of my layouts might have map series included and some just individual pages, but with the tool I can only get the first page of a map series as PDF. I wonder if there is something that can be added to the code to include also map series.

DaveTaylor011

@SuzyFer that's a good one! I'll scratch my head a bit and see if I can add a map series option to it. Stay tuned!