Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Created November 3, 2025 20:22
Show Gist options
  • Select an option

  • Save aspose-com-gists/089c7d0c0df61d118359f6d1ca56b046 to your computer and use it in GitHub Desktop.

Select an option

Save aspose-com-gists/089c7d0c0df61d118359f6d1ca56b046 to your computer and use it in GitHub Desktop.
Export Powerpoint Notes to Pdf in Java
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