The .NET Interface makes it possible for Docx to HTML V2.0 to function through .NET applications developed using Visual Basic.NET, Visual C#.NET and similar programs.
Windows version
Linux version
CAUTION: | You cannot have both Docx to HTML V2.0 and another version of Docx to HTML installed on your machine when the NET interface is used. It is necessary to uninstall one version, or only set the path of Docx to HTML you want to use by deleting the unwanted path from the environment variables. |
---|
Docx to HTML .NET component is not registered automatically to the global assembly cache (GAC). It is necessary to create the path either by putting the .NET component in the current folder of the application, or by creating an application configuration file.
.NET Component File Name | for .NET 8 | DhcDotNetMCtl20.dll |
---|
The following classes are contained in the .NET component:
Name | Functions |
---|---|
DhcObj | Docx to HTML V2.0 class (itself). DhcObj Example for C# DhcObj adhc = new();
try {
// some process
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
|
DhcObj Class provides the following methods:
Name | Return Value | Arguments | Functions |
---|---|---|---|
execute | None | None | Executes the conversion and outputs to the destination specified in setDocumentURI . |
setDocumentURI | None | newVal : string | Specify the input file name.
|
setOutputFilePath | None | newVal : string | Specify the output file name.
|
clrSettings | None | None | Clears option settings. |
lodeSettings | None | newVal : string | Loads specified option setting file.
|
setEnableXHTML | None | newVal : bool | Specifies the grammar for tag output.
|
setViewportContent | None | content : string | Specifies to output the meta tag in the following format in the <head>. <meta name="viewport" content=" Content specified in ‘content’">
|
setEnableENDL | None | newVal : bool | Specifies whether to output a line break at the end of the block tag.
|
setEnableEmptyParagraph | None | newVal : bool | blank lines (lines with line breaks only) in Word.
|
setEnableNonRefId | None | newVal : bool | While editing in Word, a lot of IDs that are not internally deleted may be created. Specifies whether these internally unreferenced IDs should be removed in HTML output. |
setEnableImgWidth | None | newVal : bool | Specifies whether to output the width of the image.
|
setEnableHeadingStrong | None | newVal : bool | Specifies whether to ignore the emphasis specified in the heading style.
|
setEnableEmbedimage | None | newVal : bool | Specifies whether to embed the image in the body HTML as a data URL.
|
setEnableMathML | None | newVal : bool | Specifies whether to output to <img> tags in MathML format for formulas edited in the Word Equation Editor.
|
setXmlMathML | None | newVal : bool | Specifies whether to output to MathML formatted markup for formulas edited in the Word Equation Editor.
|
setOMath | None | newVal : bool | Specifies whether to output to Word's own Office Math format for formulas edited in the Word Equation Editor.
|
setThroughImage | None | newVal : bool | Specifies whether to output the image in its original format inserted into Word.
|
setEnablePStyle | None | newVal : bool | Specifies whether to output the style name of the paragraph by setting it as the value of the class attribute.
|
setEnableCitation | None | newVal : bool | Specifies whether to outputs the value of tag in the Citation field by setting it as the value of the href attribute of the <a> tag.
|
setTextColor | None | newVal : bool | Specifies whether to outputs the color specified for the text as <span style="color:color value">.
|
setItalic | None | newVal : int | Specifies the output method when italics are specified for text.
|
setUnderline | None | newVal : int | Specifies the output method when underline is specified for text.
|
setLinethrough | None | newVal : int | Specifies the output method when strikethrough is specified for text.
|
setEncoding | None | newVal : string | Specifies the character code (encoding method) of the HTML file. (default : "UTF-8")
|
setDefstyle | None | newVal : bool | Specifies whether to output the <style> element (element specifying the default CSS style) in <head>.
|
setSpaceIndent | None | newVal : bool | Specifies whether to convert the indentation to a a single full-width space when one or more characters of indentation are specified at the beginning of the paragraph.
|
setOutputBR | None | newVal : bool | Specifies whether to output <br> tags at the end of paragraphs instead of enclosing them in <p> tags. It is invalid when XML grammar is specified in tag output.
|
setFileimages | None | newVal : bool | Specifies how to name the folder that stores image files.
|
setCSS | None | uri : string media : string |
Specifies the CSS file to link.
|
setJS | None | newVal : string | Place the script tag in <head> and specify the path (URL) of the JavaScript file in its src attribute.
|
saveSettings | None | newVal : string | Specify the path of the option setting file. |
setTablestyle | None | newVal : bool | Specifies whether to output the table-style.
|
setSplit | None | newVal : int | You can specify the outline level at which HTML <section> (or <div class=‘section-area’>) tags are output.
|
setEnableTocout | None | newVal : bool | When "setSplit" is called, the table of contents inserted by the Word table of contents function is output as a separate HTML file (inc-toc.html). The inc-toc.html file can be included in the split HTML file using JavaScript. inc-toc.html does not output tags such as <head> and <body> other than the tags for the table of contents. Please refer to the following web page for a sample of how to include a table of contents using JavaScript. https://www.antennahouse.com/html-on-word-samples
|
setPagenavi | None | newVal : string | You can specify the outline level at which HTML <section> (or <div class=‘section-area’>) tags are output.
|
setLang | None | newVal : string | You can specify the language (lang attribute) to be output in the <html> tag of the output HTML file.
|
setSection | None | newVal : int | You can specify the outline level at which HTML <section> (or <div class=‘section-area’>) tags are output.
|
setEndnoteId | None | newVal : bool | When inserting endnotes in a Word document, if the start number of the sequential number of the endnote is set to a number other than ‘1’, you can match the number of the endnote character (<sup> tag) in the output HTML and the number used at the end of the ‘id’ specifying the endnote.
|
setFootnote | None | newVal : int | Specifies how footnotes are output to html when they are present in a Word document.
|
setCustomSep | None | newVal : bool | If footnotes and endnotes are inserted, specifies the boundaries with the body text.
|
[Install directory]/samples/dotnet includes simple sample programs.
To run this sample program in the [Working directory], do the following:
Copy the directory under samples to [Working directory]. At this time, copy the DhcDotNetMCtl20.dll to the [Working directory]/samples/dotnet.