I would like to take a ArcMap mapbook and export each individual page to a PDF named for the page and/or GridID. I've never messed with Python... But I see that the arcpy.mapping module should do the trick. Doesn't seem like this should be too difficult, but I am failing...
i took Gistech007's code and modified by adding a line - pageName = mxd.dataDrivenPages.pageRow.stand_key and then instead of having str(pageNum) in the name I have str(pageName). so it looks like this now:
import arcpy
print "Setting Map Document. . ."
mxd = arcpy.mapping.MapDocument("CURRENT")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
pageName = mxd.dataDrivenPages.pageRow.index
print "Exporting page {0} of {1}".format(str(mxd.dataDrivenPages.currentPageID), str (mxd.dataDrivenPages.pageCount))
arcpy.mapping.ExportToPDF(mxd, r"D:\Temp\Page_" + str(pageName) + ".pdf")
del mxd
Where "index" in the line - pageName = mxd.dataDrivenPages.pageRow.index is a field in my table. This runs and works just fine, but inst what i am after. I need the PDF to be named with only the str(pageName) and no prefix of "Page_". If I remove the "Page_" from the code it throws an error... How can i create the PDF and have it named using only the value from pageName?