ExportToPNG annotation error between mapdoc and python file ?

866
2
Jump to solution
06-05-2017 06:21 AM
Yusuf_CelilKonak
New Contributor III

>>> import arcpy
>>> mxd = arcpy.mapping.MapDocument(r"CURRENT")
>>> arcpy.mapping.ExportToPNG(mxd, r"Z:\test\test2.png", "PAGE_LAYOUT", 1600, 2400, 400)

Maybe issue can be easy one but i've no clue for now.

The code above work perfectle as

but when i try outside from mapdoc from file as below i'm losing annotations. Labels seems fine. Any idea for this behaviour? Any idea for source of difference ?  

import arcpy
mxd = arcpy.mapping.MapDocument(r"Z:\test\test.mxd")
arcpy.mapping.ExportToPNG(mxd, r"Z:\test\test.png", "PAGE_LAYOUT", 1600, 2400, 400)

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
JeffBarrette
Esri Regular Contributor

As a follow-up, I examined the data and I don't think this particular issue has to do with ExportToPNG.  The annotation symbolIDs for each annotation element did NOT exist in the symbol collection and is why they were appearing as red rectangles.  When I recalculated the IDs to match something that did exist, both export from CURRENT and stand-alone worked as expected.  Yusuf is looking into why the correct symbols are not in the collection.

Jeff

View solution in original post

2 Replies
JeffBarrette
Esri Regular Contributor

I can not reproduce with my own data.  Would it be possible for you to send a map package to jbarrette@esri.com?  I'm hopeful it is an isolated issue.  ExportToPNG has been around for a long time.

Thanks,

Jeff

0 Kudos
JeffBarrette
Esri Regular Contributor

As a follow-up, I examined the data and I don't think this particular issue has to do with ExportToPNG.  The annotation symbolIDs for each annotation element did NOT exist in the symbol collection and is why they were appearing as red rectangles.  When I recalculated the IDs to match something that did exist, both export from CURRENT and stand-alone worked as expected.  Yusuf is looking into why the correct symbols are not in the collection.

Jeff