Solved! Go to Solution.
import os import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") pdf = str(arcpy.GetParameterAsText(0)) name = str(arcpy.GetParameterAsText(1)) res = int(arcpy.GetParameterAsText(2)) quality = str(arcpy.GetParameterAsText(3)) path = os.path.join(pdf, name) if os.path.exists(path): os.remove(path) arcpy.mapping.ExportToPDF(mxd, path, "Page_Layout", resolution=res, image_quality=quality)
import os import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") pdf = str(arcpy.GetParameterAsText(0)) name = str(arcpy.GetParameterAsText(1)) res = int(arcpy.GetParameterAsText(2)) quality = str(arcpy.GetParameterAsText(3)) path = os.path.join(pdf, name) if os.path.exists(path): os.remove(path) arcpy.mapping.ExportToPDF(mxd, path, "Page_Layout", resolution=res, image_quality=quality)