Footer lost in pdf when saved unless saved in doc format first

Hello Aspose,

we add an image in jpeg format to a document’s footer which works perfectly fine when saving in Word’s doc format. When saving the same document in pdf format, the image in the footer is missing. After saving in doc format and rereading the document, saving in pdf works too.

That’s how we do it:

if (config.getAddLogo())
    // workaround: without saving and rereading in doc format, the footer gets lost for saving in pdf format.
    ByteArrayOutputStream baos = new ByteArrayOutputStream();, SaveFormat.DOC);
    doc = new Document(new ByteArrayInputStream(baos.toByteArray()));

PdfSaveOptions options = new PdfSaveOptions();
ByteArrayOutputStream baos = new ByteArrayOutputStream();, options);


private void applyWordFooter(Document doc) throws Exception {
     DocumentBuilder builder = new DocumentBuilder(doc);

     Shape shape = builder.insertImage(FOOTER_CONTENT);

Thanks for your help!


Hi Otto

Thanks for your inquiry. I think, in this case, calling Document.updatePageLayout method before saving the document to PDF will help. For more information, please read the FAQs mentioned in the following link:

Best regards,