Hello team,
I am facing issue while unlocking the ppt or pptx files using Aspose.Slide Android via java version - 19.8.
Please help me out.
I am following the document Opening a Password Protected Presentation
I have observed your requirements and request you to please share the details of issue incurring on your end along with source presentation and password for the file. Please share the requested details so that we may proceed further to help you out.
When I debug the code, their is no issue while executing code so I am not able to share the details of issue. Additionally, I am sharing the code & file below :
com.aspose.slides.LoadOptions loadOptions = new com.aspose.slides.LoadOptions();
loadOptions.setPassword("123");
Presentation presentation = new Presentation("inputFilePath",loadOptions);
presentation.save("outputFilePath", presentation.getSourceFormat());
slide_templates_20_protected.zip (759.5 KB)
I have worked with source file and sample code shared by you and able to open the presentation using Aspose.Slides for Java 19.9. To check and make sure that presentation opened successfully, please use following code snippet on your end.
// Printing the total number of slides present in the presentation
System.out.println(pres.getSlides().size());
2019-09-20 14_05_34-TestAsposeJava - NetBeans IDE 8.2.png (3.0 KB)
Yes, you are correct
com.aspose.slides.LoadOptions loadOptions = new com.aspose.slides.LoadOptions();
loadOptions.setPassword("123");
Presentation presentation = new Presentation("inputFilePath",loadOptions);
presentation.save("outputFilePath", presentation.getSourceFormat());
System.out.println("PAGES_COUNT "+presentation.getSlides().size());
It is working with Aspose.Slides for Android via java 19.9.
But Please try one more line at the end of above code
System.out.println("Is OutputFile Encrypted "+com.aspose.slides.PresentationFactory.getInstance().getPresentationInfo("outputFilePath").isEncrypted());
Never mind, I got the issue and resolved it now.
I was not decrypting the file before.
presentation.getProtectionManager().removeEncryption();
Thanks for the help
Using the above way, I am decrypting the above shared file and It is taking about 80 sec to decrypt and save a file of 785kb, What if I use a larger file around 250MB or more, It will take more time. Is there any way to reduce this time?
I like to share that the amount of time take to load the presentation in DOM of Aspose.Slides depends upon many factors including number of slides, amount of content/shapes inside slides especially multimedia content and size of presentation. 250 MB presentation is considered to be a huge presentation and will take time to load in DOM of Aspose.Slides.