Update Print Date Fields in Header Footer of Word Document when Saving to PDF or HTML Fixed - Java

Hi,

When saving a Word document as HTML (or as PDF) that has a [PrintDate] field, it only updates the [PrintDate] field that is in the document. If it is positioned in the header or footer it is never updated.

See included file PrintDate.docx (15.1 KB).

The result when saving as fixedhtml is image.png (5.2 KB)

@inceptionEhv,

After an initial test with the licensed latest (21.5) version of Aspose.Words for Java, we were unable to reproduce this issue on our end. We used the following simple code snippets on our end for testing:

Document doc = new Document("C:\\Temp\\PrintDate.docx");
doc.save("C:\\Temp\\awjava-21.5.pdf");

Document doc = new Document("C:\\Temp\\PrintDate.docx");
HtmlFixedSaveOptions htmlFixedSaveOptions = new HtmlFixedSaveOptions();
doc.save("C:\\Temp\\awjava-21.5.html", htmlFixedSaveOptions);

So, we suggest you to please upgrade to the latest (21.5) version of Aspose.Words for Java.

Hi,

After some more testing, I’ve found that the error occurs when the following method is executed before saving:

doc.updatePageLayout();

If I remove that line it does seem to work.

@inceptionEhv,

It is great that you were able to workaround this problem on your end. Please let us know any time you may have any further queries in future.

Hi,

I’m afraid this is not a workaround. We really need to update the pageLayout.
Is there a way to ensure the PrintDate is correct even after calling updatePageLayout?

@inceptionEhv,

We have logged this problem in our issue tracking system with ID WORDSNET-22351. We will further look into the details of this problem and will keep you updated on the status of linked issue. We apologize for your inconvenience.

Hi,

Is it possible to give an update to this bug? The issue now still has the status ‘In Review’

@inceptionEhv,

I am afraid, we still need to internally discuss the best possible way to fix the problem and WORDSNET-22351 is “In Development” stage now. We will inform you here as soon as this issue will get resolved in future and apologize for any inconvenience.

Hi,

Is it possible to give an update to this bug?

@inceptionEhv Unfortunately, the issue is not yet resolved. I will consult with the responsible developer and provide you more information.

Hello!

Did you receive more information?

Best regards,
The Inception Team

@inceptionEhv The issue is scheduled to be fixed before 22.10 (October 2022) version of Aspose.Words. We will be sure to inform you once it is resolved.
Please note, this is a rough estimate and it can be shifted.

The issues you have found earlier (filed as WORDSNET-22351) have been fixed in this Aspose.Words for Java 22.9 update also available on Maven.