Converting RTF text to HTML text

Hi,

I am using Java. I have HTML text, I don’t have a file. I want to convert the RTF text to HTML text in memory. How can I do that? Can you please tell me the API class and method to use?

Thanks and regards,

Amit.

Hi Amit

Thanks for your inquiry. Please refer to the following article:

Creating or Loading a Document
Saving a Document

Please use following code example to convert Rtf document into Html. Hope this helps you.

String filename = "in.rtf";

InputStream in = new FileInputStream(MyDir + filename);

Document doc = new Document(in);

// Save the document to a OutputStream object.
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
doc.save(outputStream, SaveFormat.HTML);

thanks .that worked. thanks a lot.
One more question.
The HTML output from Aspose gives the following message at the beginning of the text:
“Evaluation Only. Created with Aspose.Words. Copyright 2003-2015 Aspose Pty Ltd.”
What do I have to do?

Hi Amit,

Thanks for your inquiry. Please note that in evaluation mode there are some limitations applied. E.g. Aspose.Words injects an evaluation watermark at the top of the document. The document’s contents are truncated after a certain number of paragraphs during import or export.

Please request for 30-days temporary license from here:
Get temporary license

Please refer to the following article about applying license.
Applying a License