Kindly let me know any API to calculate the line count for RTF document.
Apache POI or Aspose works for document, but its not able to find line count for RTF.
Thanks.
Kindly let me know any API to calculate the line count for RTF document.
Apache POI or Aspose works for document, but its not able to find line count for RTF.
Thanks.
Java already has a built-in RTF-Parser: RTFEditorKit.
Take a look at its read method.
For example:
test.rtf
file contentsSo, it has 3 lines separated by
\n
.Code:
Output =
3
You can use Aspose.Words for Java to get the number of lines of an RTF document. Please do the following:
I hope this helps. Please note that I work as developer evangelist at Aspose. If you need any help with Aspose, do let me know.