org.apache.fop.pdf

Class PDFEncryptionParams


public class PDFEncryptionParams
extends java.lang.Object

This class holds the parameters for PDF encryption.

Constructor Summary

PDFEncryptionParams()
Default constructor initializing to default values.
PDFEncryptionParams(String userPassword, String ownerPassword, boolean allowPrint, boolean allowCopyContent, boolean allowEditContent, boolean allowEditAnnotations)
Creates a new instance.

Method Summary

String
getOwnerPassword()
Returns the owner password.
String
getUserPassword()
Returns the user password.
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
isAllowPrint()
Indicates whether printing 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
setAllowPrint(boolean allowPrint)
Sets the persmission for printing.
void
setOwnerPassword(String ownerPassword)
Sets the owner password.
void
setUserPassword(String userPassword)
Sets the user password.

Constructor Details

PDFEncryptionParams

public PDFEncryptionParams()
Default constructor initializing to default values.

PDFEncryptionParams

public PDFEncryptionParams(String userPassword,
                           String ownerPassword,
                           boolean allowPrint,
                           boolean allowCopyContent,
                           boolean allowEditContent,
                           boolean allowEditAnnotations)
Creates a new instance.
Parameters:
userPassword - the user password
ownerPassword - the owner password
allowPrint - true if printing is allowed
allowCopyContent - true if copying content is allowed
allowEditContent - true if editing content is allowed
allowEditAnnotations - true if editing annotations is allowed

Method Details

getOwnerPassword

public String getOwnerPassword()
Returns the owner password.
Returns:
the owner password, an empty string if no password applies

getUserPassword

public String getUserPassword()
Returns the user password.
Returns:
the user password, an empty string if no password applies

isAllowCopyContent

public boolean isAllowCopyContent()
Indicates whether copying content is allowed.
Returns:
true if copying is allowed

isAllowEditAnnotations

public boolean isAllowEditAnnotations()
Indicates whether editing annotations is allowed.
Returns:
true is editing annotations is allowed

isAllowEditContent

public boolean isAllowEditContent()
Indicates whether editing content is allowed.
Returns:
true if editing content is allowed

isAllowPrint

public boolean isAllowPrint()
Indicates whether printing is allowed.
Returns:
true if printing is allowed

setAllowCopyContent

public void setAllowCopyContent(boolean allowCopyContent)
Sets the permission for copying content.
Parameters:
allowCopyContent - true if copying content is allowed

setAllowEditAnnotations

public void setAllowEditAnnotations(boolean allowEditAnnotations)
Sets the permission for editing annotations.
Parameters:
allowEditAnnotations - true if editing annotations is allowed

setAllowEditContent

public void setAllowEditContent(boolean allowEditContent)
Sets the permission for editing content.
Parameters:
allowEditContent - true if editing annotations is allowed

setAllowPrint

public void setAllowPrint(boolean allowPrint)
Sets the persmission for printing.
Parameters:
allowPrint - true if printing is allowed

setOwnerPassword

public void setOwnerPassword(String ownerPassword)
Sets the owner password.
Parameters:
ownerPassword - The owner password to set, null or an empty String if no password is applicable

setUserPassword

public void setUserPassword(String userPassword)
Sets the user password.
Parameters:
userPassword - The user password to set, null or an empty String if no password is applicable

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.