We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Words export HTML as read only

I’m currently converting Word documents that contain form fields to HTML for display on a web based application. The issue I run into is that I want a read only version of the HTML as to not confuse the user that editing this HTML does not change the underlying document. After a quick glance at the documentation, I saw that read only is an option for XLS, Doc, Pdf documents and not an HTML export. Is this true? Can I force the HTML to be read only?

Thanks for any help,

Hi Troy,

Thanks for your inquiry. Sure, you can achieve this by saving your Word document in the HTML format using absolutely positioned elements as follows:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

String[] items = { “One”, “Two”, “Three” };
builder.insertComboBox(“DropDown”, items, 0);
builder.insertCheckBox(“CBX”, true, 0);

doc.save(“C:\Temp\outFixed.html”, SaveFormat.HTML_FIXED);

I hope, this helps.

Best regards,