Multiple Pages in a Single Layout

13607
22
01-13-2021 10:47 AM
Status: Open
Labels (1)
jcarlson
MVP Esteemed Contributor

Before I came to work at an ESRI workplace, I was an avid QGIS user. Still am, really, but as ArcGIS Pro has developed, I find myself needing to use Q less and less to hack together an as-yet-unimplemented feature in Pro.

(Major props on the eyedropper!)

There is, alas, still one feature that I desperately want: multiple-page layouts.

In the course of my work, there are a number of times when it is helpful to have spatial and non-spatial components on separate pages, and the sheer amount of information in my layout cannot realistically be squeezed into a single page. Or at least, not that the average person could print out. I'm all for digital maps, but I know we have other folks in our county who want it on paper, and I'd like to conveniently oblige them.

The biggest of these items are our Change Records we generate when changes are made to the cadastre.

Here's one for reference.

Combining multi-page layouts with a Map Series would absolutely make my day.

What are my alternatives?

  1. Make each page a separate layout
  2. Use some sort of mail merge procedure to generate the non-spatial pages
  3. Make my layouts potentially tabloid-sized
  4. Use Python
  5. Use QGIS

Options 1 and 2 create separate files, which then have to be merged together, adding more steps and intermediate file storage to what is currently a batch process.

Option 3 we tried, but the increased loading time and unprintable nature of the page was not desirable for our users.

Option 4 is a maybe, but there's no way the spatial component will look half as nice as Pro, especially when it comes to labelling.

Option 5 is what I'm currently doing, but it comes with a host of its own limitations, and means that I have to work in two programs during my "weekly update" process, which is sub-optimal.

Final note: I've tried making a reeeeeeally tall layout in Pro and hoping that in the "Print to PDF" process it would cut them, but no. It just generates a really tall PDF.

22 Comments
AlyciaRajendran_esri

Hi @jcarlson!

I am a member of the Reports team for Pro. We can definitely produce those non-spatial reports right now. It just depends on how automated you want it to be.

The first step is creating a report using the feature layer. You can use the UI to modify the report to look how you want.

1. No automation: When exporting this report, there are a few things to consider. A report honors selection sets and definition queries for the layer, or you can use an expression to query a subset of data to use in the report.

In the example above, before exporting your report, you could select the parcel in the map or table, set a definition query for that parcel on the layer, or set an expression in the report--all of which would result in a one feature report.

2. Some automation: Use the Export Report to PDF geoprocessing tool within a model or in the Pro Python window. The tool also honors selection sets and existing definition queries on the layer. You have the option of setting an expression before exporting as well.

3. All automation: You can create, modify properties, add elements, and export reports using the .NET SDK. Similar to using Python to create multi-page-layouts, the content of these reports would be authored in Pro.

Some helpful links:
Overview documentation: https://pro.arcgis.com/en/pro-app/latest/help/reports/reports-in-arcgis-pro.htm 

How to set the expression when you create the report: https://pro.arcgis.com/en/pro-app/latest/help/reports/specify-report-data.htm#GUID-07BB1458-EB03-421... 

Export Report to PDF gp tool: https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/export-report-to-pdf.htm 

.NET SDK: https://pro.arcgis.com/en/pro-app/latest/sdk/api-reference/#topic18660.html 

 

I hope this helps. You can contact me via email arajendran@esri.com 

jcarlson

@AlyciaRajendran_esriThanks for the extra information! I'd thought about going the query layer route and using a query parameter, but often by the end of a busy week, there might be as many as a few dozen reports to generate.

I believe I will attempt the full-automation route, and use reports for the non-spatial elements.

DougBrowning

My use case here is to have page 1 be summary info, page 2 is a table element and maybe page 3 is the map.  So I have a 3 page PDF per feature.  

I am not seeing a way to do it.

JeffBarrette

@DougBrowning I believe it can be done with arcpy.mp.  Is Page 1 an ArcGIS Pro layout or is it a standalone PDF?  Page 2 could be a separate layout in the same project with the tabular info and Page 3 could be a third Layout.  

You can use arcpy.mp to export each layout into a PDF and then use Python to add them all into a single page PDF.

This code example appends 3 PDFs into one PDF (with 3 pages): https://pro.arcgis.com/en/pro-app/latest/arcpy/mapping/pdfdocument-class.htm

Jeff

 

Amanda__Huber

Hello ArcGIS Pro Team, 

We would like the ability to export two separate layouts (unable to use map series for this) into one PDF file for the purpose of condensed electronic pdfs and double-sided printing. We're aware of third-party software for post processing, but I believe other orgs may also find benefit in this functionality. 

Please consider this enhancement. 

 

Thank you, 

Amanda Huber

jcarlson

Great idea! So great, in fact, that it's actually been requested before, multiple times, I think. I actually posted something similar to this in the past, but even back in 2019, someone was already asking for this.

https://community.esri.com/t5/arcgis-pro-ideas/print-multiple-layouts-in-arcgis-pro/idi-p/941011

 

JenMar_

Hello,

I am attempting to create a template that allows me to export a two page map (back and front printed).  I am using dynamic tables with a Map Series Pages data frame, where the front page would be a map and the back would include the tables.

I am not an avid programmer, and my staff are not GISers, so I'm wondering if there has been new developments in this area that would allow for multi-page map prints?

 

Help would be appreciated.

PhilipMarty

@JeffBarretteI've got a similar use case to the post by @DougBrowning. I've got a layout with a chart, map frame, and two dynamic text elements powered by two different query layers. One query layer populates the map, chart, and text elements, and there's separate query layer pulling the any records in the SQL database within the last day that the map series runs off of. I use arcpy to ms.refresh() and export to pdf. Now I'm wanting to add a second page with two additional map frames and append the two pdfs into one, but I'd like to run the export off of the same map series. I can't figure out how to link the second layout map frames to the first layout to line up all the extents. Any thoughts on this? Is it better to do like you suggested above and stick with 1 oversized pdf that I export with pdf tiling? Is that possible in arcpy? Or is there a way to link a second layout extent to the first and have it recognize the extent changes of stepping through the map series rows?

Thanks, this is amazing functionality

JeffBarrette

@DougBrowning @PhilipMarty @JenMar_ A multi-page export per Map Series page is completely doable using arcpy.mp.  The UI does NOT provide these capabilities but the arcpy.mp API does.  All a spatial map series is are a bunch of properties that are based on the extent of each index feature.  If you use Python to drive the map series export (vs the UI), you can inject additional logic between each MapSeries page export. This even includes updating the extent of a map frame in another layout.

 

The closest example I can think of is a sample I wrote for ArcMap Data Driven pages (not updated but the logic is identical).  This example, uses 2 MXDs because only one layout per MXD is possible.  But Pro supports multiple layouts so you don't need multiple projects.

https://www.arcgis.com/home/item.html?id=41f949b33f614f78a6dee485c4aaa5a8

Take a look at the code - it displays two map frames (even pages and odd pages) on a single layout rather than being forced to have one PDF per map series page.  You will see the main loop is based on one MXD that drives the data driven pages (in Pro called Map Series) and the second MXD has two separate map frames.  The extra logic happens between pages and the exactly one PDF is exported for every two strip index features.  It uses arcpy.mp to append the pages in the correct order creating a final, single, multi-page PDF.  One of you even mentioned NOT exporting a map series page if particular criteria are not met - using Python you decided when to export, etc.

If this sample does NOT make any sense at all, I can try to write up a snippet but the logic will be the same.

Jeff

 

 

JeffBarrette

@DougBrowning @PhilipMarty @JenMar_  Ah, I couldn't resist so I created a very simple script that creates 2 pages for every page in a map series.  The first is a map centric page based on a map series and the second page is a dynamic table (also based on a map series).  Both pages are synchronized to use the same map series page number.  They both don't need to use a map series.  You can use whatever logic you want.

Here is a snippet of code that does it all:

import arcpy, os, sys
relpath = os.path.dirname(sys.argv[0])

#Set file name and remove if it already exists
pdfPath = os.path.join(relpath, "Final.pdf")
if os.path.exists(pdfPath):
os.remove(pdfPath)

#Create the file and append pages
pdfDoc = arcpy.mp.PDFDocumentCreate(pdfPath)

#Reference project and appropriate layouts and map series objects
p = arcpy.mp.ArcGISProject(os.path.join(relpath, "MSWith2PagesPerPage.aprx"))

#Landscape layout with dynamic Map Series table
lyt2 = p.listLayouts('TableData_MS')[0]
ms2 = lyt2.mapSeries

#Portrait layout with Main Map Frame and Locator Map Frame with map series
lyt1 = p.listLayouts('Layout_MS')[0]
ms1 = lyt1.mapSeries

#Iterate through each map series page driven by Layout_MS
for pageNum in range(1, ms1.pageCount + 1):

#Set the Map Series page, export, and append to the final output
ms1.currentPageNumber = pageNum
lyt1Output = os.path.join(relpath, "TempPageA.pdf")
lyt1.exportToPDF(lyt1Output)
pdfDoc.appendPages(lyt1Output)
os.remove(lyt1Output) #Clean up temporary file after appending

#Sync the second layout to match the same Map Series and export
ms2.currentPageNumber = pageNum
lyt2Output = os.path.join(relpath, "TempPageB.pdf")
lyt2.exportToPDF(lyt2Output)
pdfDoc.appendPages(lyt2Output)
os.remove(lyt2Output) #Clean up temporary file after appending

pdfDoc.saveAndClose()

Capture.JPG