2 years ago

#64490

test-img

A.G.S Suresh

Conversion of docx to pdf using docx4j library in java

If i am trying to convert the docx file to pdf file

Code :

InputStream is = file.getInputStream();
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(is);
File outputFile = new File(file.getOriginalFilename() + ".pdf");
FileOutputStream os = new FileOutputStream(outputFile);
Docx4J.toPDF(wordMLPackage,os);
os.flush();
os.close();

This is the error I am getting :

org.apache.fop.apps.FOUserAgent - Font "Times New Roman,normal,400" not found. Substituting with "any,normal,400".
o.d.convert.out.fo.FOPAreaTreeHelper - For @bpda, 
<block bap="0 0 0 0" bpd="0" ipd="427522" ipda="427522" visibility="visible"/>
o.d.convert.out.fo.FOPAreaTreeHelper - For input string: ""
java.lang.NumberFormatException: For input string: ""

Can anyone help me. Thanks in advance.

java

docx4j

0 Answers

Your Answer

Accepted video resources