How to convert a RTF file to HTML using Java

Hi I have RTF content in database, and I need to display it on the web-page. For that I am using groupdocs to convert the RTF into html format. Groupdocs converts RTF to HTML, but the final out put is in page-format. i.e if I have a small RTF just of two to three lines, HTML out put come with the border of a page size and rest of the page area is kept blank.


I am actually embedding such HTML inside my web-page, where I do not need border or extra space…

Is it possible to convert RTF to HTML in appropriate length only? i.e. if RTF is of just three line, HTML should not claim a whole page… and if RTF is of long length, HTML should not be displayed in multiple pages, instead it should be having single long html only, which I can embed on web page.

For reference check the attached screenshot, I need to get rid of border and space#1,2,3

Hello Vishal,


Thanks for taking interest in GroupDocs.Conversion for Java and posting your query.

It will be really helpful if you can tell us the version of the API you are using in your project.

Keen to hear from you.

Best Wishes.

Hi Muhammad,


Thank you for your reply. I am using the version 3.0.0.

For your reference my maven dependency is:

com.groupdocs
groupdocs-conversion
3.0.0

Thanks,
Vishal

Hello Vishal,


We are investigating your scenario, we shall come back to you with the outcomes.

Please stay tuned.
Hi Muhammad,

If you can have me idea on considering these issues - like if any recent progress has been made on it or you have any rough idea during what time these issues will be considered, I will really appreciate your feedback.

Hi Vishal,


We shall share ETA with you as we have any update.

We appreciate your patience.
Thanks

@vishal1,

We have an update regarding CONVERSIONJAVA-198. When converting from words to html, by default conversion uses FixedLayout to reproduce as exactly as possible original document layout.

If you need simplified markups and flow layout you can use:
saveOptions.setFixedLayout(false)