PdfReader

Reads and parses a pdf document. Contrary to the other constructors only the xref is read
into memory. The reader is said to be working in "partial" mode as only parts of the pdf
are read as needed. The pdf is left open but may be closed at any time with
PdfReader.close(), reopen is automatic.

getPageSize

getCropBox

Gets the crop box without taking rotation into account. This
is the value of the /CropBox key. The crop box is the part
of the document to be displayed or printed. It usually is the same
as the media box but may be smaller. If the page doesn't have a crop
box the page size will be returned.

selectPages

public void selectPages(java.util.List pagesToKeep)

Selects the pages to keep in the document. The pages are described as a
List of Integer. The page ordering can be changed but
no page repetitions are allowed. Note that it may be very slow in partial mode.

getSimpleViewerPreferences

Returns a bitset representing the PageMode and PageLayout viewer preferences.
Doesn't return any information about the ViewerPreferences dictionary.

Returns:

an int that contains the Viewer Preferences.

isAppendable

public boolean isAppendable()

Getter for property appendable.

Returns:

Value of property appendable.

setAppendable

public void setAppendable(boolean appendable)

Setter for property appendable.

Parameters:

appendable - New value of property appendable.

isNewXrefType

public boolean isNewXrefType()

Getter for property newXrefType.

Returns:

Value of property newXrefType.

getFileLength

public int getFileLength()

Getter for property fileLength.

Returns:

Value of property fileLength.

isHybridXref

public boolean isHybridXref()

Getter for property hybridXref.

Returns:

Value of property hybridXref.

removeUsageRights

public void removeUsageRights()

Removes any usage rights that this PDF may have. Only Adobe can grant usage rights
and any PDF modification with iText will invalidate them. Invalidated usage rights may
confuse Acrobat and it's advisable to remove them altogether.

getCertificationLevel

public int getCertificationLevel()

Gets the certification level for this document. The return values can be PdfSignatureAppearance.NOT_CERTIFIED,
PdfSignatureAppearance.CERTIFIED_NO_CHANGES_ALLOWED,
PdfSignatureAppearance.CERTIFIED_FORM_FILLING and
PdfSignatureAppearance.CERTIFIED_FORM_FILLING_AND_ANNOTATIONS.

No signature validation is made, use the methods available for that in AcroFields.

Returns:

gets the certification level for this document

isOpenedWithFullPermissions

public final boolean isOpenedWithFullPermissions()

Checks if the document was opened with the owner password so that the end application
can decide what level of access restrictions to apply. If the document is not encrypted
it will return true.

Returns:

true if the document was opened with the owner password or if it's not encrypted,
false if the document was opened with the user password