docx4j的"getting started“文档包含将docx写入pdf的示例代码:
// Set up converter
org.docx4j.convert.out.pdf.PdfConversion c =
new org.docx4j.convert.out.pdf.viaXSLFO.Conversion(wordMLPackage);
然而,从docx4j 3.0开始,整个PdfConversion工具似乎都被弃用了,而没有通知现在如何执行转换。那么,在docx4j 3.0中将docx转换为pdf的不被推荐的方式是什么呢?
发布于 2013-12-31 03:21:50
PDF3.0有一个外观,你可以用它来转换成docx4j。
下面是一个使用它的例子
发布于 2016-03-31 20:59:35
这就是你怎么做的:
Docx4J.toPDF(wordMLPackage, new FileOutputStream("path/to/your-pdf-file.pdf"));
发布于 2016-11-22 01:01:50
说得够多了..。从示例源代码中:
* From v3.3.0, PDF output is by default via Plutext's commercial PDF Converter.
*
* By default, the evaluation instance at:
*
* http://converter-eval.plutext.com:80/v1/00000000-0000-0000-0000-000000000000/convert
*
* is used. To specify your own instance, please set docx4j.properties property:
*
* com.plutext.converter.URL=http://your.host:80/v1/00000000-0000-0000-0000-000000000000/convert
*
* If you don't want to use Plutext's PDF Converter, you can still use XSL FO and Apache FOP;
* just put docx4j-export-fo and its depedencies on your classpath and use Docx4J.toFO
* as per the example below.
那么,如果必须退回到使用XSL-FOP/ Docx4J,那么使用XSL有什么意义呢?!
https://stackoverflow.com/questions/20840051
复制相似问题