This is a variation of an earlier thread I started C# SDK: trying to write a program to insert an image into a cell. That thread has gotten quite big and this is a somewhat different problem, though related.
I’ve gotten pretty good at this, I know how to use MRI, I understand DrawPages, and I know the peculiarities of “storing” images “in” cells.
What I am trying to do is to get the original source URL for the image. I don’t know if that is even possible. When I insert an image, I am using the XGraphicProvider interface to create an XGraphic which accepts a property named “URL” to specify the image file. However that interface seems to be “one-way” with no way to get the URL back.
As an alternative to getting the name of the original file, I’m ok with getting access to the internal copy of the image. A copy of the original image file is stored with the spreadsheet, but it has a new name. If I unzip an ODS file I can see them. What I can’t do is get the name of, or access, those files.
I’ve been through all the properties of the XGraphic, and of the XShape (Graphic Object Shape), associated with the cell in question, and that are accessed through the spreadsheet’s DrawPage. Nowhere is the internal URL or the original URL of the associated image. I know that at least the internal URL is known because if I right-click on an image in LibreOffice and pick “Edit with External Tool” it opens the image as a file in the Temp folder (with an altogether new name), and subsequently saves in back into the spreadsheet if it is edited.
There is an old SDK method for doing all this that no longer works. There are lots of properties apparently associated with the old method, such as “OriginURL”, “URL”, and “GraphicURL”, but none of them seem to have anything in them.
A note to beginners reading this: the term “URL” doesn’t refer to the common internet meaning of the word, but rather to a specially-formatted file path/name used in the LibreOffice SDK. It is, technically, a URL, but don’t assume that it has something to do with the internet.
Thank you!