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.