Hello!
What I am trying to do is something similar to
merge fields with a RTF Template. I need to load a logo into a RTF file
depending on the name of a company. The logo is on the header, so I get the RTF
code for an image and I replace the tag #LOGO# in the RTF template with the
appropiate RTF code.
My Java code is like this:
String logo = filename;
Image img = Image.getInstance(logo);
RtfDocument
doc = new RtfDocument();
RtfImage rtfImg = new
RtfImage(doc,img);
byte[] image = rtfImg.write();
String str = new String(image);
In my project, we use Jasperreports to design
reports, and it uses iText-1.3.1.jar library. If I make this with this iText
Library version, I can insert the image properly (the only problem is that the
image is align to the text). If I use the latest version of the library the
string that I obained has a lot of strange characters.
I would be grateful if anyone can help
me