Package com.lowagie.rups.model
Class Permissions
java.lang.Object
com.lowagie.rups.model.Permissions
This class can tell you more about the permissions that are allowed on the PDF file.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
How was the document encrypted?protected boolean
Was the file encrypted?protected byte[]
Which owner password was provided to open the file?protected int
What are the document permissions?protected byte[]
What is the user password? -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the crypto mode.byte[]
Returns the owner password of the PDF file (if any).int
Returns the permissions in the form of an int (each bit is a specific permission)byte[]
Returns the user password (if any).boolean
Tells you if document assembly is allowed.boolean
isAllowCopy
(boolean decrypted) Tells you if copying is allowed.boolean
Tells you if degraded printing is allowed.boolean
Tells you if filling in forms is allowed.boolean
Tells you if modifying annotations is allowedboolean
isAllowModifyContents
(boolean decrypted) Tells you if modifying the contents is allowed.boolean
Tells you if printing is allowed.boolean
Tells you if modifying the layout for screenreaders is allowed.boolean
Tells you if the document was encrypted.void
setCryptoMode
(int cryptoMode) Setter for the crypto modevoid
setEncrypted
(boolean encrypted) Setter for the encrypted variable.void
setOwnerPassword
(byte[] ownerPassword) Setter for the owner password.void
setPermissions
(int permissions) Setter for the permissions.void
setUserPassword
(byte[] userPassword) Setter for the user password.
-
Field Details
-
encrypted
protected boolean encryptedWas the file encrypted? -
ownerPassword
protected byte[] ownerPasswordWhich owner password was provided to open the file? -
userPassword
protected byte[] userPasswordWhat is the user password? -
permissions
protected int permissionsWhat are the document permissions? -
cryptoMode
protected int cryptoModeHow was the document encrypted?
-
-
Constructor Details
-
Permissions
public Permissions()
-
-
Method Details
-
isEncrypted
public boolean isEncrypted()Tells you if the document was encrypted.- Returns:
- true is the document was encrypted
-
setEncrypted
public void setEncrypted(boolean encrypted) Setter for the encrypted variable.- Parameters:
encrypted
- set this to true if the document was encrypted
-
getOwnerPassword
public byte[] getOwnerPassword()Returns the owner password of the PDF file (if any).- Returns:
- the owner password that was provided upon opening the document
-
setOwnerPassword
public void setOwnerPassword(byte[] ownerPassword) Setter for the owner password.- Parameters:
ownerPassword
- the owner password
-
getUserPassword
public byte[] getUserPassword()Returns the user password (if any).- Returns:
- the user password
-
setUserPassword
public void setUserPassword(byte[] userPassword) Setter for the user password.- Parameters:
userPassword
- the user password of a PDF file
-
getPermissions
public int getPermissions()Returns the permissions in the form of an int (each bit is a specific permission)- Returns:
- the value for the permissions
-
setPermissions
public void setPermissions(int permissions) Setter for the permissions.- Parameters:
permissions
- the permissions in the form of an int
-
getCryptoMode
public int getCryptoMode()Returns the crypto mode.- Returns:
- the crypto mode
-
setCryptoMode
public void setCryptoMode(int cryptoMode) Setter for the crypto mode- Parameters:
cryptoMode
- the crypto mode
-
isAllowPrinting
public boolean isAllowPrinting()Tells you if printing is allowed.- Returns:
- true if printing is allowed
-
isAllowModifyContents
public boolean isAllowModifyContents(boolean decrypted) Tells you if modifying the contents is allowed.- Parameters:
decrypted
- Not used, boolean that specifies is the file is decrypted- Returns:
- true if modifying contents is allowed
-
isAllowCopy
public boolean isAllowCopy(boolean decrypted) Tells you if copying is allowed.- Parameters:
decrypted
- Not used, boolean that specifies is the file is decrypted- Returns:
- true if copying is allowed
-
isAllowModifyAnnotations
public boolean isAllowModifyAnnotations()Tells you if modifying annotations is allowed- Returns:
- true if modifying annotations is allowed
-
isAllowFillIn
public boolean isAllowFillIn()Tells you if filling in forms is allowed.- Returns:
- true if filling in forms is allowed
-
isAllowScreenReaders
public boolean isAllowScreenReaders()Tells you if modifying the layout for screenreaders is allowed.- Returns:
- true if modifying the layout for screenreaders is allowed
-
isAllowAssembly
public boolean isAllowAssembly()Tells you if document assembly is allowed.- Returns:
- true if document assembly is allowed
-
isAllowDegradedPrinting
public boolean isAllowDegradedPrinting()Tells you if degraded printing is allowed.- Returns:
- true if degraded printing is allowed
-