Our MXD template has a Table View added, and everything looks fine in the mxd. When using Arcmap to generate the pdf, the table shows up as expected.
We have arcpy.mapping scripts to generate the pdf using ExportToPDF, and for some reason the Table does not show up on the final PDF.
Any suggestions on parameters or extra calls needed would be great.
Here is the code that is being called:
mxd = arcpy.mapping.MapDocument(rootPath + '\\resources\\Template.mxd')
....
#target table
#experimenting with setting the size to make the image appear
tableElement = arcpy.mapping.ListLayoutElements(mxd, wildcard="targetTable")[0]
tableElement.elementHeight = 7.8264
tableElement.elementWidth = 10.9364
...
mxd.save()
arcpy.mapping.ExportToPDF(mxd, productPath + "\\Report.pdf")
Solved! Go to Solution.
I got a message back from tech support. Here is the answer.
"This is a current bug/limitation as NIM062177 - ExportToPDF using arcpy does not export a layer attribute table embedded in a layout.
And there is no workaround for this."
Jana, if you do a search on GeoNet, using 'exporttopdf' as the keyword, you will find nothing but grief. Either layers, parts of layers aren't showing, showing at the wrong scale and myriad of other issues, they tend to be more frequent with the move to 10.3, 10.3.1, 10.4 and 10.4.1 with a few tickets being opened for bugs.
In short, some of the issues have been narrowed down to printers, printers not be initialized prior to being called, printer margin sizes, sources of data (like servers etc).
Here is an example of one such plight issue ArcGIS 10.4 ArcPy ExporttoPDF only exports parts of layers
rather than wait for it to be resolved, file a report, I think there may be larger issues with the pdf 'stuff' and tiny patches may be prolonging the agony of getting a resolution to ensure that all aspects of exporting to this format are addressed.
Good luck
Xander Bakker or Jana, maybe one of you might want to move this out of snippets into the more general Python place to ensure a full audience is addressed. You might also want to do a 'Share' with Mapping
Thank you Dan for the feedback. I have made the edits to the post.
As for the arcpy; I have found that a number of features do not work as they should. We will handle this with a long hand implementation.
I got a message back from tech support. Here is the answer.
"This is a current bug/limitation as NIM062177 - ExportToPDF using arcpy does not export a layer attribute table embedded in a layout.
And there is no workaround for this."