Export: HTML
Use GetHTML() to obtain an HTML string, or SaveAsHTML(path) to write a standalone HTML file with embedded CSS that mirrors the document's visual appearance.
C#
1using Vega;
2
3var doc = VDocs.OpenFromWord("report.docx");
4doc.LicensePath = "license.vegalic";
5
6// As a string
7string html = doc.GetHTML();
8File.WriteAllText("report.html", html);
9
10// Directly to disk
11doc.SaveAsHTML("report.html");
Related API
Frequently asked questions
Is the HTML self-contained?
Yes — CSS is embedded in the output so the file can be opened standalone in a browser.
Can I embed the HTML in my own page?
Yes — use GetHTML() and insert the returned string (or a subset of it) into your own template.