Hello,
I am using ArcPy to export data driven pages to PNGs. I need the export to have a higher resolution then the default one when you export your map using ArcPy.
This is the script that I am using
mxd = arcpy.mapping.MapDocument("CURRENT")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
pageName = str(mxd.dataDrivenPages.pageRow.New_ID)
arcpy.mapping.ExportToPNG(mxd, r"C:\Users\" + pageName + ".png")
del mxd
I want the resolution to be 200.
Where would I add this into the script?
There is a resolution parameter: ExportToPNG—Help | ArcGIS Desktop
Thank you. Now where does it fit into the script?
On each help page related to arcpy (e.g. arcpy functions, classes, or geoprocessing tools) the Python syntax for the "thing" is near the bottom. In this case, it says:
ExportToPNG (map_document, out_png, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {color_mode}, {background_color}, {transparent_color}, {interlaced})
I don't want to be too cryptic, but you need to do some of the work here.
Adding to Darren's comment, just change the export line to:
arcpy.mapping.ExportToPNG(mxd, r"C:\Users\" + pageName + ".png", resolution=200)