Skip to content

Instantly share code, notes, and snippets.

@sohail-aspose
sohail-aspose / Converting-Presentation-to-Password-Protected-PDF.java
Created May 10, 2016 12:22
Converting Presentation to Password Protected PDF
//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
@sohail-aspose
sohail-aspose / Converting-Presentation-to-PDF-using-Custom-Options.java
Last active May 10, 2016 12:20
Converting Presentation to PDF using Custom Options
//Instantiate a Presentation object that represents a presentation file
Presentation pres = new Presentation("demo.pptx");
//Instantiate the PdfOptions class
PdfOptions opts = new PdfOptions();
//Set Jpeg Quality
opts.setJpegQuality ((byte) 90);
//Define behavior for metafiles
@sohail-aspose
sohail-aspose / Converting-Presentation-to-PDF-using-the-Default-Options.java
Created May 10, 2016 12:16
Converting Presentation to PDF using the Default Options
//Instantiate a Presentation object that represents a presentation file
Presentation pres = new Presentation("demo.pptx");
//Save the presentation to PDF with default options
pres.save("demoDefault.pdf", SaveFormat.Pdf);
@sohail-aspose
sohail-aspose / Converting-PPT-Presentation-to-PPTX-Presentation.java
Created May 10, 2016 10:10
Converting PPT Presentation to PPTX Presentation
//Instantiate a Presentation object that represents a PPTX file
Presentation pres = new Presentation("Aspose.ppt");
//Saving the PPTX presentation to PPTX format
pres.save("Aspose.pptx",SaveFormat.Pptx);