with docx4j-2.1.0, and this code:
- Code: Select all
String inputfilepath = "/home/fiorenzo/test_docx.docx";
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage
.load(new java.io.File(inputfilepath));
// Create temp file.
java.io.File temp = java.io.File.createTempFile("output", ".pdf");
OutputStream os = new java.io.FileOutputStream(temp);
OutputStream os2 = new java.io.FileOutputStream(
"/home/fiorenzo/test_docx2.html");
javax.xml.transform.stream.StreamResult result = new javax.xml.transform.stream.StreamResult(
os2);
org.docx4j.convert.out.html.HtmlExporter.html(wordMLPackage, result,
inputfilepath + "_files");
wordMLPackage.pdf(os);
os.close();
I attached the results of my conversion tests (docx to pdf and html), with different programs (docx4j/word 2007/batch program in windows):
http://liverockmedia.com/docx/test_docx.zip
Bye ...