Created
November 3, 2025 20:22
-
-
Save aspose-com-gists/089c7d0c0df61d118359f6d1ca56b046 to your computer and use it in GitHub Desktop.
Export Powerpoint Notes to Pdf in Java
This file contains hidden or 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
| package com.example; | |
| import com.aspose.slides.*; | |
| public class main { | |
| public static void main(String[] args) { | |
| String dataDir = "data"; | |
| License lic = new License(); | |
| lic.setLicense("license.lic"); | |
| // Instantiate a Presentation object that represents a presentation file and | |
| // load the source PPTX/PPT file. | |
| Presentation presentation = new Presentation(dataDir + "NotesFile.pptx"); | |
| try { | |
| // Create an instance of the PdfOptions class. | |
| PdfOptions pdfOptions = new PdfOptions(); | |
| // Instantiate an instance of the NotesCommentsLayoutingOptions class. | |
| NotesCommentsLayoutingOptions options = | |
| new NotesCommentsLayoutingOptions(); | |
| // Call the setNotesPosition method to set the position of the notes on | |
| // the page. | |
| options.setNotesPosition(NotesPositions.BottomFull); | |
| // Set the mode in which slides are placed on the page when exporting a | |
| // presentation by calling the setSlidesLayoutOptions method. | |
| pdfOptions.setSlidesLayoutOptions(options); | |
| // Saving the presentation to PDF notes by calling the save method. | |
| presentation.save( | |
| dataDir + "Pdf_Notes_out.pdf", SaveFormat.Pdf, pdfOptions); | |
| } finally { | |
| if (presentation != null) | |
| presentation.dispose(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment