简体   繁体   English

如何在Java中将pdf转换为doc文件

[英]How to convert pdf to doc file in java

need to convert a pdf file to a doc file. 需要将pdf文件转换为doc文件。 I found different type of example to generate pdf file but not got pdf to doc. 我发现了不同类型的示例来生成pdf文件,但没有将pdf转换为doc。

What your asking is actually very difficult 你的要求实际上很难

I recommend you start here and look for a good parsing library. 我建议您从这里开始并寻找一个好的解析库。 then you would have to write it out in .doc format. 那么您将必须以.doc格式将其写出。 Inevitably a lot of the formatting and extra information would be lost. 不可避免地会丢失很多格式和额外的信息。 it would be a lot easier to output to docx format, but i assume thats not what your looking for. 输出到docx格式会容易得多,但是我认为那不是您想要的。

I see few possible solutions: 我看到一些可能的解决方案:

  1. Davisor Publishor 6.2 probably can be used, but it is commercial, and seems that generates only txt from pdf... just have a look Davisor Publishor 6.2可能可以使用,但是它是商业性的,似乎只能从pdf生成txt ...

  2. parse pdf with iText , and then generate doc with Apache POI - another way to try (free one ;) 使用iText解析pdf,然后使用Apache POI生成doc-另一种尝试方式(免费);

  3. look for command line tools, like Convert PDF To DOC and execute them from java 寻找命令行工具,例如“ 将PDF转换为DOC”并从Java执行它们

Otherwise take a look at Con's answer, there is a link to the list with java pdf processing libraries, maybe some library can do it directly, or can be used to parse pdf (better than iText), and then just use Apache POI to generate doc. 否则,请看看Con的答案,有一个指向Java pdf处理库的列表的链接,也许有些库可以直接做到,或者可以用来解析pdf(比iText更好),然后仅使用Apache POI即可生成文档。 Hope it helps ;) 希望能帮助到你 ;)

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

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