1 17 18 19 20 package org.apache.fop.pdf; 21 22 25 public class PDFEncryptionParams { 26 27 private String userPassword = ""; private String ownerPassword = ""; private boolean allowPrint = true; 30 private boolean allowCopyContent = true; 31 private boolean allowEditContent = true; 32 private boolean allowEditAnnotations = true; 33 34 43 public PDFEncryptionParams(String userPassword, String ownerPassword, 44 boolean allowPrint, 45 boolean allowCopyContent, 46 boolean allowEditContent, 47 boolean allowEditAnnotations) { 48 setUserPassword(userPassword); 49 setOwnerPassword(ownerPassword); 50 setAllowPrint(allowPrint); 51 setAllowCopyContent(allowCopyContent); 52 setAllowEditContent(allowEditContent); 53 setAllowEditAnnotations(allowEditAnnotations); 54 } 55 56 59 public PDFEncryptionParams() { 60 } 62 63 67 public boolean isAllowCopyContent() { 68 return allowCopyContent; 69 } 70 71 75 public boolean isAllowEditAnnotations() { 76 return allowEditAnnotations; 77 } 78 79 83 public boolean isAllowEditContent() { 84 return allowEditContent; 85 } 86 87 91 public boolean isAllowPrint() { 92 return allowPrint; 93 } 94 95 99 public String getOwnerPassword() { 100 return ownerPassword; 101 } 102 103 107 public String getUserPassword() { 108 return userPassword; 109 } 110 111 115 public void setAllowCopyContent(boolean allowCopyContent) { 116 this.allowCopyContent = allowCopyContent; 117 } 118 119 123 public void setAllowEditAnnotations(boolean allowEditAnnotations) { 124 this.allowEditAnnotations = allowEditAnnotations; 125 } 126 127 131 public void setAllowEditContent(boolean allowEditContent) { 132 this.allowEditContent = allowEditContent; 133 } 134 135 139 public void setAllowPrint(boolean allowPrint) { 140 this.allowPrint = allowPrint; 141 } 142 143 148 public void setOwnerPassword(String ownerPassword) { 149 if (ownerPassword == null) { 150 this.ownerPassword = ""; 151 } else { 152 this.ownerPassword = ownerPassword; 153 } 154 } 155 156 161 public void setUserPassword(String userPassword) { 162 if (userPassword == null) { 163 this.userPassword = ""; 164 } else { 165 this.userPassword = userPassword; 166 } 167 } 168 169 } 170 | Popular Tags |