I have a script that works to export my pages as jpegs, but I want to add the world file to them. I don't want to have to do all the {df} args and whatnot, I just want to skip to the world file. How can I do this?
Script I currently have:
mxd = arcpy.mapping.MapDocument("CURRENT")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
arcpy.mapping.ExportToJPEG(mxd, r"D:\Matt_work\jpgs" + str(pageNum) + ".jpg")
del mxd
EDIT: If I use this script:
mxd = arcpy.mapping.MapDocument("CURRENT")
for pageNum in range(1, mxd.dataDrivenPages.pageCount + 1):
mxd.dataDrivenPages.currentPageID = pageNum
arcpy.mapping.ExportToJPEG(mxd, r"D:\Matt_work" + str(pageNum) + ".jpg", world_file=True)
del mxd
I get this runtime error:
Runtime error
Traceback (most recent call last):
File "<string>", line 4, in <module>
File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\utils.py", line 182, in fn_
return fn(*args, **kw)
File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\mapping.py", line 1026, in ExportToJPEG
layout.exportToJPEG(*args)
File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\utils.py", line 182, in fn_
return fn(*args, **kw)
File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\arcobjects\mixins.py", line 568, in exportToJPEG
return self._arc_object.exportToJPEG(*args)
TypeError: PageLayoutObject: Error in executing ExportToJPEG