Hi,
I have added header and footer to my document. But when i download it as DOCX, the signature image that is added is not getting displayed, but if i download in DOC or PDF i can see the signature image. Can someone please help me?
It is currently Fri Apr 11, 2025 12:17 pm
TocGenerator tocGenerator = new TocGenerator(wordMLPackage);
tocGenerator.generateToc( 8, " TOC \\o \"1-3\" \\h \\z \\u ", false);
<dependency>
<groupId>org.docx4j</groupId>
<artifactId>docx4j-JAXB-ReferenceImpl</artifactId>
<version>8.3.1</version>
</dependency>
<dependency>
<groupId>org.docx4j</groupId>
<artifactId>docx4j-export-fo</artifactId>
<version>8.3.1</version>
</dependency>
org.docx4j.openpackaging.exceptions.Docx4JException: Problem saving part /_rels/.rels
java.lang.ClassNotFoundException: org.docx4j.jaxb.ri.NamespacePrefixMapper
// Docx4J
implementation 'org.docx4j:docx4j-core:8.2.8'
implementation 'org.docx4j:docx4j-openxml-objects:8.2.8'
implementation 'org.docx4j:docx4j-openxml-objects-pml:8.2.8'
implementation 'org.docx4j:docx4j-openxml-objects-sml:8.2.8'
// MOXy docx-JAXB Impl
implementation 'org.docx4j:docx4j-JAXB-MOXy:8.2.8'
implementation 'org.docx4j:docx4j-documents4j-local:8.2.8'
Docx4J.toPDF(wordMLPackage, outputstream);
public void saveToPdfFile(String name){
//saveToWordFile(name); ///works!!!
try {
PdfSettings s = new PdfSettings();
PdfConversion c = new Conversion(this.getWordMLPackage());
OutputStream out = new FileOutputStream(new File(name));
c.output(out, s);
} catch (Exception e) {
e.printStackTrace();
}
}
Total posts 10158 • Total topics 2858 • Total members 2088