简体   繁体   中英

Reading word template user entered values in java

I have a word template for a application Form (which contains text, dropdowns, checkboxes, date fields..). In my web application whenever user starts a new process they need to fill some high level data, here I need to fill some of the user entered data into the word template and let user download that document. Later user takes this document offline and fills empty lower level fields in that document, whenever they are done filling they will upload the document back into the application. Now I need to read the values of each field that user entered and store those values in Database.

Can someone give me the direction how to achieve this using java.

Or is there a better way to achieve the same with other than the word templates.

-----------------Update--------- Planning to use docx4j library. Following are the higher level steps that I may follow for my process

  • Creating a word template using locked content controls
  • A unique tag value (w:tag) will be assigned for each content control
  • Will populate any dropdown values and any other controls values using docx4j library.
  • After user fills the form, will extract data from template using docx4j, considering the unique tag value that I assigned in first step.

The Apache OpenOffice API (based on the UNO component technology) allows you to read and manipulate OpenOffice documents. To .doc (not based on xml) formats you can use de API to convert the file to ODT, what turn you enabled to extract and process the data within the document.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM