We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
link blog: https://rieckpil.de/howto-generate-documents-from-word-templates-with-docx4j-on-wildfly-14/ link src code: https://github.com/rieckpil/blog-tutorials/tree/master/generate-documents-from-word-templates-with-docx4j-on-wildfly14
Show by template input.docx without add more in footer
Show in footer of file output.docx "generated with Docx4j on Wildfly"
lib maven pom.xml org.docx4j docx4j-JAXB-Internal 8.0.0 org.docx4j docx4j-JAXB-ReferenceImpl 8.0.0 org.docx4j docx4j-JAXB-MOXy 8.0.0 org.docx4j docx4j-export-fo 8.0.0
code java: public static void generateDocxFileFromTemplate() throws Exception { // TODO - ref: https://github.com/rieckpil/blog-tutorials/tree/master/generate-documents-from-word-templates-with-docx4j-on-wildfly14 InputStream templateInputStream = new FileInputStream("C:\Users\thangnm\Desktop\template (1).docx");
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(templateInputStream); MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart(); VariablePrepare.prepare(wordMLPackage); HashMap<String, String> variables = new HashMap<>(); variables.put("firstName", "userInformation.getFirstName()"); variables.put("lastName", "userInformation.getLastName()"); variables.put("salutation", "userInformation.getSalutation()"); variables.put("message", "userInformation.getMessage()"); documentPart.variableReplace(variables); String outputfilepath = "C:\\Users\\thangnm\\Desktop\\template (2).docx"; FileOutputStream os = new FileOutputStream(outputfilepath); wordMLPackage.save(os); os.flush(); os.close(); }
Please help me, thanks!!!
The text was updated successfully, but these errors were encountered:
@rieckpil Please help me, thanks!!!
Sorry, something went wrong.
@thangnm11 does the error still occur?
No branches or pull requests
Blog post you are referring to
link blog: https://rieckpil.de/howto-generate-documents-from-word-templates-with-docx4j-on-wildfly-14/
link src code: https://github.com/rieckpil/blog-tutorials/tree/master/generate-documents-from-word-templates-with-docx4j-on-wildfly14
Expected Behavior
Show by template input.docx without add more in footer
Current Behavior
Show in footer of file output.docx "generated with Docx4j on Wildfly"
Steps to Reproduce
lib maven pom.xml
org.docx4j
docx4j-JAXB-Internal
8.0.0
org.docx4j
docx4j-JAXB-ReferenceImpl
8.0.0
org.docx4j
docx4j-JAXB-MOXy
8.0.0
org.docx4j
docx4j-export-fo
8.0.0
code java:
public static void generateDocxFileFromTemplate() throws Exception {
// TODO - ref: https://github.com/rieckpil/blog-tutorials/tree/master/generate-documents-from-word-templates-with-docx4j-on-wildfly14
InputStream templateInputStream = new FileInputStream("C:\Users\thangnm\Desktop\template (1).docx");
Please help me, thanks!!!
The text was updated successfully, but these errors were encountered: