Get Started
Plugins
Macros
More information

window.Asc.plugin.executeMethod ("ConvertDocument", [args], callback)

Description

Defines the method that allows converting a document to Markdown or HTML text.

Usage

This method should be used in the following way:

window.Asc.plugin.executeMethod ("ConvertDocument", [sConvertType, bHtmlHeadings, bBase64img, bDemoteHeadings, bRenderHTMLTags]);
Parameters
Parameter Description Type Example
sConvertType Conversion type ("markdown" or "html"). string "markdown"
bHtmlHeadings Defines if the HTML headings and IDs will be generated when the Markdown renderer of your target platform does not handle Markdown-style IDs. boolean false
bBase64img Defines if the images will be created in the base64 format. boolean false
bDemoteHeadings Defines if all heading levels in your document will be demoted to conform with the following standard: single H1 as title, H2 as top-level heading in the text body. boolean true
bRenderHTMLTags Defines if HTML tags will be preserved in your Markdown. If you just want to use an occasional HTML tag, you can avoid using the opening angle bracket in the following way: \<tag>text\</tag>. By default, the opening angle brackets will be replaced with the special characters. boolean false
Returns

The method returns the Markdown/HTML text in the string format.

Example
window.Asc.plugin.executeMethod("ConvertDocument", ["markdown", false, false, true, false]);