}
if (uPassword != null) {
encrypt = true;
}
if (encrypt) {
PdfEncryption encryption = null;
encryption = this.getPDFDocument().createPdfEncryption();
encryption.setOwnerPassword(oPassword);
encryption.setUserPassword(uPassword);
encryption.setAllowPrint(allowPrint);
encryption.setAllowCopyContent(allowCopyContent);
encryption.setAllowEditContent(allowEditContent);
encryption.setAllowEditAnnotation(allowEditAnnotations);
encryption.init();
}
}