java.lang.Object
com.lowagie.text.pdf.PdfReader
- All Implemented Interfaces:
PdfViewerPreferences,Closeable,AutoCloseable
- Direct Known Subclasses:
FdfReader
Deprecated.
Reads a PDF document.
- Author:
- Paulo Soares (psoares@consiste.pt), Kazuya Ujihara
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PRAcroFormDeprecated.protected booleanDeprecated.protected PdfDictionaryDeprecated.protected CertificateDeprecated.protected KeyDeprecated.protected StringDeprecated.protected booleanDeprecated.protected PdfEncryptionDeprecated.protected booleanDeprecated.protected intDeprecated.protected intDeprecated.protected intDeprecated.protected booleanDeprecated.protected Map<Integer, IntHashtable> Deprecated.protected IntHashtableDeprecated.protected com.lowagie.text.pdf.PdfReader.PageRefsDeprecated.protected byte[]Deprecated.protected charDeprecated.protected intDeprecated.protected booleanDeprecated.protected booleanDeprecated.protected intDeprecated.protected booleanDeprecated.Deprecated.protected booleanDeprecated.protected PRTokeniserDeprecated.protected PdfDictionaryDeprecated.protected int[]Deprecated. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDeprecated.PdfReader(byte[] pdfIn) Deprecated.Reads and parses a PDF document.PdfReader(byte[] pdfIn, byte[] ownerPassword) Deprecated.Reads and parses a PDF document.Deprecated.Creates an independent duplicate.PdfReader(RandomAccessFileOrArray raf, byte[] ownerPassword) Deprecated.Reads and parses a pdf document.PdfReader(InputStream is) Deprecated.Reads and parses a PDF document.PdfReader(InputStream is, byte[] ownerPassword) Deprecated.Reads and parses a PDF document.Deprecated.Reads and parses a PDF document.Deprecated.Reads and parses a PDF document.PdfReader(String filename, Certificate certificate, Key certificateKey, String certificateKeyProvider) Deprecated.Reads and parses a PDF document.Deprecated.Reads and parses a PDF document.Deprecated.Reads and parses a PDF document. -
Method Summary
Modifier and TypeMethodDescriptionaddPdfObject(PdfObject obj) Deprecated.voidaddViewerPreference(PdfName key, PdfObject value) Deprecated.Adds a viewer preferencestatic byte[]ASCII85Decode(byte[] in) Deprecated.Decodes a stream that has the ASCII85Decode filter.static byte[]ASCIIHexDecode(byte[] in) Deprecated.Decodes a stream that has the ASCIIHexDecode filter.voidclose()Deprecated.Closes the readerbyte[]Deprecated.voidDeprecated.Replaces all the local named links with the actual destinations.static PdfObjectconvertPdfNull(PdfObject obj) Deprecated.If given object is instance ofPdfNull, thennullis returned.intDeprecated.Finds all the fonts not subset but embedded and marks them as subset.static byte[]decodePredictor(byte[] in, PdfObject dicPar) Deprecated.doubledumpPerc()Deprecated.protected static PdfDictionaryduplicatePdfDictionary(PdfDictionary original, PdfDictionary copy, PdfReader newReader) Deprecated.protected static PdfObjectduplicatePdfObject(PdfObject original, PdfReader newReader) Deprecated.voidDeprecated.Eliminates shared streams if they exist.static byte[]FlateDecode(byte[] in) Deprecated.Decodes a stream that has the FlateDecode filter.static byte[]FlateDecode(byte[] in, boolean strict) Deprecated.A helper to FlateDecode.Deprecated.Gets a read-only version ofAcroFields.Deprecated.Returns the document's acroform, if it has one.getBoxSize(int index, String boxName) Deprecated.Gets the box size.Deprecated.Returns the document's catalog.intDeprecated.Gets the certification level for this document.getCropBox(int index) Deprecated.Gets the crop box without taking rotation into account.intDeprecated.byte[]Deprecated.Returns a permanent document identifier extracted from trailer /ID entry, when presentintDeprecated.Gets the byte address of the %%EOF marker.intDeprecated.Getter for property fileLength.getInfo()Deprecated.Returns the content of the document information dictionary as aHashMapofString.Deprecated.Gets the global document JavaScript.Deprecated.Gets the global document JavaScript.intDeprecated.Gets the byte address of the last xref table.getLinks(int page) Deprecated.byte[]Deprecated.Gets the XML metadata.Deprecated.Gets all the named destinations as anHashMap.getNamedDestination(boolean keepNames) Deprecated.Gets all the named destinations as anHashMap.Deprecated.Gets the named destinations from the /Dests key in the catalog as anHashMap.getNamedDestinationFromNames(boolean keepNames) Deprecated.Gets the named destinations from the /Dests key in the catalog as anHashMap.Deprecated.Gets the named destinations from the /Names key in the catalog as anHashMap.static RectangleDeprecated.Normalizes aRectangleso that llx and lly are smaller than urx and ury.intDeprecated.Gets the number of pages in the document.byte[]getPageContent(int pageNum) Deprecated.Gets the contents of the page.byte[]getPageContent(int pageNum, RandomAccessFileOrArray file) Deprecated.Gets the contents of the page.getPageN(int pageNum) Deprecated.Gets the dictionary that represents a page.getPageNRelease(int pageNum) Deprecated.getPageOrigRef(int pageNum) Deprecated.Gets the page reference to this page.intgetPageRotation(int index) Deprecated.Gets the page rotation.getPageSize(int index) Deprecated.Gets the page size without taking rotation into account.getPageSize(PdfDictionary page) Deprecated.Gets the page from a page dictionarygetPageSizeWithRotation(int index) Deprecated.Gets the page size, taking rotation into account.getPageSizeWithRotation(int index, String boxName) Deprecated.Gets the page size, taking rotation into account.Deprecated.Gets the rotated page from a page dictionary.getPdfObject(int idx) Deprecated.static PdfObjectgetPdfObject(PdfObject obj) Deprecated.Reads aPdfObjectresolving an indirect reference if needed.static PdfObjectgetPdfObject(PdfObject obj, PdfObject parent) Deprecated.static PdfObjectgetPdfObjectNullConverting(PdfObject obj, PdfObject parent) Deprecated.ReturnsgetPdfObject(PdfObject, PdfObject)with appliedconvertPdfNull(PdfObject).getPdfObjectRelease(int idx) Deprecated.static PdfObjectDeprecated.static PdfObjectgetPdfObjectRelease(PdfObject obj, PdfObject parent) Deprecated.Reads aPdfObjectresolving an indirect reference if needed.static PdfObjectDeprecated.ReturnsgetPdfObjectRelease(PdfObject)with appliedconvertPdfNull(PdfObject).protected com.lowagie.text.pdf.PdfReaderInstancegetPdfReaderInstance(PdfWriter writer) Deprecated.charDeprecated.Gets the PDF version.intDeprecated.Gets the encryption permissions.Deprecated.Gets a new file instance of the original PDF document.intDeprecated.Returns a bitset representing the PageMode and PageLayout viewer preferences.static byte[]getStreamBytes(PRStream stream) Deprecated.Get the content from a stream applying the required filters.static byte[]getStreamBytes(PRStream stream, RandomAccessFileOrArray file) Deprecated.Get the content from a stream applying the required filters.static byte[]getStreamBytesRaw(PRStream stream) Deprecated.Get the content from a stream as it is without applying any filter.static byte[]getStreamBytesRaw(PRStream stream, RandomAccessFileOrArray file) Deprecated.Get the content from a stream as it is without applying any filter.Deprecated.Gets the trailer dictionaryintDeprecated.Gets the number of xref objects.booleanis128Key()Deprecated.Returnstrueif the PDF has a 128 bit key encryption.booleanDeprecated.Getter for property appendable.booleanDeprecated.Returnstrueif the PDF is encrypted.booleanDeprecated.Getter for property hybridXref.booleanDeprecated.booleanDeprecated.Checks if an encrypted document may be modified if the owner password was not supplied.booleanDeprecated.Getter for property newXrefType.final booleanDeprecated.Checks if the document was opened with the owner password so that the end application can decide what level of access restrictions to apply.booleanDeprecated.Returnstrueif the owner password has been used to open the document.booleanDeprecated.Checks if the document had errors and was rebuilt.booleanDeprecated.Checks if the document was changed.static PdfObjectkillIndirect(PdfObject obj) Deprecated.Eliminates the reference to the object freeing the memory used by it and clearing the xref entry.protected voidDeprecated.static byte[]LZWDecode(byte[] in) Deprecated.Decodes a stream that has the LZWDecode filter.voidDeprecated.Replaces remote named links with local destinations that have the same name.protected PdfArrayDeprecated.protected PdfDictionaryDeprecated.protected voidDeprecated.protected voidDeprecated.protected voidreadObjStm(PRStream stream, IntHashtable map) Deprecated.protected PdfObjectreadOneObjStm(PRStream stream, int idx) Deprecated.protected voidDeprecated.protected voidreadPdf()Deprecated.protected voidDeprecated.protected PdfObjectDeprecated.protected PdfObjectreadSingleObject(int k) Deprecated.protected voidreadXref()Deprecated.protected PdfDictionaryDeprecated.protected booleanreadXRefStream(int ptr) Deprecated.protected voidDeprecated.voidDeprecated.static voidDeprecated.voidreleasePage(int pageNum) Deprecated.voidDeprecated.Removes all the annotations and fields from the document.voidDeprecated.Removes all the fields from the document.protected voidremoveUnusedNode(PdfObject obj, boolean[] hits) Deprecated.intDeprecated.Removes all the unreachable objects.voidDeprecated.Removes any usage rights that this PDF may have.voidDeprecated.voidDeprecated.voidselectPages(String ranges) Deprecated.Selects the pages to keep in the document.voidselectPages(List<Integer> pagesToKeep) Deprecated.Selects the pages to keep in the document.voidsetAppendable(boolean appendable) Deprecated.Setter for property appendable.voidsetModificationAllowedWithoutOwnerPassword(boolean modificationAllowedWithoutOwnerPassword) Deprecated.Sets whether the document (if encrypted) may be modified even if the owner password was not supplied.voidsetPageContent(int pageNum, byte[] content) Deprecated.Sets the contents of the page.voidsetPageContent(int pageNum, byte[] content, int compressionLevel) Deprecated.Sets the contents of the page.voidsetPermissions(int permissionValue) Deprecated.voidsetTampered(boolean tampered) Deprecated.Sets the tampered state.voidsetViewerPreferences(int preferences) Deprecated.Sets the viewer preferences as the sum of several constants.intDeprecated.Finds all the font subsets and changes the prefixes to some random values.
-
Field Details
-
tokens
Deprecated. -
xref
protected int[] xrefDeprecated. -
objStmMark
Deprecated. -
objStmToOffset
Deprecated. -
newXrefType
protected boolean newXrefTypeDeprecated. -
trailer
Deprecated. -
catalog
Deprecated. -
pageRefs
protected com.lowagie.text.pdf.PdfReader.PageRefs pageRefsDeprecated. -
acroForm
Deprecated. -
acroFormParsed
protected boolean acroFormParsedDeprecated. -
encrypted
protected boolean encryptedDeprecated. -
rebuilt
protected boolean rebuiltDeprecated. -
freeXref
protected int freeXrefDeprecated. -
tampered
protected boolean tamperedDeprecated. -
lastXref
protected int lastXrefDeprecated. -
eofPos
protected int eofPosDeprecated. -
pdfVersion
protected char pdfVersionDeprecated. -
decrypt
Deprecated. -
password
protected byte[] passwordDeprecated. -
certificateKey
Deprecated. -
certificate
Deprecated. -
certificateKeyProvider
Deprecated. -
strings
Deprecated. -
consolidateNamedDestinations
protected boolean consolidateNamedDestinationsDeprecated. -
remoteToLocalNamedDestinations
protected boolean remoteToLocalNamedDestinationsDeprecated. -
rValue
protected int rValueDeprecated. -
pValue
protected int pValueDeprecated.
-
-
Constructor Details
-
PdfReader
protected PdfReader()Deprecated. -
PdfReader
Deprecated.Reads and parses a PDF document.- Parameters:
filename- the file name of the document- Throws:
IOException- on error
-
PdfReader
Deprecated.Reads and parses a PDF document.- Parameters:
filename- the file name of the documentownerPassword- the password to read the document- Throws:
IOException- on error
-
PdfReader
Deprecated.Reads and parses a PDF document.- Parameters:
pdfIn- the byte array with the document- Throws:
IOException- on error
-
PdfReader
Deprecated.Reads and parses a PDF document.- Parameters:
pdfIn- the byte array with the documentownerPassword- the password to read the document- Throws:
IOException- on error
-
PdfReader
public PdfReader(String filename, Certificate certificate, Key certificateKey, String certificateKeyProvider) throws IOException Deprecated.Reads and parses a PDF document.- Parameters:
filename- the file name of the documentcertificate- the certificate to read the documentcertificateKey- the private key of the certificatecertificateKeyProvider- the security provider for certificateKey- Throws:
IOException- on error
-
PdfReader
Deprecated.Reads and parses a PDF document.- Parameters:
url- the URL of the document- Throws:
IOException- on error
-
PdfReader
Deprecated.Reads and parses a PDF document.- Parameters:
url- the URL of the documentownerPassword- the password to read the document- Throws:
IOException- on error
-
PdfReader
Deprecated.Reads and parses a PDF document.- Parameters:
is- theInputStreamcontaining the document. The stream is read to the end but is not closedownerPassword- the password to read the document- Throws:
IOException- on error
-
PdfReader
Deprecated.Reads and parses a PDF document.- Parameters:
is- theInputStreamcontaining the document. The stream is read to the end but is not closed- Throws:
IOException- on error
-
PdfReader
Deprecated.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 withPdfReader.close(), reopen is automatic.- Parameters:
raf- the document locationownerPassword- the password ornullfor no password- Throws:
IOException- on error
-
PdfReader
Deprecated.Creates an independent duplicate.- Parameters:
reader- thePdfReaderto duplicate
-
-
Method Details
-
getNormalizedRectangle
Deprecated.Normalizes aRectangleso that llx and lly are smaller than urx and ury.- Parameters:
box- the original rectangle- Returns:
- a normalized
Rectangle
-
getPdfObjectRelease
Deprecated.- Parameters:
obj- an object ofPdfObject- Returns:
- a PdfObject
-
convertPdfNull
Deprecated.If given object is instance ofPdfNull, thennullis returned. The provided object otherwise.- Parameters:
obj- object to convert- Returns:
- provided object or null
-
getPdfObjectReleaseNullConverting
Deprecated.ReturnsgetPdfObjectRelease(PdfObject)with appliedconvertPdfNull(PdfObject). -
getPdfObject
Deprecated.Reads aPdfObjectresolving an indirect reference if needed.- Parameters:
obj- thePdfObjectto read- Returns:
- the resolved
PdfObject
-
getPdfObjectRelease
Deprecated.Reads aPdfObjectresolving an indirect reference if needed. If the reader was opened in partial mode the object will be released to save memory.- Parameters:
obj- thePdfObjectto readparent- parent object- Returns:
- a PdfObject
-
getPdfObject
Deprecated.- Parameters:
obj- thePdfObjectto readparent- parent object- Returns:
- a PdfObject
-
getPdfObjectNullConverting
Deprecated.ReturnsgetPdfObject(PdfObject, PdfObject)with appliedconvertPdfNull(PdfObject). -
releaseLastXrefPartial
Deprecated.- Parameters:
obj- an object ofPdfObject
-
killIndirect
Deprecated.Eliminates the reference to the object freeing the memory used by it and clearing the xref entry.- Parameters:
obj- the object. If it's an indirect reference it will be eliminated- Returns:
- the object or the already erased dereferenced object
-
FlateDecode
public static byte[] FlateDecode(byte[] in) Deprecated.Decodes a stream that has the FlateDecode filter.- Parameters:
in- the input data- Returns:
- the decoded data
-
decodePredictor
Deprecated.- Parameters:
in- the input datadicPar- an object ofPdfObject- Returns:
- a byte array
-
FlateDecode
public static byte[] FlateDecode(byte[] in, boolean strict) Deprecated.A helper to FlateDecode.- Parameters:
in- the input datastrict-trueto read a correct stream.falseto try to read a corrupted stream- Returns:
- the decoded data
-
ASCIIHexDecode
public static byte[] ASCIIHexDecode(byte[] in) Deprecated.Decodes a stream that has the ASCIIHexDecode filter.- Parameters:
in- the input data- Returns:
- the decoded data
-
ASCII85Decode
public static byte[] ASCII85Decode(byte[] in) Deprecated.Decodes a stream that has the ASCII85Decode filter.- Parameters:
in- the input data- Returns:
- the decoded data
-
LZWDecode
public static byte[] LZWDecode(byte[] in) Deprecated.Decodes a stream that has the LZWDecode filter.- Parameters:
in- the input data- Returns:
- the decoded data
-
getStreamBytes
public static byte[] getStreamBytes(PRStream stream, RandomAccessFileOrArray file) throws IOException Deprecated.Get the content from a stream applying the required filters.- Parameters:
stream- the streamfile- the location where the stream is- Returns:
- the stream content
- Throws:
IOException- on error
-
getStreamBytes
Deprecated.Get the content from a stream applying the required filters.- Parameters:
stream- the stream- Returns:
- the stream content
- Throws:
IOException- on error
-
getStreamBytesRaw
public static byte[] getStreamBytesRaw(PRStream stream, RandomAccessFileOrArray file) throws IOException Deprecated.Get the content from a stream as it is without applying any filter.- Parameters:
stream- the streamfile- the location where the stream is- Returns:
- the stream content
- Throws:
IOException- on error
-
getStreamBytesRaw
Deprecated.Get the content from a stream as it is without applying any filter.- Parameters:
stream- the stream- Returns:
- the stream content
- Throws:
IOException- on error
-
duplicatePdfDictionary
protected static PdfDictionary duplicatePdfDictionary(PdfDictionary original, PdfDictionary copy, PdfReader newReader) Deprecated. -
duplicatePdfObject
Deprecated. -
getSafeFile
Deprecated.Gets a new file instance of the original PDF document.- Returns:
- a new file instance of the original PDF document
-
getPdfReaderInstance
Deprecated. -
getNumberOfPages
public int getNumberOfPages()Deprecated.Gets the number of pages in the document.- Returns:
- the number of pages in the document
-
getCatalog
Deprecated.Returns the document's catalog. This dictionary is not a copy, any changes will be reflected in the catalog.- Returns:
- the document's catalog
-
getAcroForm
Deprecated.Returns the document's acroform, if it has one.- Returns:
- the document's acroform
-
getPageRotation
public int getPageRotation(int index) Deprecated.Gets the page rotation. This value can be 0, 90, 180 or 270.- Parameters:
index- the page number. The first page is 1- Returns:
- the page rotation
-
getPageSizeWithRotation
Deprecated.Gets the page size, taking rotation into account. This is aRectanglewith the value of the /MediaBox and the /Rotate key.- Parameters:
index- the page number. The first page is 1- Returns:
- a
Rectangle
-
getPageSizeWithRotation
Deprecated.Gets the rotated page from a page dictionary.- Parameters:
page- the page dictionary- Returns:
- the rotated page or null when the page does not exists
-
getPageSizeWithRotation
Deprecated.Gets the page size, taking rotation into account. This is aRectanglewith the value of a an arbitrary box and the /Rotate key.- Parameters:
index- the page number. The first page is 1boxName- of the rotated box. Allowed names are: "crop", "trim", "art", "bleed" and "media".- Returns:
- a
Rectangleor null if the page does not exist
-
getPageSize
Deprecated.Gets the page size without taking rotation into account. This is the value of the /MediaBox key.- Parameters:
index- the page number. The first page is 1- Returns:
- the page size
-
getPageSize
Deprecated.Gets the page from a page dictionary- Parameters:
page- the page dictionary- Returns:
- the page
-
getCropBox
Deprecated.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.- Parameters:
index- the page number. The first page is 1- Returns:
- the crop box
-
getBoxSize
Deprecated.Gets the box size. Allowed names are: "crop", "trim", "art", "bleed" and "media".- Parameters:
index- the page number. The first page is 1boxName- the box name- Returns:
- the box rectangle or null
-
getInfo
Deprecated.Returns the content of the document information dictionary as aHashMapofString.- Returns:
- content of the document information dictionary
-
readPdf
Deprecated.- Throws:
IOException
-
readPdfPartial
Deprecated.- Throws:
IOException
-
getPdfObjectRelease
Deprecated.- Parameters:
idx- index- Returns:
- a PdfObject
-
getPdfObject
Deprecated.- Parameters:
idx- index- Returns:
- aPdfObject
-
resetLastXrefPartial
public void resetLastXrefPartial()Deprecated. -
releaseLastXrefPartial
public void releaseLastXrefPartial()Deprecated. -
addPdfObject
Deprecated.- Parameters:
obj- an object ofPdfObject- Returns:
- an indirect reference
-
readPages
Deprecated.- Throws:
IOException
-
readDocObjPartial
Deprecated.- Throws:
IOException
-
readSingleObject
Deprecated.- Throws:
IOException
-
readOneObjStm
Deprecated.- Throws:
IOException
-
dumpPerc
public double dumpPerc()Deprecated.- Returns:
- the percentage of the cross reference table that has been read
-
readDocObj
Deprecated.- Throws:
IOException
-
readObjStm
Deprecated.- Throws:
IOException
-
readXref
Deprecated.- Throws:
IOException
-
readXrefSection
Deprecated.- Throws:
IOException
-
readXRefStream
Deprecated.- Throws:
IOException
-
rebuildXref
Deprecated.- Throws:
IOException
-
readDictionary
Deprecated.- Throws:
IOException
-
readArray
Deprecated.- Throws:
IOException
-
readPRObject
Deprecated.- Throws:
IOException
-
isRebuilt
public boolean isRebuilt()Deprecated.Checks if the document had errors and was rebuilt.- Returns:
- true if rebuilt.
-
getPageN
Deprecated.Gets the dictionary that represents a page.- Parameters:
pageNum- the page number. 1 is the first- Returns:
- the page dictionary or null when the page does not exist
-
getPageNRelease
Deprecated.- Parameters:
pageNum- page number- Returns:
- a Dictionary object
-
releasePage
public void releasePage(int pageNum) Deprecated.- Parameters:
pageNum- page number
-
resetReleasePage
public void resetReleasePage()Deprecated. -
getPageOrigRef
Deprecated.Gets the page reference to this page.- Parameters:
pageNum- the page number. 1 is the first- Returns:
- the page reference
-
getPageContent
Deprecated.Gets the contents of the page.- Parameters:
pageNum- the page number. 1 is the firstfile- the location of the PDF document- Returns:
- the content
- Throws:
IOException- on error
-
getPageContent
Deprecated.Gets the contents of the page.- Parameters:
pageNum- the page number. 1 is the first- Returns:
- the content
- Throws:
IOException- on error
-
killXref
Deprecated. -
setPageContent
public void setPageContent(int pageNum, byte[] content) Deprecated.Sets the contents of the page.- Parameters:
pageNum- the page number. 1 is the firstcontent- the new page content
-
setPageContent
public void setPageContent(int pageNum, byte[] content, int compressionLevel) Deprecated.Sets the contents of the page.- Parameters:
pageNum- the page number. 1 is the firstcontent- the new page contentcompressionLevel- compression level- Since:
- 2.1.3 (the method already existed without param compressionLevel)
-
isTampered
public boolean isTampered()Deprecated.Checks if the document was changed.- Returns:
trueif the document was changed,falseotherwise
-
setTampered
public void setTampered(boolean tampered) Deprecated.Sets the tampered state. A tampered PdfReader cannot be reused in PdfStamper.- Parameters:
tampered- the tampered state
-
getMetadata
Deprecated.Gets the XML metadata.- Returns:
- the XML metadata
- Throws:
IOException- on error
-
getLastXref
public int getLastXref()Deprecated.Gets the byte address of the last xref table.- Returns:
- the byte address of the last xref table
-
getXrefSize
public int getXrefSize()Deprecated.Gets the number of xref objects.- Returns:
- the number of xref objects
-
getEofPos
public int getEofPos()Deprecated.Gets the byte address of the %%EOF marker.- Returns:
- the byte address of the %%EOF marker
-
getPdfVersion
public char getPdfVersion()Deprecated.Gets the PDF version. Only the last version char is returned. For example version 1.4 is returned as '4'.- Returns:
- the PDF version
-
isEncrypted
public boolean isEncrypted()Deprecated.Returnstrueif the PDF is encrypted.- Returns:
trueif the PDF is encrypted
-
isOwnerPasswordUsed
public boolean isOwnerPasswordUsed()Deprecated.Returnstrueif the owner password has been used to open the document.- Returns:
trueif the owner password has been used to open the document.
-
getPermissions
public int getPermissions()Deprecated.Gets the encryption permissions. It can be used directly inPdfWriter.setEncryption().- Returns:
- the encryption permissions
-
setPermissions
public void setPermissions(int permissionValue) Deprecated. -
is128Key
public boolean is128Key()Deprecated.Returnstrueif the PDF has a 128 bit key encryption.- Returns:
trueif the PDF has a 128 bit key encryption
-
getTrailer
Deprecated.Gets the trailer dictionary- Returns:
- the trailer dictionary
-
shuffleSubsetNames
public int shuffleSubsetNames()Deprecated.Finds all the font subsets and changes the prefixes to some random values.- Returns:
- the number of font subsets altered
-
createFakeFontSubsets
public int createFakeFontSubsets()Deprecated.Finds all the fonts not subset but embedded and marks them as subset.- Returns:
- the number of fonts altered
-
getNamedDestination
Deprecated.Gets all the named destinations as anHashMap. The key is the name and the value is the destinations array.- Returns:
- gets all the named destinations
-
getNamedDestination
Deprecated.Gets all the named destinations as anHashMap. The key is the name and the value is the destinations array.- Parameters:
keepNames- true if you want the keys to be real PdfNames instead of Strings- Returns:
- gets all the named destinations
- Since:
- 2.1.6
-
getNamedDestinationFromNames
Deprecated.Gets the named destinations from the /Dests key in the catalog as anHashMap. The key is the name and the value is the destinations array.- Returns:
- gets the named destinations
-
getNamedDestinationFromNames
Deprecated.Gets the named destinations from the /Dests key in the catalog as anHashMap. The key is the name and the value is the destinations array.- Parameters:
keepNames- true if you want the keys to be real PdfNames instead of Strings- Returns:
- gets the named destinations
- Since:
- 2.1.6
-
getNamedDestinationFromStrings
Deprecated.Gets the named destinations from the /Names key in the catalog as anHashMap. The key is the name and the value is the destinations array.- Returns:
- gets the named destinations
-
removeFields
public void removeFields()Deprecated.Removes all the fields from the document. -
removeAnnotations
public void removeAnnotations()Deprecated.Removes all the annotations and fields from the document. -
getLinks
Deprecated. -
makeRemoteNamedDestinationsLocal
public void makeRemoteNamedDestinationsLocal()Deprecated.Replaces remote named links with local destinations that have the same name.- Since:
- 5.0
-
consolidateNamedDestinations
public void consolidateNamedDestinations()Deprecated.Replaces all the local named links with the actual destinations. -
close
public void close()Deprecated.Closes the reader- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
removeUnusedNode
Deprecated. -
removeUnusedObjects
public int removeUnusedObjects()Deprecated.Removes all the unreachable objects.- Returns:
- the number of indirect objects removed
-
getAcroFields
Deprecated.Gets a read-only version ofAcroFields.- Returns:
- a read-only version of
AcroFields
-
getJavaScript
Deprecated.Gets the global document JavaScript.- Parameters:
file- the document file- Returns:
- the global document JavaScript
- Throws:
IOException- on error
-
getJavaScript
Deprecated.Gets the global document JavaScript.- Returns:
- the global document JavaScript
- Throws:
IOException- on error
-
selectPages
Deprecated.Selects the pages to keep in the document. The pages are described as ranges. The page ordering can be changed but no page repetitions are allowed. Note that it may be very slow in partial mode.- Parameters:
ranges- the comma separated ranges as described inSequenceList
-
selectPages
Deprecated.Selects the pages to keep in the document. The pages are described as aListofInteger. The page ordering can be changed but no page repetitions are allowed. Note that it may be very slow in partial mode.- Parameters:
pagesToKeep- the pages to keep in the document
-
setViewerPreferences
public void setViewerPreferences(int preferences) Deprecated.Sets the viewer preferences as the sum of several constants.- Specified by:
setViewerPreferencesin interfacePdfViewerPreferences- Parameters:
preferences- the viewer preferences- See Also:
-
addViewerPreference
Deprecated.Adds a viewer preference- Specified by:
addViewerPreferencein interfacePdfViewerPreferences- Parameters:
key- a key for a viewer preferencevalue- a value for the viewer preference- See Also:
-
getSimpleViewerPreferences
public int getSimpleViewerPreferences()Deprecated.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()Deprecated.Getter for property appendable.- Returns:
- Value of property appendable.
-
setAppendable
public void setAppendable(boolean appendable) Deprecated.Setter for property appendable.- Parameters:
appendable- New value of property appendable.
-
isNewXrefType
public boolean isNewXrefType()Deprecated.Getter for property newXrefType.- Returns:
- Value of property newXrefType.
-
getFileLength
public int getFileLength()Deprecated.Getter for property fileLength.- Returns:
- Value of property fileLength.
-
isHybridXref
public boolean isHybridXref()Deprecated.Getter for property hybridXref.- Returns:
- Value of property hybridXref.
-
removeUsageRights
public void removeUsageRights()Deprecated.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()Deprecated.Gets the certification level for this document. The return values can bePdfSignatureAppearance.NOT_CERTIFIED,PdfSignatureAppearance.CERTIFIED_NO_CHANGES_ALLOWED,PdfSignatureAppearance.CERTIFIED_FORM_FILLINGandPdfSignatureAppearance.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
-
isModificationlowedWithoutOwnerPassword
public boolean isModificationlowedWithoutOwnerPassword()Deprecated.Checks if an encrypted document may be modified if the owner password was not supplied. If the document is not encrypted, the setting has no effect.- Returns:
trueif the document may be modified even if the owner password was not suppliedfalseotherwise
-
setModificationAllowedWithoutOwnerPassword
public void setModificationAllowedWithoutOwnerPassword(boolean modificationAllowedWithoutOwnerPassword) Deprecated.Sets whether the document (if encrypted) may be modified even if the owner password was not supplied. If this is set tofalsean exception will be thrown when attempting to access the Document if the owner password was not supplied (for encrypted documents.)- Parameters:
modificationAllowedWithoutOwnerPassword- the modificationAllowedWithoutOwnerPassword state.
-
isOpenedWithFullPermissions
public final boolean isOpenedWithFullPermissions()Deprecated.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 returntrue.- Returns:
trueif the document was opened with the owner password or if it's not encrypted or the modificationAllowedWithoutOwnerPassword flag is set,falseotherwise.
-
getCryptoMode
public int getCryptoMode()Deprecated. -
isMetadataEncrypted
public boolean isMetadataEncrypted()Deprecated. -
computeUserPassword
public byte[] computeUserPassword()Deprecated. -
getDocumentId
public byte[] getDocumentId()Deprecated.Returns a permanent document identifier extracted from trailer /ID entry, when present- Returns:
- byte array representing the document permanent identifier
-