Select to view content in your preferred language

How can I export multiple layouts into the same PDF?

209
1
05-10-2024 02:58 AM
MaxWei
by
New Contributor II

Is it possible to export multiple layouts into the same PDF? Can this be achieved within ArcGIS, or would I need to use other non-ArcGIS packages?

0 Kudos
1 Reply
KamilNovák
New Contributor III

You can do it for example with arcpy.

You need to crate PDF file, then access every single layout in your project, export it and append to the created PDF file.

Your script can look like this:

 

aprx = arcpy.mp.ArcGISProject("CURRENT")
layouts = aprx.listLayouts()

pdf = arcpy.mp.PDFDocumentCreate(r"path\test.pdf")
for layout in layouts:
    page = layout.exportToPDF(layout.name + ".pdf", layers_attributes="NONE")
    pdf.appendPages(page)
pdf.saveAndClose()

 

You can run it directly in ArcGIS Pro Python Window. You need replace "path\test.pdf" string with your real path.

Image 003.png

0 Kudos