[英]PDF Open Office or MS Word
I am new to java, I have to read a PDF, Open Office or MS Word file and make changes in the file and render as PDF document on my web page. 我是java的新手,我必须阅读PDF,Open Office或MS Word文件,并对该文件进行更改,然后以PDF文档的形式呈现在我的网页上。 Please someone tell me which of these file's API or SDK is easy to use and also tell me best SDK for this. 请有人告诉我这些文件的API或SDK中哪个易于使用,并告诉我最佳的SDK。 So I can read, Update and render easily. 这样我就可以轻松阅读,更新和渲染。 file also contains Table but there is no image. 文件还包含表格,但没有图像。
We use Apache POI to read Microsoft Office files. 我们使用Apache POI读取Microsoft Office文件。 There are many libraries for PDF in Java. Java中有许多用于PDF的库。 iText is something I have used. iText是我使用过的东西。 Once you pick the tools, do a selective search on Stack Overflow . 选择工具后,对Stack Overflow进行选择性搜索。 There are plenty of discussions around these tools. 这些工具周围有很多讨论。
Depending on the types of updates you are doing, modifying PDF is going to be a problem - it's not intended for editing. 根据您正在执行的更新类型,修改PDF将是一个问题-不可编辑。 You might have to find some way of converting the PDF to something first, then edit. 您可能必须先找到将PDF转换为某些内容然后进行编辑的某种方法。 Depending on the types of changes you want to make and the documents you are working from even editing DOC and Writer files is going to be tricky. 根据您要进行的更改的类型以及您甚至通过编辑DOC和Writer文件所处理的文档,都将非常棘手。 They are all different formats. 它们都是不同的格式。
As Jayan mentioned, iText and POI may help you a little. 如Jayan所述,iText和POI可能会对您有所帮助。 OpenOffice Writer documents can be edited by unzipping then modifying the XML or using the UNO API. 可以通过解压缩然后修改XML或使用UNO API来编辑OpenOffice Writer文档。 Word documents can be editied by using MS Office automation (bad idea), converting to OpenOffice first then editing, or if DOCX, unzipping and processing the XML. 可以使用MS Office自动化(不好的主意)来编辑Word文档,先转换为OpenOffice,然后再进行编辑,或者如果是DOCX,则解压缩并处理XML。
Good luck. 祝好运。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.