Hi
On a layout, a logo (jpg-picture) has been inserted as a file-reference and not as a "static" part of the document.
Manually, I can open the mxd and get the properties of the logo-element and then check the checkbox "Save picture as part of the document"
But I have a lot of mxd-files, so...
How can I make this change (saving the picture as part of the document) using ArcPy?
Solved! Go to Solution.
Ian Murray is right, this property is not exposed to arcpy: PictureElement—Help | ArcGIS for Desktop
In ArcGIS Pro this is no longer a problem:
Pictures are always stored in the project. The sourceImage property displays the original source location during the time the picture was inserted. The file can be removed from disk and the picture will continue to display in the layout.
Source: PictureElement—ArcPy | ArcGIS for Professionals
.. but that doesn't help you...
There is indeed support for this in ArcObjects using IPictureElement::SavePictureInDocument (boolean)
ArcObjects Help for .NET developers
This post by Alexander Nohe has instructions on how to use ArcObjects in Python if that's what you would like:
Is this not possible? Anyone?
I'm not sure arcpy does not have a functionality to embed images into map documents from what I've seen. It may be possible with ArcObjects, but the current arcpy methods and functions do not allow for that. Likewise, if you have a picture element that is saved as part of the document, it no longer has a name with ListLayoutElements and its source is unable to be changed.
Apparently this issue came up on the old forums, but was never adequately addressed by anyone.
Sources checked:
Paul Zandbergen Python Scripting for ArcGIS
ArcGIS Help -arcpy mapping module - Picture Elements Methods
General Web Search
GIS Stack Exchange
Ian Murray is right, this property is not exposed to arcpy: PictureElement—Help | ArcGIS for Desktop
In ArcGIS Pro this is no longer a problem:
Pictures are always stored in the project. The sourceImage property displays the original source location during the time the picture was inserted. The file can be removed from disk and the picture will continue to display in the layout.
Source: PictureElement—ArcPy | ArcGIS for Professionals
.. but that doesn't help you...
There is indeed support for this in ArcObjects using IPictureElement::SavePictureInDocument (boolean)
ArcObjects Help for .NET developers
This post by Alexander Nohe has instructions on how to use ArcObjects in Python if that's what you would like:
Thanx Xander and Ian - you gave me the answers I needed!
Hi from Lars
I'm glad that we could help. Could you mark the question as answered?