There are many examples and posts for adding a watermark to docx but are there any example/s of the opposite please.
I need to be able to remove any watermark from all sections of a document.
It is currently Thu Apr 24, 2025 2:29 pm
File templateZip = new File("resources/doctest.docx")
WordprocessingMLPackage template = WordprocessingMLPackage.load(templateZip)
def map = ["pagebreak": "<w:r><w:br w:type=\"page\"/></w:r>"]
template.mainDocumentPart.variableReplace(map)
if (template.isGenerateToc()) {
Toc.setTocHeadingText("Inhaltsverzeichnis");
TocGenerator tocGenerator = new TocGenerator(wordPackage);
tocGenerator.generateToc(2, " TOC \\o \"1-3\" \\h \\z \\u ", true);
}
Total posts 10160 • Total topics 2859 • Total members 2089