Hi there,
We are trying to merge image, which is in base 64, into document template. How to implement this?
Regards,
Vidyabhushan
Hi there,
We are trying to merge image, which is in base 64, into document template. How to implement this?
Regards,
Vidyabhushan
We have made below changes. And it started working. Thanks
public void imageFieldMerging(ImageFieldMergingArgs args) throws Exception {
BufferedImage image = null;
byte[] imageByte;
try {
BASE64Decoder decoder = new BASE64Decoder();
imageByte = decoder.decodeBuffer(args.getFieldValue().toString());
ByteArrayInputStream bis = new ByteArrayInputStream(imageByte);
// Now the mail merge engine will retrieve the image from the stream
args.setImageStream(bis);
bis.close();
} catch (Exception e) {
e.printStackTrace();
}
}
@vapanchamukhi It is perfect that you managed to resolve the problem. Please feel free to ask in case of you issues. we will be glad to help you.