Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active December 23, 2021 05:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-com-gists/a7e0cccd09138c14192dbfba211475be to your computer and use it in GitHub Desktop.
Save aspose-com-gists/a7e0cccd09138c14192dbfba211475be to your computer and use it in GitHub Desktop.
Print OneNote .one NoteBook File using C# .NET
// Load input OneNote file with the Document constructor.
Document document = new Document("Aspose.one");
// Specify custom settings for printing
PrinterSettings settings = new PrinterSettings();
settings.PrinterName = "Microsoft Print to PDF";
settings.PrintRange = PrintRange.SomePages;
settings.FromPage = 2;
settings.ToPage = 4;
// Set print options for the OneNote file.
PrintOptions options = new PrintOptions();
options.PrinterSettings = settings;
// Print the OneNote file
document.Print(options);
// Load input OneNote file with the Document constructor.
Document document = new Document("Aspose.one");
// Print the OneNote document.
document.Print();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment