how convert rtf string plain text in java? obvious answer use swing's rtfeditorkit, , seems common answer around internet. write method claims return plain text isn't implemented... it's hard-coded throw ioexception in java6.
i use swing's rtfeditorkit in java 6 this:
rtfeditorkit rtfparser = new rtfeditorkit(); document document = rtfparser.createdefaultdocument(); rtfparser.read(new bytearrayinputstream(rtfbytes), document, 0); string text = document.gettext(0, document.getlength());
and thats working.
Comments
Post a Comment