AnsweredAssumed Answered

Symbol Rotation not honored during arcpy.mapping.ExportToPDF

Question asked by brianmcleer on Jan 12, 2018
Latest reply on Nov 26, 2018 by brianmcleer

In several MXDs, I have symbology displayed based on a rotation field. In each MXD, I rotate the data frame based on the site plan. When I export to a PDF within ArcMap, the symbols stay rotated as they should.


I have already gone into ArcMap Advanced Settings Utility and checked off Rotate marker symbols with dataframe.


Sample when exporting to PDF from ArcMap: 

When I use arcpy.mapping.ExportToPDF, the PDF exports correctly, but it will not honor the rotation. I would like to use Python because I have several dozen MXDs that will be updated on a monthly basis. 


Sample when using arcpy.mapping.ExportToPDF


Sample Code:


import arcpy, os

folderPath = r"J:\GIS\PrePlans"
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)
            mapPath = mxd.filePath
            fileName = os.path.basename(mapPath)
            print "Exporting " + fileName
            txtFile.write("Exported " + fileName +'\n')
            arcpy.mapping.ExportToPDF(mxd, basename + '.pdf')