Load Note document with options

This documentation explains how to load Note documents, such as OneNote files, using GroupDocs.Conversion for Java with NoteLoadOptions class. The API allows developers to specify parameters for processing Note documents, including page ranges and rendering settings, enabling precise control over conversion to formats like PDF, PNG, or DOCX. The following options could be set:

OptionDescription
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:

import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.contracts.FontSubstitute;
import com.groupdocs.conversion.options.convert.WordProcessingConvertOptions;
import com.groupdocs.conversion.options.load.NoteLoadOptions;
import java.util.ArrayList;
import java.util.List;

public class ConvertNoteBySpecifyingFontSubstitution {
    public static void convert() {
        NoteLoadOptions loadOptions =  new NoteLoadOptions();

        List<FontSubstitute> fontSubstitutes = new ArrayList<FontSubstitute>();
        fontSubstitutes.add(FontSubstitute.create("Calibri", "Arial"));
        fontSubstitutes.add(FontSubstitute.create("Times New Roman", "Arial"));

        loadOptions.setFontSubstitutes(fontSubstitutes);

        try(Converter converter = new Converter("sample.one", () -> loadOptions)) {
            PdfConvertOptions options = new PdfConvertOptions();
            converter.convert("converted_with_font_substitution.pdf", options);
        }
    }

    public static void main(String[] args){
        convert();
    }
}

sample.one is sample file used in this example. Click here to download it.

converted_with_font_substitution.pdf is converted PDF document. Click here to download it.