简体   繁体   English

使用Java将Word文档转换为PDF

[英]Convert Word Document to PDF using Java

I want to convert ms word document to PDF file using POI.jar(read the MS word Content) and Itext.jar(Creat the PDF File). 我想使用POI.jar(读取MS word Content)和Itext.jar(创建PDF文件)将ms word文档转换为PDF文件。

For Plain text in MS word, I am able to conver into PDF. 对于MS word中的纯文本,我可以转换为PDF。 But I have few images on ms word. 但我在ms字上的图像很少。 I want to put those images on PDF. 我想把这些图像放在PDF上。

Could some please help me out? 有人可以帮帮我吗?

你幸运的我只是偶然发现JODConverter它使用openoffice来隐藏java并且它非常容易使用。

There isn't such a solution for free, you will have to buy something like Aspose components , but you can also save the Word document as HTML and use any of the available HTML-to-PDF tools to convert it to PDF using Java. 没有这样的免费解决方案,您将不得不购买类似Aspose组件的东西,但您也可以将Word文档保存为HTML并使用任何可用的HTML-to-PDF工具将其转换为使用Java的PDF。 One of them is wkhtmltopdf . 其中一个是wkhtmltopdf

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM