Static Date fields rendered incorrectly in PDF

I have a current date field in a Word document.

To prevent the field updating, I am using the FieldsHelper from the examples.
https://github.com/aspose-words/Aspose.Words-for-Java

When using FieldsHelper to create static Date fields, the date is cut off.

Maybe I am not using the right FieldsHelper because another example in PHP refers to a class com.aspose.words.FieldsHelper, but i cannot find that. I am using Aspose Words for Java 16.4.0. I checked 18.6 but it does not seem to contain the class. Maybe i am missing a dependency?

I checked for a link that was present in other topics:
https://docs.aspose.com/words/java/how-to-replace-or-modify-hyperlinks-and-replace-fields-with-static-text/
But the link is broken.

And the value is not correct.

In Word it look like this:

By default the Aspose delivers this:

With the static helper from the example it look like this:

I have tried to hack the fieldshelper to find a specific Run instance so i could set the field manually but the field is always cut off. It should read 12 januari 2015. When i hack in that string value, it leaves only the number 12.

I have even tried non-breaking unicode spaces, but that did not help. I do not know how to set the size of the Run object as i think it is rendered when saved. If i use a text without spaces, the full text is visible.

In the Node instances that fly by there are two Run instances. One with the 5 July value and one with the original value. Removing the “5 July” instance does not help. Is there some way to make the field non-linebreaking?

I have reviewed:
https://forum.aspose.com/t/how-to-convert-doc-to-pdf-without-updating-fields/41655
https://forum.aspose.com/t/word-replace-fields-with-static-text/55252/2

But nothing i found there helps.

I don’t know what to do to resolve this issue.

Hmm oh my god.

The PdfSaveOptions class has a setUpdateFields method.
That allows for the date field not to be updated.

saveOptions.setUpdateFields(false)

Thanks anyway.

@benzoid,

Thanks for your inquiry. It is nice to hear from you that you have found the solution of your query. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.

Can you update your documentation to show that this FieldsHelper is no longer needed?

In your documentation you still refer to it:

$helper = new Java(“com.aspose.words.FieldsHelper”, $targetFieldType);

This is a non-existent class.
https://docs.aspose.com/words/java/replace-fields-with-static-text/

@benzoid,

Thanks for your suggestion. We will remove FieldsHelper class from the documentation.