@@ -117,6 +117,7 @@ public class PdfReader implements Closeable, Serializable {
117
117
*
118
118
* @param byteSource source of bytes for the reader
119
119
* @param properties properties of the created reader
120
+ * @throws IOException if an I/O error occurs
120
121
*/
121
122
public PdfReader (IRandomAccessSource byteSource , ReaderProperties properties ) throws IOException {
122
123
this .properties = properties ;
@@ -197,6 +198,10 @@ public void close() throws IOException {
197
198
/**
198
199
* The iText is not responsible if you decide to change the
199
200
* value of this parameter.
201
+ *
202
+ * @param unethicalReading true to enable unethicalReading, false to disable it.
203
+ * By default unethicalReading is disabled.
204
+ * @return this {@link PdfReader} instance.
200
205
*/
201
206
public PdfReader setUnethicalReading (boolean unethicalReading ) {
202
207
this .unethicalReading = unethicalReading ;
@@ -315,6 +320,7 @@ public long getLastXref() {
315
320
* Reads, decrypt and optionally decode stream bytes.
316
321
* Note, this method doesn't store actual bytes in any internal structures.
317
322
*
323
+ * @param stream a {@link PdfStream} stream instance to be read and optionally decoded.
318
324
* @param decode true if to get decoded stream bytes, false if to leave it originally encoded.
319
325
* @return byte[] array.
320
326
* @throws IOException on error.
@@ -332,6 +338,7 @@ public byte[] readStreamBytes(PdfStream stream, boolean decode) throws IOExcepti
332
338
* Reads and decrypt stream bytes.
333
339
* Note, this method doesn't store actual bytes in any internal structures.
334
340
*
341
+ * @param stream a {@link PdfStream} stream instance to be read
335
342
* @return byte[] array.
336
343
* @throws IOException on error.
337
344
*/
@@ -383,9 +390,10 @@ public byte[] readStreamBytesRaw(PdfStream stream) throws IOException {
383
390
}
384
391
385
392
/**
386
- * Reads, decrypt and optionally decode stream bytes into {@link ByteArrayInputStream}.
393
+ * Reads, decrypts and optionally decodes stream bytes into {@link ByteArrayInputStream}.
387
394
* User is responsible for closing returned stream.
388
395
*
396
+ * @param stream a {@link PdfStream} stream instance to be read
389
397
* @param decode true if to get decoded stream, false if to leave it originally encoded.
390
398
* @return InputStream or {@code null} if reading was failed.
391
399
* @throws IOException on error.
@@ -561,6 +569,7 @@ public long getPermissions() {
561
569
/**
562
570
* Gets encryption algorithm and access permissions.
563
571
*
572
+ * @return {@code int} value corresponding to a certain type of encryption.
564
573
* @see EncryptionConstants
565
574
* @throws PdfException if the method has been invoked before the PDF document was read.
566
575
*/
@@ -653,6 +662,9 @@ public byte[] getModifiedFileId() {
653
662
}
654
663
655
664
/**
665
+ * Checks if the {@link PdfDocument} read with this {@link PdfReader} is encrypted.
666
+ *
667
+ * @return {@code true} is the document is encrypted, otherwise {@code false}.
656
668
* @throws PdfException if the method has been invoked before the PDF document was read.
657
669
*/
658
670
public boolean isEncrypted () {
@@ -665,6 +677,8 @@ public boolean isEncrypted() {
665
677
666
678
/**
667
679
* Parses the entire PDF
680
+ *
681
+ * @throws IOException if an I/O error occurs.
668
682
*/
669
683
protected void readPdf () throws IOException {
670
684
String version = tokens .checkPdfHeader ();
0 commit comments