EditableDocumentFromBodyMarkupAndResourceFolder Method |
Namespace: GroupDocs.Editor
public static EditableDocument FromBodyMarkupAndResourceFolder( string htmlBodyContent, string resourceFolderPath )
In general a well-formed HTML document contains an HTML Document Definition (DOCTYPE) and a root HTML element, that, in turn, has two and only two children: HEAD (with document meta-information) and a BODY (with document content). All stylesheets are included and/or embedded in the HEAD element (LINK and/or STYLE elements respectively), and are 'used by' content markup (by using 'class' and 'id' attributes, in most cases).
However, most of client-side WYSIWYG HTML-editors like TinyMCE and CKEditor are working only with inner content of BODY element: they can obtain only such markup on input and produce such markup on output. For passing a HTML->BODY markup into the HTML-editor there is a GetBodyContent method. And, in counterpart, for obtaining HTML markup from HTML-editor this method exists.
First string parameter obtains an inner content of HTML->BODY element, while 2nd parameter — resourceFolderPath — is a full path to the existing folder, that contains all HTML resources, used by HTML markup. GroupDocs.Editor will scan this folder and include all valid *.css files as stylesheets for the document.