Skip to content

Instantly share code, notes, and snippets.

@cindygis
Created March 25, 2015 09:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cindygis/f4466e7b2ee37acce524 to your computer and use it in GitHub Desktop.
Save cindygis/f4466e7b2ee37acce524 to your computer and use it in GitHub Desktop.
Basic export of data driven pages to multiple jpegs
import arcpy
import os
mxd = arcpy.mapping.MapDocument(r"C:\Some\Arb\Folder\Test.mxd")
fld = r"C:\Some\Arb\Folder\jpegs"
ddp = mxd.dataDrivenPages
for i in range(1, ddp.pageCount + 1):
ddp.currentPageId = i
name = os.path.join(fld, ddp.pageRow.getValue(ddp.pageNameField) + ".jpg")
arcpy.mapping.ExportToJPEG(mxd, name)
print("Exported " + name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment