I've created a simple python toolbox (pyt) to export map layouts to multiple formats. My problem is that some labels which are defined in the layout are exported, but others are not. For example point labels export but contour labels dont. When I export from within ArcMap all labels are exported.
Question: Is there any argument missing from my "arcpy.mapping.Export" statements that would affect labeling?
I had problems posting the whole toolbox but it can be downloaded from here: Export MXD Toolbox
Here's the code that does the exporting.
# mxd name
mxd = arcpy.mapping.MapDocument(parameters[1].valueAsText)
# workspace
env.workspace = parameters[0].valueAsText
# workspace text to use in paths
workSpace = parameters[0].valueAsText
AddMessage("The workspace is " + env.workspace)
# resolution
dpi = parameters[2].valueAsText
# filename
name = parameters[3].valueAsText
# option for formats to export
createPDF = parameters[4].valueAsText
createTIFF = parameters[5].valueAsText
createEPS = parameters[6].valueAsText
createAi = parameters[7].valueAsText
# Export PDF
if createPDF == "true":
AddMessage("Exporting PDF")
arcpy.mapping.ExportToPDF(map_document = mxd, out_pdf = workSpace + "\\" + name + ".pdf", resolution=dpi,
convert_markers=True, layers_attributes="LAYERS_AND_ATTRIBUTES")
else:
AddMessage("You chose not to create a PDF")
# Export TIFF
if createTIFF == "true":
AddMessage("Exporting TIFF")
arcpy.mapping.ExportToTIFF(map_document = mxd, out_tiff = workSpace + "\\" + name + ".tif", resolution=dpi, tiff_compression="LZW")
else:
AddMessage("You chose not to create a TIFF")
# Export EPS
if createEPS == "true":
AddMessage("Exporting EPS")
arcpy.mapping.ExportToEPS(map_document = mxd, out_eps = workSpace + "\\" + name + ".eps", resolution=dpi, image_quality="BEST",
picture_symbol="VECTORIZE_BITMAP", convert_markers=True)
else:
AddMessage("You chose not to create an EPS")
# Export to Ai
if createAi == "true":
AddMessage("Exporting Ai")
arcpy.mapping.ExportToAI(map_document = mxd, out_ai = workSpace + "\\" + name + ".ai", resolution=dpi, picture_symbol="VECTORIZE_BITMAP",
convert_markers=True)
else:
AddMessage("You chose not to create an Ai")