Grails - Read, customize and attach a word document -
i need following (with grails):
- read word template
- add user details (e.g. name, last name) document
- send customized word mail
i thinking in apache poi read .doc, in document have keywords e.g."°!"#$" , make customization. create document, send (with grails plugin) , erase document server
is approach or forgetting something? thank much
edit: docx4j: docx operations simple, can go "approach 1" in variable replace, reason next sample not working me: https://github.com/plutext/docx4j/blob/master/src/samples/docx4j/org/docx4j/samples/variablereplace.java
i'm getting a:
| error 2014-03-27 09:10:23,640 [http-bio-9000-exec-5] error errors.grailsexceptionresolver - saxparseexception occurred when processing request: [post] /estrategia/pasantiacorta/generardocumento content not allowed in prolog.. stacktrace follows: message: content not allowed in prolog.
in line:
// approach 1 (from 3.0.0; faster if haven't yet caused unmarshalling occur):
documentpart.variablereplace(mappings);
sure, can use poi or docx4j. either, you'd better off using docx rather legacy binary doc format.
for docx4j (my project), see creating-word-docx-documents-dynamically-from-grails
at step 2 (add user details), there variety of approaches can use.
Comments
Post a Comment