I'm trying to export some MXD maps to PDF with arcpy (ArcGIS 10.1). Everything works fine and dandy except for ECW images, which don't appear in the PDF. However, when I execute the same code from the ArcGIS python console, the ECW is exported. So if I execute this from an external script:

import arcpy
mxd = arcpy.mapping.MapDocument("path\\to\\test.mxd")
arcpy.mapping.ExportToPDF(mxd, "path\\to\\test.pdf")

I don't get the ECW layer in the PDF. But if I execute the same lines in the console, it works and the ECW layer is exported properly. Also, if I run


from the ArcGIS console, I also get the ECW in the PDF. I don't have this problem with other image formats, like JPG.

What's going on here? What's different between the environments? How can I debug this?


I found this document which I think explains what you are seeing.

All MrSID and ECW images in an ArcMap map must be completely uncompressed before being processed by the output pipeline. Since these raster formats can be compressed at a 1:10 - 1:50 ratio, this can result in several gigabytes or more of temporary files. This can exceed the available resources of ArcGIS and the Windows operating system and result in clipped or missing output, application failures, and crashes.

  • 1
    Thanks, I suspected it was a memory issue. This is good for explaining, but I still don't understand why it happens externally but not within ArcGIS. – bananafish Apr 17 '13 at 1:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.