HtmlLoadOptions.SupportFontFaceRules

HtmlLoadOptions SupportFontFaceRules property. Gets or sets a value indicating whether to support fontface rules and whether to load declared fonts. Default value is false.

HtmlLoadOptions.SupportFontFaceRules property

Gets or sets a value indicating whether to support @font-face rules and whether to load declared fonts. Default value is false.

public bool SupportFontFaceRules { get; set; }

Remarks

If this option is enabled, fonts declared in @font-face rules are loaded and embedded into the resulting document’s font definitions. This makes the loaded fonts available for rendering.

Supported font formats are TTF, EOT, and WOFF.

@font-face rules are not supported when loading SVG images.

Examples

Shows how to load declared font-face rules.

HtmlLoadOptions htmlLoadOptions = new HtmlLoadOptions();
htmlLoadOptions.SupportFontFaceRules = true;

Converter.Create()
    .From(MyDir+ "Html with FontFace.html", htmlLoadOptions)
    .To(ArtifactsDir + "HtmlLoadOptions.PreferredControlType.pdf")
    .Execute();

See Also