public class PDFEncryptionParams extends Object
Constructor and Description |
---|
PDFEncryptionParams()
Default constructor initializing to default values.
|
PDFEncryptionParams(PDFEncryptionParams source)
Creates a copy of the given encryption parameters.
|
PDFEncryptionParams(String userPassword,
String ownerPassword,
boolean allowPrint,
boolean allowCopyContent,
boolean allowEditContent,
boolean allowEditAnnotations,
boolean encryptMetadata)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
encryptMetadata()
Indicates whether Metadata should be encrypted.
|
int |
getEncryptionLengthInBits()
Returns the encryption length.
|
String |
getOwnerPassword()
Returns the owner password.
|
String |
getUserPassword()
Returns the user password.
|
boolean |
isAllowAccessContent()
Indicates whether revision 3 extracting text and graphics is allowed.
|
boolean |
isAllowAssembleDocument()
Indicates whether revision 3 assembling document is allowed.
|
boolean |
isAllowCopyContent()
Indicates whether copying content is allowed.
|
boolean |
isAllowEditAnnotations()
Indicates whether editing annotations is allowed.
|
boolean |
isAllowEditContent()
Indicates whether editing content is allowed.
|
boolean |
isAllowFillInForms()
Indicates whether revision 3 filling in forms is allowed.
|
boolean |
isAllowPrint()
Indicates whether printing is allowed.
|
boolean |
isAllowPrintHq()
Indicates whether revision 3 printing to high quality is allowed.
|
void |
setAllowAccessContent(boolean allowAccessContent)
Sets whether revision 3 extracting text and graphics is allowed.
|
void |
setAllowAssembleDocument(boolean allowAssembleDocument)
Sets whether revision 3 assembling document is allowed.
|
void |
setAllowCopyContent(boolean allowCopyContent)
Sets the permission for copying content.
|
void |
setAllowEditAnnotations(boolean allowEditAnnotations)
Sets the permission for editing annotations.
|
void |
setAllowEditContent(boolean allowEditContent)
Sets the permission for editing content.
|
void |
setAllowFillInForms(boolean allowFillInForms)
Sets whether revision 3 filling in forms is allowed.
|
void |
setAllowPrint(boolean allowPrint)
Sets the permission for printing.
|
void |
setAllowPrintHq(boolean allowPrintHq)
Sets whether revision 3 printing to high quality is allowed.
|
void |
setEncryptionLengthInBits(int encryptionLength)
Sets the encryption length.
|
void |
setEncryptMetadata(boolean encryptMetadata)
Whether the Metadata should be encrypted or not; default is true;
|
void |
setOwnerPassword(String ownerPassword)
Sets the owner password.
|
void |
setUserPassword(String userPassword)
Sets the user password.
|
String |
toString() |
public PDFEncryptionParams(String userPassword, String ownerPassword, boolean allowPrint, boolean allowCopyContent, boolean allowEditContent, boolean allowEditAnnotations, boolean encryptMetadata)
userPassword
- the user passwordownerPassword
- the owner passwordallowPrint
- true if printing is allowedallowCopyContent
- true if copying content is allowedallowEditContent
- true if editing content is allowedallowEditAnnotations
- true if editing annotations is allowedpublic PDFEncryptionParams()
public PDFEncryptionParams(PDFEncryptionParams source)
source
- source encryption parameterspublic boolean isAllowCopyContent()
public boolean isAllowEditAnnotations()
public boolean isAllowEditContent()
public boolean isAllowPrint()
public boolean isAllowFillInForms()
public boolean isAllowAccessContent()
public boolean isAllowAssembleDocument()
public boolean isAllowPrintHq()
public boolean encryptMetadata()
public String getOwnerPassword()
public String getUserPassword()
public void setAllowCopyContent(boolean allowCopyContent)
allowCopyContent
- true if copying content is allowedpublic void setAllowEditAnnotations(boolean allowEditAnnotations)
allowEditAnnotations
- true if editing annotations is allowedpublic void setAllowEditContent(boolean allowEditContent)
allowEditContent
- true if editing annotations is allowedpublic void setAllowPrint(boolean allowPrint)
allowPrint
- true if printing is allowedpublic void setAllowFillInForms(boolean allowFillInForms)
allowFillInForms
- true if revision 3 filling in forms is allowed.public void setAllowAccessContent(boolean allowAccessContent)
allowAccessContent
- true if revision 3 extracting text and graphics is allowedpublic void setAllowAssembleDocument(boolean allowAssembleDocument)
allowAssembleDocument
- true if revision 3 assembling document is allowedpublic void setAllowPrintHq(boolean allowPrintHq)
allowPrintHq
- true if revision 3 printing to high quality is allowedpublic void setEncryptMetadata(boolean encryptMetadata)
encryptMetadata
- true or falsepublic void setOwnerPassword(String ownerPassword)
ownerPassword
- The owner password to set, null or an empty String
if no password is applicablepublic void setUserPassword(String userPassword)
userPassword
- The user password to set, null or an empty String
if no password is applicablepublic int getEncryptionLengthInBits()
public void setEncryptionLengthInBits(int encryptionLength)
encryptionLength
- the encryption lengthCopyright © 2025 Apache Software Foundation. All rights reserved.