HOW TO

Download PDF items in Portal for ArcGIS using Python

Last Published: April 7, 2023

Summary

The Python script provided below can be used to download PDF items from Portal for ArcGIS.

Note:
This script should be run on the local Python IDLE.

Procedure

#IMPORT LIBRARY

from arcgis.gis import GIS

#PARAMETERS
#specify the path to where you want the PDFs to be downloaded
#specify the Portal for ArcGIS URL
#specify the Portal for ArcGIS credentials

path= r"\\path\pdf"
portalurl= 'https://dns.domain.com/portal'
usrname = 'username'
passwd = 'password'

gis=GIS(portalurl,usrname,passwd, verify_cert=False)

#DOWNLOAD PDFS
#search for all PDF items in Portal for ArcGIS
search_results = gis.content.search(query='',item_type='PDF')

#download them to the specified path
for item in search_results:
    item.download(path)

Article ID: 000028595

Software:
  • Portal for ArcGIS

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options