PdfReader implements Closeable, Serializable { public byte[] computeUserPassword() { if (pdfDocument == null || !pdfDocument.getXref().isReadingCompleted()) { throw new PdfException(PdfException.DocumentHasNotBeenReadYet); } if (!encrypted || !decrypt.isOpenedWithFullPermission()) { return null; } return decrypt.computeUserPassword(properties.password); } PdfReader(IRandomAccessSource byteSource, ReaderProperties properties);  PdfReader(InputStream is, ReaderProperties properties);  PdfReader(java.io.File file);  PdfReader(InputStream is);  PdfReader(String filename, ReaderProperties properties);  PdfReader(String filename); void close(); PdfReader setUnethicalReading(boolean unethicalReading); PdfReader setMemorySavingMode(boolean memorySavingMode); boolean isCloseStream(); void setCloseStream(boolean closeStream); boolean hasRebuiltXref(); boolean hasHybridXref(); boolean hasXrefStm(); boolean hasFixedXref(); long getLastXref(); byte[] readStreamBytes(PdfStream stream, boolean decode); byte[] readStreamBytesRaw(PdfStream stream); InputStream readStream(PdfStream stream, boolean decode); static byte[] decodeBytes(byte[] b, PdfDictionary streamDictionary); static byte[] decodeBytes(byte[] b, PdfDictionary streamDictionary, Map<PdfName, IFilterHandler> filterHandlers); RandomAccessFileOrArray getSafeFile(); long getFileLength(); boolean isOpenedWithFullPermission(); long getPermissions(); int getCryptoMode(); PdfAConformanceLevel getPdfAConformanceLevel(); byte[] computeUserPassword(); byte[] getOriginalFileId(); byte[] getModifiedFileId(); boolean isEncrypted();  }
@Test public void computeUserPasswordPdfDocumentNotReadTest() throws IOException { junitExpectedException.expect(PdfException.class); junitExpectedException.expectMessage(PdfException.DocumentHasNotBeenReadYet); PdfReader computeUserPasswordReader = pdfDocumentNotReadTestInit(); computeUserPasswordReader.computeUserPassword(); }