Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

E-iceblue Product Family
E-iceblue Product Family

Posted on

     

Protect presentation slides in Java

With the help ofFree Spire.Presentation for Java, developers can protect the PowerPoint files with password or only allow the presentation slides to be read only, readers could not edit or change the contents on the slides. This article will show you how to protect the presentation slides in Java applications from the following three parts:

  • Encrypt the presentation slides
  • Set the presentation slides read only
  • Load an encrypted PowerPoint document and update its password

Encrypt PowerPoint file. Users have to enter the password to open and view the presentation slides.

Presentationpresentation=newPresentation();presentation.loadFromFile("Sample.pptx");presentation.encrypt("e-iceblue");presentation.saveToFile("output/Encrypted.pptx",FileFormat.PPTX_2010);

Set the presentation slides read only. Users can read the presentation slides without the password. If they want to edit the presentation, it is impossible. The presentation slides have been set as read only.

Presentationpresentation=newPresentation();presentation.loadFromFile("Sample.pptx");presentation.protect("123456");presentation.saveToFile("output/Readonly.pptx",FileFormat.PPTX_2010);

Modify the password of the protected PowerPoint document. Update the existing password.

Presentationpresentation=newPresentation();//load the encrypted document with passwordpresentation.loadFromFile("Encrypted.pptx",FileFormat.PPTX_2010,"e-iceblue");//Remove the Encryptionpresentation.removeEncryption();//Set the new password to encrypt the documentpresentation.encrypt("Newpass");presentation.saveToFile("output/Modifypass.pptx",FileFormat.PPTX_2010);

Top comments(0)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Your Office Development Master
  • Location
    Chengdu, SiChuan, China
  • Work
    Dev at E-iceblue
  • Joined

More fromE-iceblue Product Family

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp