How To Convert rtf To String In Java?

public String convertRtfToText(String fareRules) throws IOException, BadLocationException { try { byte[] x = Base64.getDecoder().decode(fareRules.getBytes()); RTFEditorKit rtfParser = new RTFEditorKit(); Document document = rtfParser.createDefaultDocument(); rtfParser.read(new ByteArrayInputStream(x), document, 0); String fareRuleText = …

How To Convert rtf To String In Java? Read More

How to convert RTF to Plain Text in Java?

Use below code : import javax.swing.text.Document; import javax.swing.text.rtf.RTFEditorKit; String rtfString = “e1xydGYxXGZiaWRpc1xhbnNpXGFuc2ljcGcxMjUyXGRlZmYwXGRlZmxhbmcxMDMze1xmb250dGJse1xmMFxmcm9tYW5cZnBycTJcZmNoYXJzZXQwIFRpbWVzIE5ldyBSb21hbjt9e1xmMVxmbmlsXGZjaGFyc2V0MTc3IE1pY3Jvc29mdCBTYW5zIFNlcmlmO319DQp7XGNvbG9ydGJsIDtccmVkMjU1XGdyZWVuMFxibHVlMDtccmVkMFxncmVlbjBcYmx1ZTA7fQ0KXHZpZXdraW5kNFx1YzFccGFyZFxsdHJwYXJcY2YxXGYwXGZzMjIgWW91IGhhdmUgY2hvc2VuIHRvIGJvb2sgYSBTcGljZU1heCBmYXJlLiBUaGlzIGZhcmUgaXMgXGNmMlxiIGVudGl0bGVzIHlvdSBhIGhvc3Qgb2YgcHJpdmlsZWdlcyBsaWtlIGV4dHJhIGxlZyByb29tIGNvbWZvcnRhYmxlIHNlYXQsIGNvbXBsaW1lbnRhcnkgbWVhbHMsIEluLWZsaWdodCBlbnRlcnRhaW5tZW50LCBwcmlvcml0eSBwcml2aWxlZ2VzIGFuZCBtb3JlXGNmMVxiMCAuIENhbmNlbGxhdGlvbnMgYXJlIHBlcm1pdHRlZCBhdCBhcHBsaWNhYmxlIGNoYXJnZXMuXGNmMFxwYXINClxwYXJkXGx0cnBhclxmMVxydGxjaFxmczE3XHBhcg0KfQ0K”; byte[] b = rtfString .getBytes(); RTFEditorKit rtfParser = new RTFEditorKit(); Document document = rtfParser.createDefaultDocument(); rtfParser.read(new ByteArrayInputStream(rtfString), document, 0); …

How to convert RTF to Plain Text in Java? Read More

No more data to read from socket

Please Update the connection pool properties in configuration file. For mybatis : configuration.xml file <?xml version=”1.0″ encoding=”UTF-8″ ?> <!DOCTYPE configuration PUBLIC “-//mybatis.org//DTD Config 3.0//EN” “http://mybatis.org/dtd/mybatis-3-config.dtd”> <configuration> <properties resource=”database.properties”/> <environments default=”development”> …

No more data to read from socket Read More