Skip to content

Commit c6afa39

Browse files
committedApr 1, 2016
Merge pull request #17 from shoaibkhan-aspose/master
Aspose.Slides Java for pptx4j - Comparison Examples - v1.2
2 parents 7ffb5a5 + c010519 commit c6afa39

File tree

123 files changed

+3471
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+3471
-1
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package asposefeatures.security.applypasswordprotection.java;
2+
3+
import com.aspose.slides.Presentation;
4+
5+
public class AsposeApplyPasswordProtection
6+
{
7+
public static void main(String[] args)
8+
{
9+
String dataPath = "src/asposefeatures/security/applypasswordprotection/data/";
10+
11+
//Instantiate a Presentation object that represents a PPT file
12+
Presentation pres = new Presentation();
13+
14+
//....do some work here.....
15+
16+
//Setting Password
17+
pres.getProtectionManager().encrypt("pass");
18+
19+
//Save your presentation to a file
20+
pres.save(dataPath + "AsposeProtection_Out.pptx", com.aspose.slides.SaveFormat.Pptx);
21+
22+
//Printing the status
23+
System.out.println("Protection Applied successfully!");
24+
}
25+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package asposefeatures.security.applyprotectionwithproperties.java;
2+
3+
import com.aspose.slides.Presentation;
4+
5+
public class AsposeApplyProtectionwithPropertiesAccess
6+
{
7+
public static void main(String[] args)
8+
{
9+
String dataPath = "src/asposefeatures/security/applyprotectionwithproperties/data/";
10+
11+
//Instantiate a Presentation object that represents a PPT file
12+
Presentation pres = new Presentation();
13+
14+
//....do some work here.....
15+
16+
//Setting access to document properties in password protected mode
17+
pres.getProtectionManager().setEncryptDocumentProperties ( false);
18+
19+
//Setting Password
20+
pres.getProtectionManager().encrypt("pass");
21+
22+
//Save your presentation to a file
23+
pres.save(dataPath + "AsposeProtection-PropAccess_Out.pptx", com.aspose.slides.SaveFormat.Pptx);
24+
25+
//Printing the status
26+
System.out.println("Protection Applied successfully!");
27+
}
28+
}

0 commit comments

Comments
 (0)