Пример #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();
 }