如何将文档转换,在java中docx文件为PDF编程 [英] how to convert doc,docx files to pdf in java programatically

查看:213
本文介绍了如何将文档转换,在java中docx文件为PDF编程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我能够使用docx4j.But我需要doc文件转换为PDF格式,包括图像和表格来生成的docx文件pdf。
有什么办法来转换文档在Java中DOCX 。或(DOC到PDF)?

I am able to generate pdf from docx file using docx4j.But i need to convert doc file to pdf including images and tables. Is there any way to convert doc to docx in java. or (doc to pdf)?

推荐答案

docx4j包含or​​g.docx4j.convert.in.Doc,它使用POI读取.DOC,但它是一个概念证明,而不是生产准备$ C $℃。上次我检查,有限制的二进制.DOC的POI的HWPF解析。

docx4j contains org.docx4j.convert.in.Doc, which uses POI to read the .doc, but it is a proof of concept, not production ready code. Last I checked, there were limits to POI's HWPF parsing of a binary .doc.

继mqchen的评论,你可以使用的LibreOffice或OpenOffice转换为DOC DOCX。但是,如果你要使用的LibreOffice或OpenOffice,你不妨用它来双方.DOC转换和直接的.docx为PDF。谷歌的jodconverter。

Further to mqchen's comment, you can use LibreOffice or OpenOffice to convert doc to docx. But if you are going to use LibreOffice or OpenOffice, you may as well use it to convert both .doc and .docx directly to PDF. Google 'jodconverter'.

这篇关于如何将文档转换,在java中docx文件为PDF编程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆