How to find and extract the images embedded in the OOXML flat file?
How to find and extract the images embedded in the OOXML flat file?
Answer
Automated approach
In the EASA XML export files, images (binary files) are stored in a Base64 ASCII string encoded format, following OpenXML standards. When programmatically accessing the file, Base64 is simple to convert back to binary, e.g.:
But how do you locate the data? An example:
Here is a screenshot of a sample eRules XML export, opened in Word:
And here is the XML, in pkg:part pkg:name="/word/document.xml":
The “rId18” value in the <a:blip> element refers to this relation in pkg:part pkg:name="/word/_rels/document.xml.rels":
And this finally gives you the location of the Base64 encoded data:
Manual approach
For a very simple manual approach:
- Open the XML-file in Word
- Select the image you want to extract
- RightClick the image and select “Save as picture”:
Last updated
28/06/2022