Skip to content

Commit 47b82c9

Browse files
committed
Improve several kernel/pdf javadocs
DEVSIX-4123
1 parent b62a9ee commit 47b82c9

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

kernel/src/main/java/com/itextpdf/kernel/pdf/PdfDocument.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,8 +1391,9 @@ public void setFlushUnusedObjects(boolean flushUnusedObjects) {
13911391
/**
13921392
* This method returns a complete outline tree of the whole document.
13931393
*
1394-
* @param updateOutlines if the flag is true, the method read the whole document and creates outline tree.
1395-
* If false the method gets cached outline tree (if it was cached via calling getOutlines method before).
1394+
* @param updateOutlines if the flag is {@code true}, the method reads the whole document and creates outline tree.
1395+
* If the flag is {@code false}, the method gets cached outline tree
1396+
* (if it was cached via calling getOutlines method before).
13961397
* @return fully initialize {@link PdfOutline} object.
13971398
*/
13981399
public PdfOutline getOutlines(boolean updateOutlines) {

kernel/src/main/java/com/itextpdf/kernel/pdf/PdfPage.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ public PdfPage copyTo(PdfDocument toDocument, IPdfPageExtraCopier copier) {
436436
*
437437
* @param toDocument a document to copy to.
438438
* @return copied {@link PdfFormXObject} object.
439+
* @throws IOException if an I/O error occurs.
439440
*/
440441
public PdfFormXObject copyAsFormXObject(PdfDocument toDocument) throws IOException {
441442
PdfFormXObject xObject = new PdfFormXObject(getCropBox());
@@ -955,6 +956,9 @@ public int getAnnotsSize() {
955956
/**
956957
* This method gets outlines of a current page
957958
*
959+
* @param updateOutlines if the flag is {@code true}, the method reads the whole document and creates outline tree.
960+
* If the flag is {@code false}, the method gets cached outline tree
961+
* (if it was cached via calling getOutlines method before).
958962
* @return return all outlines of a current page
959963
*/
960964
public List<PdfOutline> getOutlines(boolean updateOutlines) {
@@ -976,6 +980,7 @@ public boolean isIgnorePageRotationForContent() {
976980
* Default value - {@code false}.
977981
*
978982
* @param ignorePageRotationForContent - true to ignore rotation of the new content on the rotated page.
983+
* @return this {@link PdfPage} instance.
979984
*/
980985
public PdfPage setIgnorePageRotationForContent(boolean ignorePageRotationForContent) {
981986
this.ignorePageRotationForContent = ignorePageRotationForContent;

kernel/src/main/java/com/itextpdf/kernel/pdf/PdfReader.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public class PdfReader implements Closeable, Serializable {
117117
*
118118
* @param byteSource source of bytes for the reader
119119
* @param properties properties of the created reader
120+
* @throws IOException if an I/O error occurs
120121
*/
121122
public PdfReader(IRandomAccessSource byteSource, ReaderProperties properties) throws IOException {
122123
this.properties = properties;
@@ -197,6 +198,10 @@ public void close() throws IOException {
197198
/**
198199
* The iText is not responsible if you decide to change the
199200
* 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.
200205
*/
201206
public PdfReader setUnethicalReading(boolean unethicalReading) {
202207
this.unethicalReading = unethicalReading;
@@ -315,6 +320,7 @@ public long getLastXref() {
315320
* Reads, decrypt and optionally decode stream bytes.
316321
* Note, this method doesn't store actual bytes in any internal structures.
317322
*
323+
* @param stream a {@link PdfStream} stream instance to be read and optionally decoded.
318324
* @param decode true if to get decoded stream bytes, false if to leave it originally encoded.
319325
* @return byte[] array.
320326
* @throws IOException on error.
@@ -332,6 +338,7 @@ public byte[] readStreamBytes(PdfStream stream, boolean decode) throws IOExcepti
332338
* Reads and decrypt stream bytes.
333339
* Note, this method doesn't store actual bytes in any internal structures.
334340
*
341+
* @param stream a {@link PdfStream} stream instance to be read
335342
* @return byte[] array.
336343
* @throws IOException on error.
337344
*/
@@ -383,9 +390,10 @@ public byte[] readStreamBytesRaw(PdfStream stream) throws IOException {
383390
}
384391

385392
/**
386-
* Reads, decrypt and optionally decode stream bytes into {@link ByteArrayInputStream}.
393+
* Reads, decrypts and optionally decodes stream bytes into {@link ByteArrayInputStream}.
387394
* User is responsible for closing returned stream.
388395
*
396+
* @param stream a {@link PdfStream} stream instance to be read
389397
* @param decode true if to get decoded stream, false if to leave it originally encoded.
390398
* @return InputStream or {@code null} if reading was failed.
391399
* @throws IOException on error.
@@ -561,6 +569,7 @@ public long getPermissions() {
561569
/**
562570
* Gets encryption algorithm and access permissions.
563571
*
572+
* @return {@code int} value corresponding to a certain type of encryption.
564573
* @see EncryptionConstants
565574
* @throws PdfException if the method has been invoked before the PDF document was read.
566575
*/
@@ -653,6 +662,9 @@ public byte[] getModifiedFileId() {
653662
}
654663

655664
/**
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}.
656668
* @throws PdfException if the method has been invoked before the PDF document was read.
657669
*/
658670
public boolean isEncrypted() {
@@ -665,6 +677,8 @@ public boolean isEncrypted() {
665677

666678
/**
667679
* Parses the entire PDF
680+
*
681+
* @throws IOException if an I/O error occurs.
668682
*/
669683
protected void readPdf() throws IOException {
670684
String version = tokens.checkPdfHeader();

kernel/src/main/java/com/itextpdf/kernel/pdf/PdfResources.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ public PdfResources() {
108108
}
109109

110110
/**
111-
* Adds font to resources and register PdfFont in the document for further flushing.
111+
* Adds font to resources and registers PdfFont in the document for further flushing.
112112
*
113+
* @param pdfDocument a {@link PdfDocument} instance to which the font is added for further flushing
114+
* @param font a {@link PdfFont} instance to be added
113115
* @return added font resource name.
114116
*/
115117
public PdfName addFont(PdfDocument pdfDocument, PdfFont font) {
@@ -311,6 +313,12 @@ protected boolean isModified() {
311313
}
312314

313315
/**
316+
* Sets the 'modified' flag to this {@link PdfResources} indirect object.
317+
* The flag denotes that the object was modified since the document opening.
318+
*
319+
* @param isModified {@code true} if this {@link PdfResources} indirect object has been modified,
320+
* otherwise {@code false}.
321+
* @see PdfObject#setModified()
314322
* @deprecated Please use {@link #setModified()}.
315323
*/
316324
@Deprecated

0 commit comments

Comments
 (0)