Select to view content in your preferred language

Data Driven Pages - Need to prepend field to file name when exporting individual pngs

517
2
Jump to solution
11-13-2012 09:31 AM
EricMcGilliard
Deactivated User
Using ArcMap 10.0 and data driven pages,  I would like to export a series of individual .png's with unique file names based off of a field in the attribute table.  I am able to use ESRI's sample arcpy script to export to individual png's, but am not able to prepend or append a name to the png's.  I can only export each png with a page number. 

Anyone have some advice to attach a name to each of the exported .png's?
0 Kudos
1 Solution

Accepted Solutions
JohnSobetzer
Honored Contributor
Try something like this in your arcpy: arcpy.mapping.ExportToPNG(mxd,r"C:\Temp\\" + str(ddp.pageRow.Name) + ".png", df)

See  http://forums.arcgis.com/threads/62833-DDP-export-to-rasters-with-page-names

View solution in original post

0 Kudos
2 Replies
CPoynter
Frequent Contributor
Hi,

Have a look at this thread. It may contain some ideas for you to try.

http://forums.arcgis.com/threads/67143-How-to-adding-dynamic-text-from-an-attribute-field-to-Data-Dr...

Regards,

Craig
0 Kudos
JohnSobetzer
Honored Contributor
Try something like this in your arcpy: arcpy.mapping.ExportToPNG(mxd,r"C:\Temp\\" + str(ddp.pageRow.Name) + ".png", df)

See  http://forums.arcgis.com/threads/62833-DDP-export-to-rasters-with-page-names
0 Kudos