Page 1 of 1

Where is the Word helper addin?

PostPosted: Mon Aug 12, 2019 11:37 am
by Vikram
The link on the homepage (https://www.docx4java.org/trac/docx4j) for the addin leads to this page: https://www.docx4java.org/blog/2014/12/ ... ord-addin/.

But the “download the installer” link there doesn’t work.

Re: Where is the Word helper addin?

PostPosted: Tue Aug 13, 2019 7:05 am
by jason
Thanks for the heads-up.

The link you want is https://docx4java.org/docx4j/Docx4j_Helper_3-3-6-0.exe

Re: Where is the Word helper addin?

PostPosted: Tue Jul 06, 2021 12:33 am
by nqth
Hello

The link is dead.
Actually I'm getting some troubles to make working the new lines breaks on placeholders replacement.

Here is the code:

{...}
Code: Select all
      TextMetaItem tmi1 = arr[replaceCommand.getFoundResult().getStart()];
             TextMetaItem tmi2 = arr[replaceCommand.getFoundResult().getEnd()];

                       ObjectFactory factory = Context.getWmlObjectFactory();
                       Br br = factory.createBr();

         // do replacement inside a single Text-object
         String t1 = tmi1.getText().getValue();
         LOGGER.debug("tmi1.getText().getValue() :" + tmi1.getText().getValue());
         int beginIndex = tmi1.getPositionInsideTextObject(replaceCommand.getFoundResult().getStart());
         int endIndex = tmi2.getPositionInsideTextObject(replaceCommand.getFoundResult().getEnd());

         String keepBefore = t1.substring(0, beginIndex);
         String keepAfter = t1.substring(endIndex + 1);

         tmi1.getText().setValue(keepBefore + replaceCommand.getNewValue() + keepAfter);

{...}

replaceCommand.getNewValue() contains the new String to replace the placeholder String.
I would like to know how to add the <w:br/> between each line within the replaceCommand.getNewValue() which already contains the new line character(s),

Thanks in advance