pdfUtil.setXMode(PDFXMode.valueOf(s));
}
Configuration encryptionParamsConfig
= cfg.getChild(PDFConfigurationConstants.ENCRYPTION_PARAMS, false);
if (encryptionParamsConfig != null) {
PDFEncryptionParams encryptionParams = pdfUtil.getEncryptionParams();
Configuration ownerPasswordConfig = encryptionParamsConfig.getChild(
PDFConfigurationConstants.OWNER_PASSWORD, false);
if (ownerPasswordConfig != null) {
String ownerPassword = ownerPasswordConfig.getValue(null);
if (ownerPassword != null) {
encryptionParams.setOwnerPassword(ownerPassword);
}
}
Configuration userPasswordConfig = encryptionParamsConfig.getChild(
PDFConfigurationConstants.USER_PASSWORD, false);
if (userPasswordConfig != null) {
String userPassword = userPasswordConfig.getValue(null);
if (userPassword != null) {
encryptionParams.setUserPassword(userPassword);
}
}
Configuration noPrintConfig = encryptionParamsConfig.getChild(
PDFConfigurationConstants.NO_PRINT, false);
if (noPrintConfig != null) {
encryptionParams.setAllowPrint(false);
}
Configuration noCopyContentConfig = encryptionParamsConfig.getChild(
PDFConfigurationConstants.NO_COPY_CONTENT, false);
if (noCopyContentConfig != null) {
encryptionParams.setAllowCopyContent(false);
}
Configuration noEditContentConfig = encryptionParamsConfig.getChild(
PDFConfigurationConstants.NO_EDIT_CONTENT, false);
if (noEditContentConfig != null) {
encryptionParams.setAllowEditContent(false);
}
Configuration noAnnotationsConfig = encryptionParamsConfig.getChild(
PDFConfigurationConstants.NO_ANNOTATIONS, false);
if (noAnnotationsConfig != null) {
encryptionParams.setAllowEditAnnotations(false);
}
Configuration noFillInForms = encryptionParamsConfig.getChild(
PDFConfigurationConstants.NO_FILLINFORMS, false);
if (noFillInForms != null) {
encryptionParams.setAllowFillInForms(false);
}
Configuration noAccessContentConfig = encryptionParamsConfig.getChild(
PDFConfigurationConstants.NO_ACCESSCONTENT, false);
if (noAccessContentConfig != null) {
encryptionParams.setAllowAccessContent(false);
}
Configuration noAssembleDocConfig = encryptionParamsConfig.getChild(
PDFConfigurationConstants.NO_ASSEMBLEDOC, false);
if (noAssembleDocConfig != null) {
encryptionParams.setAllowAssembleDocument(false);
}
Configuration noPrintHqConfig = encryptionParamsConfig.getChild(
PDFConfigurationConstants.NO_PRINTHQ, false);
if (noPrintHqConfig != null) {
encryptionParams.setAllowPrintHq(false);
}
Configuration encryptionLengthConfig = encryptionParamsConfig.getChild(
PDFConfigurationConstants.ENCRYPTION_LENGTH, false);
if (encryptionLengthConfig != null) {
int encryptionLength = checkEncryptionLength(
Integer.parseInt(encryptionLengthConfig.getValue(null)));
encryptionParams.setEncryptionLengthInBits(encryptionLength);
}
}
s = cfg.getChild(PDFConfigurationConstants.KEY_OUTPUT_PROFILE, true).getValue(null);
if (s != null) {