tool.pdf

Class Encrypt

public class Encrypt extends Object

Encrypt, possibly adding restrictions on document use.

Version: $Revision: 1.19 $ $Date: 2004/02/10 19:58:46 $

Field Summary
static StringUSAGE
static StringVERSION
Constructor Summary
Encrypt()
Method Summary
voiddefaults()
voidencrypt(File in)
Compute output filename and invoke encrypt.
voidencrypt(File filein, File fileout)
Reads file in and writes encrypted version to file out.
voidencrypt(PDFReader pdfr, PDFWriter pdfw)
static voidmain(String[] argv)
voidsetKeyLength(int multipleof8)
If 40 bits, uses settings compatible with older PDF viewers (V=1, R=2), else newer settings introduced in PDF 1.4.
voidsetOwnerPassword(String password)
voidsetPassword(String password)
Sets owner password of source document.
voidsetPermissions(int perms)
Sets permissions from bit mask as defined in PDF Reference.
voidsetPermissions(String actions)
Permits passed actions, where act is one or more of pPcCmtfa.
voidsetRestrictions(String actions)
Restricts passed actions, where actions is one or more of pPcCmtfa.
voidsetUserPassword(String password)

Field Detail

USAGE

public static final String USAGE

VERSION

public static final String VERSION

Constructor Detail

Encrypt

public Encrypt()

Method Detail

defaults

public void defaults()

encrypt

public void encrypt(File in)
Compute output filename and invoke encrypt.

encrypt

public void encrypt(File filein, File fileout)
Reads file in and writes encrypted version to file out. in can be encrypted with a different password or encryption filter, so long as the owner password is supplied with setPassword.

encrypt

public void encrypt(PDFReader pdfr, PDFWriter pdfw)

main

public static void main(String[] argv)

setKeyLength

public void setKeyLength(int multipleof8)
If 40 bits, uses settings compatible with older PDF viewers (V=1, R=2), else newer settings introduced in PDF 1.4.

setOwnerPassword

public void setOwnerPassword(String password)

setPassword

public void setPassword(String password)
Sets owner password of source document.

setPermissions

public void setPermissions(int perms)
Sets permissions from bit mask as defined in PDF Reference.

setPermissions

public void setPermissions(String actions)
Permits passed actions, where act is one or more of pPcCmtfa. Equal in capability to Encrypt.

setRestrictions

public void setRestrictions(String actions)
Restricts passed actions, where actions is one or more of pPcCmtfa. Equal in capability to setPermissions.

setUserPassword

public void setUserPassword(String password)