示例#1
0
 public void setEncryption(Certificate[] certs, int[] permissions, int encryptionType)
     throws DocumentException {
   if (stamper.isAppend())
     throw new DocumentException("Append mode does not support changing the encryption status.");
   if (stamper.isContentWritten())
     throw new DocumentException("Content was already written to the output.");
   stamper.setEncryption(certs, permissions, encryptionType);
 }
示例#2
0
 public void setEncryption(
     byte userPassword[], byte ownerPassword[], int permissions, int encryptionType)
     throws DocumentException {
   if (stamper.isAppend())
     throw new DocumentException("Append mode does not support changing the encryption status.");
   if (stamper.isContentWritten())
     throw new DocumentException("Content was already written to the output.");
   stamper.setEncryption(userPassword, ownerPassword, permissions, encryptionType);
 }
示例#3
0
 public void setEncryption(
     byte userPassword[], byte ownerPassword[], int permissions, boolean strength128Bits)
     throws DocumentException {
   if (stamper.isAppend())
     throw new DocumentException("Append mode does not support changing the encryption status.");
   if (stamper.isContentWritten())
     throw new DocumentException("Content was already written to the output.");
   stamper.setEncryption(
       userPassword,
       ownerPassword,
       permissions,
       strength128Bits ? PdfWriter.STANDARD_ENCRYPTION_128 : PdfWriter.STANDARD_ENCRYPTION_40);
 }
示例#4
0
 public void setFullCompression() {
   if (stamper.isAppend()) return;
   stamper.setFullCompression();
 }