Java RTF Parser

后端 未结 2 1288
感动是毒
感动是毒 2020-12-07 02:43

Does anyone know of a robust RTF parser I can use in Java? I need to extract plain text, including international text. It would also be nice to extract embedded images and

相关标签:
2条回答
  • 2020-12-07 03:28

    You may find RTF Parser Kit useful. It provides a stream-based parser which delivers events to you as the document is parsed. There is a simple example text extractor provided which demonstrates how the API can be used.

    0 讨论(0)
  • 2020-12-07 03:34

    If your project is non-commercial then there is a good free Java rtf to xml library here, better than etranslate in my opinion, and you can process the xml from there. However if you are using it for commercial purposes you will have to arrange licensing with rtf-to-xml.com, the company that developed it.

    However having once been in a similar situation, before finding rtf-to-xml, I found a funny work around for this problem when I need to parse ms rtf on linux server. There is a free rich text processor, which is also a library called Ted It takes arguments from the command line with out the user interface and can be wrapped in JNI call.

    I hope this helps.

    0 讨论(0)
提交回复
热议问题