Working with EditableDocument

EditableDocument class represents an input document of any supportable format, that was converted to internal intermediate format in accordance to edit options and is ready for editing in HTML WYSIWYG editors. For doing this an EditableDocument contains a plenty of methods for emitting HTML markup, stylesheets and resources with different settings.

EditableDocument class is able to emit HTML markup in different forms: whole document with header, only BODY content, with tuned external links for images, fonts and stylesheets, or even all-embedded version, where whole HTML document with all resources is presented as a single string.

For some WYSIWYG editors for loading HTML content into them, it is necessary to specify this content via file path. Or user may need to save document as HTML to disk instead of passing it to the WYSIWYG editor. For such cases EditableDocument class has ability to save its content to disk as ordinary HTML document, that is represented with *.html file and accompanying folder with resources (images, stylesheets, fonts).

When input document of some format is converted to EditableDocument and then to HTML document, this HTML document contains not only HTML markup, but also one or more stylesheets, maybe images and sometimes even fonts. All of these are called resourcesEditableDocument has several methods and properties for working especially with them.

Opening document for edit implies creating instances of EditableDocument class, which are returned from the Editor.Edit() method. However, when HTML content of the document was sent to the WYSIWYG HTML-editor and edited by the end-user, in order to save it back to output format user firstly need to create new instance of EditableDocument class. For achieving this EditableDocument class has three static methods, that allows to create instances from HTML documents, saved on disk (as *.html file with resource folder), in memory (as HTML markup with resource classes), or emitted directly by WYSIWYG HTML-editor (as inner-BODY HTML markup an resource folder).