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); }
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); }
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); }
public void setFullCompression() { if (stamper.isAppend()) return; stamper.setFullCompression(); }