Hi,
I have added header and footer to my document. But when i download it as DOCX, the signature image that is added is not getting displayed, but if i download in DOC or PDF i can see the signature image. Can someone please help me?
private void addSignature(WordprocessingMLPackage wordMLPackage, String signOffTime, byte[] signImageArray,
boolean addPageBreak) throws Exception {
P p = factory.createP();
PPr ppr = factory.createPPr();
ppr.setKeepNext(new BooleanDefaultTrue());
ppr.setKeepLines(new BooleanDefaultTrue());
p.setPPr(ppr);
R r = factory.createR();
Br br = factory.createBr();
// r.getContent().add(br);
p.getContent().add(r);
// Adding Signature image and text
if (Objects.nonNull(signImageArray)) {
if (signImageArray != null && signImageArray.length > 0)
addSignatureImage(wordMLPackage, p, signImageArray);
}
if (signOffTime != null) {
addSignOffTime(p, signOffTime, addPageBreak);
}
wordMLPackage.getMainDocumentPart().addObject(p);
}
private void addSignatureImage(WordprocessingMLPackage wordMLPackage, P paragraph, byte[] bytes) throws Exception {
BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(wordMLPackage, bytes);
int docPrId = 1;
int cNvPrId = 2;
// The parameter cx will increase/decrease size of the image
Inline inline = imagePart.createImageInline("Sign Image", "NO IMAGE", docPrId, cNvPrId, false);
addInlineImageToParagraph(paragraph, inline);
}
Users browsing this forum: Bing [Bot], Google [Bot] and 62 guests