checkPermissions(pdfPage, fDenyPermissions, false);
}
private void checkPermissions(final PDFPage pdfPage, final List permissions, final boolean expectedValue) {
for (final Iterator iter = permissions.iterator(); iter.hasNext();) {
final PDFEncryptionPermission permission = (PDFEncryptionPermission) iter.next();
final boolean actualVallue = pdfPage.hasPermission(permission);
if (actualVallue != expectedValue)
{
final StringBuffer sb = new StringBuffer("Incorrect encryption permission found: ");
sb.append(permission.getName());
sb.append(" is ");
if (expectedValue)
sb.append("not ");
sb.append("set");
throw new StepFailedException(sb.toString(), this);