Decrypting A Encrypted PDF
PDDocument source = PDDocument.load(new ByteArrayInputStream(bytes));
try {
if (source.isEncrypted()) {
source.decrypt("");
source.setAllSecurityToBeRemoved(true);
}
} catch (Exception e) {
logger.info("Error During PDF Decryption ");
}
try {
if (source.isEncrypted()) {
source.decrypt("");
source.setAllSecurityToBeRemoved(true);
}
} catch (Exception e) {
logger.info("Error During PDF Decryption ");
}
Comments
Post a Comment