I have a document (Text.zip (15.2 KB)) obtained from third-party source.
I need to convert hidden field {TC "1.1 Test \fC \1 “2”} into a static text. (I use compare function in further processing)
But on line FieldsHelper.ConvertFieldsToStaticText(doc, targetFieldType); I get an exception ‘java.lang.NullPointerException’
Document doc = new Document(“Test.docx”);
FieldsHelper.ConvertFieldsToStaticText(doc, targetFieldType);
…
The function ConvertFieldsToStaticText I’ve found in documentation on this page:
I’ve tried to add try…catch like this:
try {
FieldsHelper.ConvertFieldsToStaticText(doc, targetFieldType);
} catch (Exception ex) {}
but resulted document contains the text ‘Test’ only, and there isn’t text '. This is text. ’ in continue.