Created
December 28, 2019 09:30
-
-
Save aspose-com-gists/bcc4f993d6b75479636e621002468f35 to your computer and use it in GitHub Desktop.
Aspose.Slide for Java - PowerPoint to PDF Conversion Blog
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
// Instantiate a Presentation object that represents a presentation file | |
Presentation pres = new Presentation("demo.pptx"); | |
// Instantiate the PdfOptions class | |
PdfOptions opts = new PdfOptions(); | |
// Setting PDF password | |
opts.setPassword("password"); | |
// Save the presentation to password protected PDF | |
pres.save("output.pdf", SaveFormat.Pdf, opts); |
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
// Create PDF options | |
PdfOptions pdfOptions = new PdfOptions(); | |
// Set password | |
pdfOptions.setPassword("my_password"); | |
// Set access permissions | |
pdfOptions.setAccessPermissions(PdfAccessPermissions.PrintDocument| PdfAccessPermissions.HighQualityPrint); | |
// Load PowerPoint presentation | |
Presentation presentation = new Presentation("Presentation.pptx"); | |
try { | |
presentation.save("output.pdf", SaveFormat.Pdf, pdfOptions); | |
} finally { | |
if (presentation != null) presentation.dispose(); | |
} |
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
// Instantiate a Presentation object that represents a presentation file | |
Presentation pres = new Presentation("presentation.pptx"); | |
// Instantiate the PdfOptions class | |
PdfOptions opts = new PdfOptions(); | |
// Set JPEG Quality | |
opts.setJpegQuality((byte) 90); | |
// Define behavior for Metafiles | |
opts.setSaveMetafilesAsPng(true); | |
// Set Text Compression level | |
opts.setTextCompression(PdfTextCompression.Flate); | |
// Define the PDF standard | |
opts.setCompliance(PdfCompliance.Pdf15); | |
INotesCommentsLayoutingOptions options = opts.getNotesCommentsLayouting(); | |
options.setNotesPosition(NotesPositions.BottomFull); | |
// Save the presentation to PDF with specified options | |
pres.save("output.pdf", SaveFormat.Pdf, opts); |
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
// Instantiate a Presentation object that represents a presentation file | |
Presentation pres = new Presentation("presentation.pptx"); | |
// Save the presentation to PDF with default options | |
pres.save("output.pdf", SaveFormat.Pdf); |
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
// Instantiate a Presentation object that represents a presentation file | |
Presentation pres = new Presentation("presentation.pptx"); | |
// Setting array of slides positions | |
int[] slides = new int[] { 2, 3, 5 }; | |
// Save the presentation to PDF | |
pres.save("output.pdf", slides, SaveFormat.Pdf); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment