Description
Getting IllegalBlockSizeException when loading the fileĀ
Code:
PDDocument pdDoc = PDDocument.load(file);
Exception:
java.io.IOException: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with padded cipherjava.io.IOException: javax.crypto.IllegalBlockSizeException: Input length must be multiple of 16 when decrypting with padded cipher at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.encryptDataAESother(SecurityHandler.java:315) at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.encryptData(SecurityHandler.java:201) at org.apache.pdfbox.pdmodel.encryption.SecurityHandler.decryptStream(SecurityHandler.java:510) at org.apache.pdfbox.pdfparser.COSParser.parseFileObject(COSParser.java:929) at org.apache.pdfbox.pdfparser.COSParser.parseObjectDynamically(COSParser.java:886) at org.apache.pdfbox.pdfparser.COSParser.parseObjectDynamically(COSParser.java:806) at org.apache.pdfbox.pdfparser.COSParser.parseDictObjects(COSParser.java:766) at org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:187) at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:226) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1099) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1082) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:1041) at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:989)