Word HTML

Good day. I am using the trail version of Aspose, to see if we can use it at work. So far, I am very impressed.
Question, I am setting context for a paragraph from our application through java to generate the Word paragraph, but it is setting the paragraph as html text, not rendering it.
I reckon one must set a type eg: word/html etc. somewhere.
Any help would be much appreciated.

Hi Jac,

Thanks for the inquiry. This is how you can render Html paragraph to Word document.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc); 
builder.insertHtml("Paragraph right"); 
doc.save(getMyDir() + "DocumentBuilder.InsertHtml Out.doc");

In addition, please follow up the appropriate documentation links:
https://reference.aspose.com/words/java/com.aspose.words/DocumentBuilder
https://reference.aspose.com/words/java/com.aspose.words/Paragraph

I hope, this will help. In case of any ambiguity, please let me know.

Thanks a lot Imran. Much appreciated.
Will this count as RTF as well? Sorry, I scroll through pages and pages of documentation, but when I reach RTF I find all other things apart from what I am trying to solve.
How will pictures in this case be handled? (Reckon it will be binary)
Again, thanks for your response!

Hi Jac,

Thanks for the inquiry. Please note that Aspose.Words enables your applications to perform a great range of document processing tasks. Aspose.Words supports DOC, DOCX, RTF, XML, HTML, OpenDocument, PDF, XPS, EPUB and other formats. With Aspose.Words you can generate, modify, convert, render and print documents without utilizing Microsoft Word®. So, you can also load, edit and save document as an RTF format. For more information, please visit the following link:
https://docs.aspose.com/words/java/product-overview/

You can use DocumentBuilder.InsertHtml method to insert pieces of HTML into your document object. But you should note that path to the image should be valid and accessible. In addition, you can find a list of Supported features on HTML load here and a list of Supported features on saving to HTML format here.

Please let me know if I can be of any further assistance.

Hi Jac,

Thanks for your inquiry.

Are you looking to insert RTF content into a document like how DocumentBuilder.InsetHtml works for HTML?

Thanks,

Hi Adam,
Yes. I want to interface with the client using something like FCK editor, in which they can add the pictures and layout to a degree.
But, when getting this ‘String’ values, obviously one will loose alot, and the HTML tags are inserted as text.
Not really to big worry, since I can apply template document styles again, but now with things like formatting where a picture was inserted, it becomes tricky.
Hope this makes sence. The above solutions will help to a degree, atleast to get a string like:
this is a sentence
to have word actually print this in bold etc.