For more details, please visit Print OneNote .one Notebook Programmatically using Java
Last active
December 23, 2021 06:08
-
-
Save aspose-com-gists/bb076338de32dba29b0a50e9a6b64b17 to your computer and use it in GitHub Desktop.
Print OneNote .one file Programmatically using Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load input OneNote file with the Document class. | |
Document document = new Document("Aspose.one"); | |
// Print first and second pages using Microsoft XPS Document Writer | |
final DocumentPrintAttributeSet asposeAttr = new DocumentPrintAttributeSet("Microsoft XPS Document Writer"); | |
asposeAttr.setPrintRange(1, 2); | |
// Print the OneNote file | |
document.print(asposeAttr); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Prints 3 copies of first and second pages using virtual pdf printer doPDF 8 | |
//It is free and can be downloaded here http://www.dopdf.com/download.php | |
// Load input OneNote file | |
Document doc = new Document("test.one"); | |
// Specify the virtual printer and properties | |
final DocumentPrintAttributeSet asposeAttr = new DocumentPrintAttributeSet("doPDF 8"); | |
asposeAttr.setPrintRange(1, 2); | |
asposeAttr.setCopies(3); | |
// Set printer settings with PrintOptions | |
PrintOptions printOptions = new PrintOptions(); | |
printOptions.setDocumentName("Test.one"); | |
printOptions.setPrinterSettings(asposeAttr); | |
// Print the OneNote file to virtual printer | |
doc.print(printOptions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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