I am using approach mentioned in accepted solution of How to Search and Replace in odt Open Office document? for search and replace text in odt document using Delphi
now my requirement is replace text with image. for example my odt file will have tags as "SHOW_CHART=ID", i will retrieve chart from DB for given ID as an image file and then replace it with "SHOW_CHART=ID".
So my question is how to insert image from a file to ODT document. I found another link asking same question but using java. How to insert an image in to an openoffice writer document with java? but i don't know java.
The following code was adapted from Listing 5.24 of Andrew Pitonyak's Macro Document.
More information on using OpenOffice with Pascal is at https://www.freepascal.org/~michael/articles/openoffice1/openoffice.pdf.
EDIT:
This code inserts
SHOW_CHART=123
andSHOW_CHART=456
as an example. Then it finds these strings and replaces them with the corresponding image.EDIT 2:
Embedding is explained in the next section of Andrew's document, Listing 5.26.