Load Note document with options

GroupDocs.Conversion provides NoteLoadOptions to give you control over how the source Note document will be processed. The following options could be set:

OptionDescription
DefaultFontA default font for Note document. The specified font will be used if a font is missing. An absolute path to the font file must be provided.
FontSubstitutesSubstitutes specific fonts from the Note document.
Password  A password to unlock the protected document.

Set Default Font

GroupDocs.Conversion for .NET allows you to set a default font name when a font is not available in the document. You can use DefaultFont property of NoteLoadOptions class to set the default font name. In case DefaultFont is not set the Times New Roman font will be used. The following code snippet shows how to set a default font name when converting from Note into to PDF document:

With v24.10 and later:

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new NoteLoadOptions
{
    DefaultFont = "Helvetica"
};
using (Converter converter = new Converter("sample.one", getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("converted.pdf", options);
}

Before v24.10:

Func<LoadOptions> getLoadOptions = () => new NoteLoadOptions
{
    DefaultFont = "Helvetica"
};
using (Converter converter = new Converter("sample.one", getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("converted.pdf", options);
}

Specify font substitution

The following code snippet shows how to convert Note document and specify font substitution for missing fonts:

With v24.10 and later:

Func<LoadContext, LoadOptions> getLoadOptions = loadContext => new NoteLoadOptions
{
    FontSubstitutes = new List<FontSubstitute>
    {
        FontSubstitute.Create("Tahoma", "Arial"),
        FontSubstitute.Create("Times New Roman", "Arial"),
    }
};
using (Converter converter = new Converter("sample.one", getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("converted.pdf", options);
}

Before v24.10:

Func<LoadOptions> getLoadOptions = () => new NoteLoadOptions
{
    FontSubstitutes = new List<FontSubstitute>
    {
        FontSubstitute.Create("Tahoma", "Arial"),
        FontSubstitute.Create("Times New Roman", "Arial"),
    }
};
using (Converter converter = new Converter("sample.one", getLoadOptions))
{
    PdfConvertOptions options = new PdfConvertOptions();
    converter.Convert("converted.pdf", options);
}