Specify encoding when loading documents

You can specify the encoding using LoadOptions.

This feature is supported for the following documents:

The following code snippet shows how to specify the document encoding:

// Specify an encoding.
LoadOptions loadOptions = new LoadOptions();
loadOptions.Encoding = Encoding.GetEncoding("shift_jis");
// Render a file.
using (Viewer viewer = new Viewer("sample.txt", loadOptions))
    HtmlViewOptions viewOptions = HtmlViewOptions.ForEmbeddedResources();