Java RTF import, edit and export possible?

前提是你 提交于 2019-12-14 01:02:53

问题


I use Apache Tika to parse RTF files to get the plaintext as string. Now I want to remove some characters from this string -> ok. Now I want to save the result as RTF again. (You can think of this process as modifying an RTF file by deleting a paragraph.) How is this possible? How can I export this string to RTF with Tika?


回答1:


There is a solution to edit docs, but it is a little complex. You can use the OpenOffice API to open a lot of types of docs and export it to other formats. I used it, sometime ago, to read data from a database and export as an odt and xls file.

I never used it to edit a doc, like a file from Writer or MS Word, but, by the OpenOffice documentation, I know that is possible to do it. Maybe this can be a cannon to kill a fly, but if you don find any other ways, could solve your problem.

The API works with Java, C++ etc.



来源:https://stackoverflow.com/questions/10317030/java-rtf-import-edit-and-export-possible

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!