Hi,
I am trying to find a string and replace it with an image.
My keyword is SIGNATURE
In my document i have " By : SIGNATURE "
when i replace it with image, it's inserting the image before "By" word rather than after it.
I am using the following replace callback. Please help.
private static class SearchAndReplaceImage implements IReplacingCallback {
byte[] image;
public void setImage(byte[] img) {
this.image = img;
}
public int replacing(ReplacingArgs e) throws Exception {
String is = e.getMatch().group();
Document doc = (Document)e.getMatchNode().getDocument();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.moveTo(e.getMatchNode());
builder.insertImage(image);
return ReplaceAction.REPLACE;
}
}