Hi Jason,
In the AddImage example, File file = new File("/home/dev/lanl/testing/fig1.pdf" ); How can I get this file?
Thanks and Best Regards!
debarcar
It is currently Sat Dec 28, 2024 12:56 am
if (isNotBlank(font)) {
RFonts rf = new RFonts();
rf.setAscii(font);
rPr.setRFonts(rf);
}
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new java.io.File("c:\\byggestr.docx"));
MainDocumentPart docPart = wordMLPackage.getMainDocumentPart();
Document doc = XmlUtils.marshaltoW3CDomDocument(docPart.getJaxbElement());
Document data = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse("c:\\byggestr.xml");
modifyTableRows(doc, data);
docPart.setJaxbElement((org.docx4j.wml.Document)XmlUtils.unmarshal(doc));
CustomXmlDataStoragePart customXmlDataStoragePart = (CustomXmlDataStoragePart) wordMLPackage.getCustomXmlDataStorageParts().get("{A61EE2AE-F111-4B83-8C9C-F3BECEA1AD12}");
CustomXmlDataStorage customXmlDataStorage = customXmlDataStoragePart.getData();
printNode(data, "");
customXmlDataStorage.setDocument(data);
wordMLPackage.save(new java.io.File("c:\\fkf.docx"));
Total posts 10113 • Total topics 2844 • Total members 2075