I have a folder of 28 mxds that I'm trying to export all of them into 28 JPEGs. I'm having difficulty with the script and I'm hoping someone can help figure where I went wrong. Basically, I want to be export to run automatically, so that I don't have to open each mxd to export them into JPEGs.
import arcpy, os >>> folderPath = r"H:\Users\2015\Map15-0001\Zone Maps - for External Website" >>> for filename in os.listdir(folderPath): ... fullpath = os.path.join(folderPath, filename) ... if os.path.isfile(fullpath): ... basename, extension = os.path.splitext(fullpath) ... if extension.lower() == ".mxd": ... mxd = arcpy.mapping.MapDocument(fullpath) ... df = arcpy.mapping.ListDataFrames(mxd,"Layers") ... arcpy.mapping.ExportToJPEG(mxd, r"H:\Users\2015\Map15-0001\Zone Maps - for External Website\New"+basename+".jpg", df,resolution = 1000)
This is the error that I'm getting:
Runtime error Traceback (most recent call last): File "<string>", line 8, 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) AttributeError: DataFrameObject: Error in parsing arguments for ExportToJPEG
The mxds all have Data Driven Pages running on them. I was able to previously take all of the mxds and export separate PDFs.
I'm running ArcMap 10.3.