Page 1 of 1

how to update textfield values?

PostPosted: Fri May 04, 2018 11:59 pm
by osdevParag
I have a word template with many text fields and checkboxes
How to use docx4j to update values of these text fields (tontents) and check/uncheck checkboxes?
I basically want to fill docx form programmatically using docx4j
Is it possible?

Re: how to update textfield values?

PostPosted: Sat May 12, 2018 3:29 am
by arimmer
I also want to do something like this - allow users to set up DOCX 'Templates' with some data/formatting etc. set in the 'Template' but also 'placeholders' which I can find programmatically and replace with data when the template is used, for example Author, Date or some larger set of text like the contents of a report run on the users data.

Is this possible using docx4j or am I going to have to code the details all by hand?

If it is possible but a specific version of docx4j is required, can this please be mentioned in the reply so I can ensure we are using the appropriate version.

Re: how to update textfield values?

PostPosted: Mon May 21, 2018 9:16 pm
by jason
I suggest you take a look at https://www.docx4java.org/blog/2018/04/ ... a-binding/

osdevParag wrote:How to use docx4j to update values of these text fields (tontents) and check/uncheck checkboxes?


It depends what sort of fields they are, and what sort of checkboxes.

MERGEFIELD you can process directly, or convert to OpenDoPE content controls. OpenDoPE handling includes check box content controls.