{
document.decrypt("");
}
catch (CryptographyException e)
{
throw new WrappedIOException("Error decrypting document, details: ", e);
}
catch (InvalidPasswordException e)
{
throw new WrappedIOException("Error: document is encrypted", e);
}
}
processPages( document.getDocumentCatalog().getAllPages() );
endDocument(document);