GroupDocs.Conversion provides WebConvertOptions to give you control over conversion result. The following options could be set:
FixedLayout controls the HTML generation. If it’s set to true, fixed layout will be used e.g. absolutely positioned HTML element.
FixedLayoutShowBorders controls the display of page borders during fixed layout conversion. Default is true.
EmbedFontResources specifies whether to embed font resources within the main HTML. Default is false. Note: fonts automatically embed when FixedLayout is enabled.
Zoom specifies the zoom level in percentage. The default value is 100.
UsePdf. Sometimes, for better rendering and elements positioning the source document should be converted to PDF first. If this property is set to true, the input firstly is converted to PDF and after that to desired format.
The following code snippet shows how to convert to HTML with advanced options
Control whether font resources are embedded within the HTML file:
using(Converterconverter=newConverter("sample.docx")){WebConvertOptionsoptions=newWebConvertOptions{EmbedFontResources=true// Embed fonts directly in HTML};converter.Convert("embedded-fonts.html",options);}
When EmbedFontResources is set to false (default), font files are stored separately and referenced by the HTML file. When set to true, all font data is embedded directly within the HTML file, making it self-contained but larger in size.
Note: When FixedLayout is enabled, fonts are automatically embedded regardless of the EmbedFontResources setting.
Control page borders visibility
The following code snippet shows how to convert to HTML and control page borders visibility