Open metallica33 opened 1 year ago
Hi @metallica33 , I never experienced this.
docx4j-search-and-replace-util - v1.0.7 docx4j - v8 MS Word 365
Could you share the docx file with me and give me instructions for a minimal producer, please?
I have attached the files here. The document.docx is the file which is saved after conversion. Just run the code provided earlier and it will create the documen.pdf and document.docx files.
I did not have time so far to look into this, sorry. I hope sometime in the next few days.
I was facing this same issue. I was using docx4j v6.1.2. After a couple of google searches, I ended up using these libraries:
<dependency>
<groupId>org.docx4j</groupId>
<artifactId>docx4j-core</artifactId>
<version>8.3.9</version>
</dependency>
<dependency>
<groupId>org.docx4j</groupId>
<artifactId>docx4j-export-fo</artifactId>
<version>8.3.9</version>
</dependency>
<dependency>
<groupId>org.docx4j</groupId>
<artifactId>docx4j-JAXB-ReferenceImpl</artifactId>
<version>8.3.9</version>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>4.0.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>4.0.3</version>
</dependency>
<dependency>
<groupId>de.phip1611</groupId>
<artifactId>docx4j-search-and-replace-util</artifactId>
<version>1.0.7</version>
</dependency>
Sorry, I don't have the capacity to investigate this.
I am using this utility to replace the text in the docx file. If I try to save the docx file then it will not open in the MS Word. It gives an error as shown in the attached screenshot. But converting to PDF using Docx4j.toPDF creates the PDF file correctly.
Here is the code -