Task:
I have hundreds of binary rtf files with thousands of wmf files so ^c for these pics in the rtfs, then, then ^v in a graphics program (like IrfanView) works but would take months.
By Autohotkey scripting, I theoretically can open the binary rtf files, and theoretically I can extract the {\pic ...} parts (without the opening "{" and closing "}" I think) for each such picture, then put the necessary headers before the remaining pic strings (in order to make them valid "Placeable wmf files"), and then save those "duly completed" strings as files which then can be opened in some graphic program (like IrfanView) or batch-transform them back to jpg (that is the easy part since there are tools for that; they all were jpg in the first case and had been transformed to wmf by the rtf program upon import).
Problems:
I would need to know what exactly is the string which has to be retrieved as the core picture data. What I get is,
{\pict\wmetafile8\picw23492\pich13227\picwgoal13318\pichgoal7499 010009000003c8290a000000b2290a000000050000000b0200000000050000000c02ab33c45bb2 290a00430f2000cc000000f401780300000000ab33c45b000000002800000078030000f4010000 010018000000000020531400c40e0000c40e000000000000000000001e1a1 some millions of similar characters here, then: 3b68761a77b52a77d53030000000000}
So I suppose I must delete the "{" before and the "}" after, then must put a valid header before the remaining string.
I don't know what that header would be, web info is too complicated for me, and anyway, I suppose that that header would be identical for any such resulting picture file anyway?
Alternatively, I would need to read those values from \wmetafile8\picw23492\pich13227\picwgoal13318\pichgoal7499, then delete this substring, then write the respective header individually, taking account of these values?
Also, the above obviously is not hexadecimal representation, while it's said though that such wmf pics, within rtf, are in hexadecimal "format"; in a hex editor, I see both representations, so I suppose I must know what to delete and what to add, in the readable format (Ansi) above, before then converting it all to hex again?
Also, I have doubts about the necessary (hex) character positions, since in the hex editors, due to my discarding all the strings before the start of the pic info, there was a gap between the \infos "on top" and then the "real" wmf pic description code.
The rtf program has export functions to plain text and to html; in both results the pictures or their code strings do not appear, so there is no solution in this.
There is no (commercial or free) tool to extract the wmf strings, let alone that they then would create the necessary headers in order to make those strings valid files in their own right.
Theoretically, there might be tools or routines which just take the above wmf strings (without added headers) and transform them into valid jpg files (with headers); if such is available, I wouldn't need to get the intermediate stand-alone wmf files.
I have tried to (partly) resolve these problems for about 15 hours, by reading / trying (I also tried to analyze wmf file headers from the web, in vain), so I hope to get additional info here, even for partial problems.