EditableDocumentFromBodyMarkupAndResourceFolder Method |
Static factory, that creates an instance of EditableDocument from a specified HTML markup,
that doesn't contain an HTML header, but only inner markup of HTML BODY element, and from resources, located in the folder, specified by the full path
Namespace: GroupDocs.EditorAssembly: GroupDocs.Editor (in GroupDocs.Editor.dll) Version: 21.1.1.0
Syntaxpublic static EditableDocument FromBodyMarkupAndResourceFolder(
string htmlBodyContent,
string resourceFolderPath
)
Public Shared Function FromBodyMarkupAndResourceFolder (
htmlBodyContent As String,
resourceFolderPath As String
) As EditableDocument
public:
static EditableDocument^ FromBodyMarkupAndResourceFolder(
String^ htmlBodyContent,
String^ resourceFolderPath
)
static member FromBodyMarkupAndResourceFolder :
htmlBodyContent : string *
resourceFolderPath : string -> EditableDocument
Parameters
- htmlBodyContent
- Type: SystemString
String, that contains raw HTML markup, which is located inside HTML->BODY element (without BODY itself),
that should be parsed. Cannot be NULL, empty or invalid. - resourceFolderPath
- Type: SystemString
Mandatory path to the folder with resources. All stylesheets, which are located in this folder, will be used. Cannot be NULL or empty string, and this folder should exists.
Return Value
Type:
EditableDocumentNew non-null instance of EditableDocument
RemarksIn 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.
See Also