I try to export multi MXD files into pdf. The code run without an errors, but the problem is that the legend vanished from several pdf files:
import arcpy,os
import arcpy.mapping
from arcpy import env
env.workspace = r"D:PROJECTSaradIndustrygis"
counter = 0
startTime = datetime.datetime.now()
for mxd in arcpy.ListFiles("*.mxd"):
print mxd
mapdoc = arcpy.mapping.MapDocument(r"D:PROJECTSaradIndustrygis\" + mxd)
arcpy.mapping.ExportToPDF(mapdoc, r"D:PROJECTSaradIndustrygisout\"+os.path.basename(mapdoc.filePath).replace ('.mxd','') +".pdf")
print 'ExportToPDF'
mapdoc.save()
counter = counter + 1
del mxd
print counter
endTime = datetime.datetime.now()
elapsed = endTime - startTime
print elapsed