I am trying to merge XML and docx using DOcx4J. But even if I use the flag Docx4J.FLAG_BIND_REMOVE_SDT Docx4J is not removing the Content controls from the docx file. I am using the below code.
WordprocessingMLPackage wordprocessingMLPackage = Docx4J.load(new File(docx_template_location)); FileInputStream xmlStream = new FileInputStream(new File(xml_data_location)); Docx4J.bind(wordprocessingMLPackage, xmlStream, Docx4J.FLAG_BIND_INSERT_XML & Docx4J.FLAG_BIND_REMOVE_SDT); Docx4J.save(wordprocessingMLPackage, new File(required_outputfile_name), Docx4J.FLAG_SAVE_ZIP_FILE);
No comments:
Post a Comment