|
static void | Encrypt (PdfReader reader, Stream os, byte[] userPassword, byte[] ownerPassword, int permissions, bool strength128Bits) |
|
static void | Encrypt (PdfReader reader, Stream os, byte[] userPassword, byte[] ownerPassword, int permissions, bool strength128Bits, Hashtable newInfo) |
|
static void | Encrypt (PdfReader reader, Stream os, bool strength, String userPassword, String ownerPassword, int permissions) |
|
static void | Encrypt (PdfReader reader, Stream os, bool strength, String userPassword, String ownerPassword, int permissions, Hashtable newInfo) |
|
static void | Encrypt (PdfReader reader, Stream os, int type, String userPassword, String ownerPassword, int permissions, Hashtable newInfo) |
|
static void | Encrypt (PdfReader reader, Stream os, int type, String userPassword, String ownerPassword, int permissions) |
|
static String | GetPermissionsVerbose (int permissions) |
|
static bool | IsPrintingAllowed (int permissions) |
|
static bool | IsModifyContentsAllowed (int permissions) |
|
static bool | IsCopyAllowed (int permissions) |
|
static bool | IsModifyAnnotationsAllowed (int permissions) |
|
static bool | IsFillInAllowed (int permissions) |
|
static bool | IsScreenReadersAllowed (int permissions) |
|
static bool | IsAssemblyAllowed (int permissions) |
|
static bool | IsDegradedPrintingAllowed (int permissions) |
|
This class takes any PDF and returns exactly the same but encrypted. All the content, links, outlines, etc, are kept. It is also possible to change the info dictionary.
static void iTextSharp.text.pdf.PdfEncryptor.Encrypt |
( |
PdfReader |
reader, |
|
|
Stream |
os, |
|
|
bool |
strength, |
|
|
String |
userPassword, |
|
|
String |
ownerPassword, |
|
|
int |
permissions |
|
) |
| |
|
static |
Entry point to encrypt a PDF document. The encryption parameters are the same as in PdfWriter
. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.
- Parameters
-
reader | the read PDF |
os | the output destination |
strength | true for 128 bit key length, false for 40 bit key length |
userPassword | the user password. Can be null or empty |
ownerPassword | the owner password. Can be null or empty |
permissions | the user permissions |
- Exceptions
-
static void iTextSharp.text.pdf.PdfEncryptor.Encrypt |
( |
PdfReader |
reader, |
|
|
Stream |
os, |
|
|
bool |
strength, |
|
|
String |
userPassword, |
|
|
String |
ownerPassword, |
|
|
int |
permissions, |
|
|
Hashtable |
newInfo |
|
) |
| |
|
static |
Entry point to encrypt a PDF document. The encryption parameters are the same as in PdfWriter
. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.
- Parameters
-
reader | the read PDF |
os | the output destination |
strength | true for 128 bit key length, false for 40 bit key length |
userPassword | the user password. Can be null or empty |
ownerPassword | the owner password. Can be null or empty |
permissions | the user permissions |
newInfo | an optional String map to add or change the info dictionary. Entries with null values delete the key in the original info dictionary |
- Exceptions
-
static void iTextSharp.text.pdf.PdfEncryptor.Encrypt |
( |
PdfReader |
reader, |
|
|
Stream |
os, |
|
|
byte[] |
userPassword, |
|
|
byte[] |
ownerPassword, |
|
|
int |
permissions, |
|
|
bool |
strength128Bits |
|
) |
| |
|
static |
Entry point to encrypt a PDF document. The encryption parameters are the same as in PdfWriter
. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.
- Parameters
-
reader | the read PDF |
os | the output destination |
userPassword | the user password. Can be null or empty |
ownerPassword | the owner password. Can be null or empty |
permissions | the user permissions |
strength128Bits | true for 128 bit key length, false for 40 bit key length |
- Exceptions
-
static void iTextSharp.text.pdf.PdfEncryptor.Encrypt |
( |
PdfReader |
reader, |
|
|
Stream |
os, |
|
|
byte[] |
userPassword, |
|
|
byte[] |
ownerPassword, |
|
|
int |
permissions, |
|
|
bool |
strength128Bits, |
|
|
Hashtable |
newInfo |
|
) |
| |
|
static |
Entry point to encrypt a PDF document. The encryption parameters are the same as in PdfWriter
. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.
- Parameters
-
reader | the read PDF |
os | the output destination |
userPassword | the user password. Can be null or empty |
ownerPassword | the owner password. Can be null or empty |
permissions | the user permissions |
strength128Bits | true for 128 bit key length, false for 40 bit key length |
newInfo | an optional String map to add or change the info dictionary. Entries with null values delete the key in the original info dictionary |
- Exceptions
-
static void iTextSharp.text.pdf.PdfEncryptor.Encrypt |
( |
PdfReader |
reader, |
|
|
Stream |
os, |
|
|
int |
type, |
|
|
String |
userPassword, |
|
|
String |
ownerPassword, |
|
|
int |
permissions |
|
) |
| |
|
static |
Entry point to encrypt a PDF document. The encryption parameters are the same as in PdfWriter
. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.
- Parameters
-
reader | the read PDF |
os | the output destination |
type | the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128. Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext |
userPassword | the user password. Can be null or empty |
ownerPassword | the owner password. Can be null or empty |
permissions | the user permissions values delete the key in the original info dictionary |
- Exceptions
-
static void iTextSharp.text.pdf.PdfEncryptor.Encrypt |
( |
PdfReader |
reader, |
|
|
Stream |
os, |
|
|
int |
type, |
|
|
String |
userPassword, |
|
|
String |
ownerPassword, |
|
|
int |
permissions, |
|
|
Hashtable |
newInfo |
|
) |
| |
|
static |
Entry point to encrypt a PDF document. The encryption parameters are the same as in PdfWriter
. The userPassword and the ownerPassword can be null or have zero length. In this case the ownerPassword is replaced by a random string. The open permissions for the document can be AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations, AllowFillIn, AllowScreenReaders, AllowAssembly and AllowDegradedPrinting. The permissions can be combined by ORing them.
- Parameters
-
reader | the read PDF |
os | the output destination |
type | the type of encryption. It can be one of STANDARD_ENCRYPTION_40, STANDARD_ENCRYPTION_128 or ENCRYPTION_AES128. Optionally DO_NOT_ENCRYPT_METADATA can be ored to output the metadata in cleartext |
userPassword | the user password. Can be null or empty |
ownerPassword | the owner password. Can be null or empty |
permissions | the user permissions |
newInfo | an optional String map to add or change the info dictionary. Entries with null values delete the key in the original info dictionary |
- Exceptions
-