I'm currently facing a problem when it comes to replace a text within a document that also contains a TOC (table of content) if the replacement text matches a chapter number.
I attach the following sample document "test.docx".
And here is the really simple test code:
- Code: Select all
Document document = new Document("test.docx");
document.setReplaceFirst(true);
document.replace("XXX", "1", true, true);
document.saveToFile("test.pdf", FileFormat.PDF);
As you can see the task is to replace "XXX" by some different text. The replacement doesn't take place if the replacement text is either "1", "2" or "3". However, the replacement works for any other text. Futhermore it works for "1", "2" and "3" if
is not called before or if the document does not contain a TOC.setReplaceFirst(true)
I've tested it with the latest version of "Spire.Doc for Java".
Please provide me with a bugfix. Thank you.
Kind regards,
Marcus