Load Note document with options

View as MarkdownMarkdown

Set up your AI agent

Give your coding agent live access to the GroupDocs documentation and API reference through the GroupDocs Docs MCP server — no install, no API key. Learn more

claude mcp add --transport http groupdocs-docs https://docs.groupdocs.com/mcp

Also process documents locally

The GroupDocs.Conversion MCP server lets your agent work with files on your machine; they are never uploaded. It needs the .NET 10 SDK or Docker.

claude mcp add groupdocs-conversion -- dnx GroupDocs.Conversion.Mcp --yes
Folders, licensing and more →

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

  • setDefaultFont specifies a default font for Note document. The specified font will be used if a font is missing.
  • setFontSubstitutes specifies substitutes specific fonts from the Note document.
  • setPassword specifies a password to unlock the protected document.

Specify font substitution

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

const java = require('java')

const outputPath = "convertNoteBySpecifyingFontSubstitution.pdf"

const fontSubstitutes = java.newInstanceSync("java.util.ArrayList")
fontSubstitutes.add(groupdocs.conversion.FontSubstitute.create("Tahoma", "Arial"));
fontSubstitutes.add(groupdocs.conversion.FontSubstitute.create("Times New Roman", "Arial"));

const loadOptions = new groupdocs.conversion.NoteLoadOptions();
loadOptions.setFontSubstitutes(fontSubstitutes);

const converter = new groupdocs.conversion.Converter("sample.one", loadOptions)
const convertOptions = new groupdocs.conversion.PdfConvertOptions()

console.log(`Note document converted successfully to ${outputPath} (specifying font subs)`)
converter.convert(outputPath, convertOptions)