Select to view content in your preferred language

Export to jpg

4196
1
Jump to solution
02-19-2015 06:31 AM
Yaron_YosefCohen
Frequent Contributor

Hello everyone,

i try to export 10 mxd's  with arcpy and i don't know how to change the dpi from 96 (default) to 196. i using this code:

import arcpy,os,sys,string
import arcpy.mapping
from arcpy import env

env.workspace = r"D:\PROJECTS\nofim\gis"
counter = 0
for mxd in arcpy.ListFiles("*.mxd"):
    print (mxd)
    mapdoc = arcpy.mapping.MapDocument(r"D:\PROJECTS\nofim\gis\\" + mxd)
    arcpy.mapping.ExportToJPEG(mapdoc, r"D:\PROJECTS\nofim\gis\output\\"+os.path.basename(mapdoc.filePath).replace ('.mxd','') +".jpg")
    print ('ExportToJPEG')
    mapdoc.save()
    counter = counter + 1
del mxd # i added
print (counter)

any help would be great.

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
TimWitt2
MVP Alum

Hey,

according to this you can change the dpi value:

ArcGIS Desktop

Just change add a resolution value.

ExportToJPEG (map_document, out_jpeg, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {color_mode}, {jpeg_quality}, {progressive})

Tim

View solution in original post

0 Kudos
1 Reply
TimWitt2
MVP Alum

Hey,

according to this you can change the dpi value:

ArcGIS Desktop

Just change add a resolution value.

ExportToJPEG (map_document, out_jpeg, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {color_mode}, {jpeg_quality}, {progressive})

Tim

0 Kudos