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

Get support with AI

Resolve your issue quickly with the Esri Support AI Chatbot.

Start chatting now

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Start chatting now

Go to download options