docx4j icon indicating copy to clipboard operation
docx4j copied to clipboard

applyBindings drops styling

Open ragnarruutel opened this issue 2 years ago • 0 comments

I have document where data is loaded from customXml/item1.xml (inside docx). When I use BindingHandler to update document it will drop styling inside table rows (how it looks).

Here's the code I use to apply bindings:

WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(docxFile);

OpenDoPEHandler odh = new OpenDoPEHandler(wordMLPackage);
wordMLPackage = odh.preprocess();

OpenDoPEIntegrity openDopeIntegrity = new OpenDoPEIntegrity();
openDopeIntegrity.process(wordMLPackage);

BindingHandler.getHyperlinkResolver().setHyperlinkStyle("Hyperlink");

BindingHandler bh = new BindingHandler(wordMLPackage);
bh.applyBindings();

OpenDoPEIntegrityAfterBinding odiab = new OpenDoPEIntegrityAfterBinding();
odiab.process(wordMLPackage);
wordMLPackage.save(docxFile);

And here is the docx file before and after applying bindings.

ragnarruutel avatar Nov 23 '22 09:11 ragnarruutel