com.lowagie.rups.model

Class Permissions

public class Permissions extends Object

This class can tell you more about the permissions that are allowed on the PDF file.
Field Summary
protected intcryptoMode
How was the document encrypted?
protected booleanencrypted
Was the file encrypted?
protected byte[]ownerPassword
Which owner password was provided to open the file?
protected intpermissions
What are the document permissions?
protected byte[]userPassword
What is the user password?
Method Summary
intgetCryptoMode()
Returns the crypto mode.
byte[]getOwnerPassword()
Returns the owner password of the PDF file (if any).
intgetPermissions()
Returns the permissions in the form of an int (each bit is a specific permission)
byte[]getUserPassword()
Returns the user password (if any).
booleanisAllowAssembly()
Tells you if document assembly is allowed.
booleanisAllowCopy(boolean decrypted)
Tells you if copying is allowed.
booleanisAllowDegradedPrinting()
Tells you if degraded printing is allowed.
booleanisAllowFillIn()
Tells you if filling in forms is allowed.
booleanisAllowModifyAnnotations()
Tells you if modifying annotations is allowed
booleanisAllowModifyContents(boolean decrypted)
Tells you if modifying the contents is allowed.
booleanisAllowPrinting()
Tells you if printing is allowed.
booleanisAllowScreenReaders()
Tells you if modifying the layout for screenreaders is allowed.
booleanisEncrypted()
Tells you if the document was encrypted.
voidsetCryptoMode(int cryptoMode)
Setter for the crypto mode
voidsetEncrypted(boolean encrypted)
Setter for the encrypted variable.
voidsetOwnerPassword(byte[] ownerPassword)
Setter for the owner password.
voidsetPermissions(int permissions)
Setter for the permissions.
voidsetUserPassword(byte[] userPassword)
Setter for the user password.

Field Detail

cryptoMode

protected int cryptoMode
How was the document encrypted?

encrypted

protected boolean encrypted
Was the file encrypted?

ownerPassword

protected byte[] ownerPassword
Which owner password was provided to open the file?

permissions

protected int permissions
What are the document permissions?

userPassword

protected byte[] userPassword
What is the user password?

Method Detail

getCryptoMode

public int getCryptoMode()
Returns the crypto mode.

Returns: the crypto mode

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

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

getUserPassword

public byte[] getUserPassword()
Returns the user password (if any).

Returns: the user password

isAllowAssembly

public boolean isAllowAssembly()
Tells you if document assembly is allowed.

Returns: true if document assembly is allowed

isAllowCopy

public boolean isAllowCopy(boolean decrypted)
Tells you if copying is allowed.

Returns: true if copying is allowed

isAllowDegradedPrinting

public boolean isAllowDegradedPrinting()
Tells you if degraded printing is allowed.

Returns: true if degraded printing is allowed

isAllowFillIn

public boolean isAllowFillIn()
Tells you if filling in forms is allowed.

Returns: true if filling in forms is allowed

isAllowModifyAnnotations

public boolean isAllowModifyAnnotations()
Tells you if modifying annotations is allowed

Returns: true if modifying annotations is allowed

isAllowModifyContents

public boolean isAllowModifyContents(boolean decrypted)
Tells you if modifying the contents is allowed.

Returns: true if modifying contents is allowed

isAllowPrinting

public boolean isAllowPrinting()
Tells you if printing is allowed.

Returns: true if printing 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

isEncrypted

public boolean isEncrypted()
Tells you if the document was encrypted.

Returns: true is the document was encrypted

setCryptoMode

public void setCryptoMode(int cryptoMode)
Setter for the crypto mode

Parameters: cryptoMode the crypto mode

setEncrypted

public void setEncrypted(boolean encrypted)
Setter for the encrypted variable.

Parameters: encrypted set this to true if the document was encrypted

setOwnerPassword

public void setOwnerPassword(byte[] ownerPassword)
Setter for the owner password.

Parameters: ownerPassword the owner password

setPermissions

public void setPermissions(int permissions)
Setter for the permissions.

Parameters: permissions the permissions in the form of an int

setUserPassword

public void setUserPassword(byte[] userPassword)
Setter for the user password.

Parameters: userPassword the user password of a PDF file