TransWikia.com

Exporting text based PDF from ArcMap using ArcPy?

Geographic Information Systems Asked on December 30, 2020

I’m trying to create a report style output from ArcMap or ArcGIS Pro. The first page would be a map of a state with all locations of restaurants that are in the state. Then there would be a second page that gets exported that is a list of all of the restaurants from the first page map, sourced from a field in the data table. Before I chew away at writing a python script, does anyone know if the second page is possible from ArcGIS or at least Python?

2 Answers

This should be possible. A simplified workflow would look like:

  1. Export your map to PDF
  2. Use arcpy.SearchCursor to grab the list of restaurants from your feature class
  3. Write that list to PDF using a recommendation from How to create PDF files in Python
  4. Append the second PDF to the first using one of the methods described in How to append PDF pages using PyPDF2

Answered by Andy on December 30, 2020

I know that this can be done using ArcPy with either ArcGIS Pro or ArcMap, by using no Python libraries other than ArcPy, and that the code for doing it is non-trivial.

I designed an automated PDF map generating system in ArcMap for a state geological survey but by the time that was funded the implementation was done using ArcGIS Pro instead.

After the project was completed I developed an eLearning training course in ArcGIS Pro with ArcPy to teach the techniques involved. The key concept involved is that of table-like feature classes.

An example of the PDF output from the code taught in that course appears below.

enter image description here

As you can see, for any country the course code creates PDF map output where the number of report pages (in this case six, the first two shown) is determined by how many populated places are in that country.

The course is not free. It is called Challenging Times with Python and ArcPy for ArcGIS Pro and is published at Udemy.

Disclosure: I am the developer and presenter of the course recommended above.

Answered by PolyGeo on December 30, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP