Hi
I am trying to extract data from one docx file for adding into second docx file with following code:
- Code: Select all
List list = getTextFromOtherFile(Path);
for (Object obj : list) {
final StringWriter stringWriter = new StringWriter();
TextUtils.extractText(obj, stringWriter);
final String paragraphString1 = stringWriter.toString();
createTableRow1(tbl, paragraphString1);
}
getTextFromOtherFile(Path) method code is as follows:
public List getTextFromOtherFile(String file_name) throws Docx4JException, JAXBException, XPathBinderAssociationIsPartialException {
File doc = new File(file_name);
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(doc);
MainDocumentPart mainDocumentPart ...