|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.icepdf.core.util.Library
public class Library
The Library class acts a central repository for the access
of PDF objects in a document. The Library class has many utility methods
which are designed to access PDF objects as easily as possible. The
Library class has direct access to the PDF file and loads the
needed objects from the file system when needed.
| Field Summary | |
|---|---|
CacheManager |
cacheManager
|
MemoryManager |
memoryManager
|
SecurityManager |
securityManager
|
StateManager |
stateManager
|
| Constructor Summary | |
|---|---|
Library()
Creates a new instance of a Library. |
|
| Method Summary | |
|---|---|
void |
addObject(java.lang.Object object,
Reference objectReference)
Adds a PDF object and its respective object reference to the library. |
void |
dispose()
Dispose the library's resources. |
void |
disposeFontResources()
Utility/demo functionality to clear all font and font descriptor resources. |
java.lang.Boolean |
getBoolean(java.util.Hashtable dictionaryEntries,
java.lang.String key)
Gets a Boolean specified by the key in the dictionary
entries. |
CacheManager |
getCacheManager()
Gets the library cache manager. |
Catalog |
getCatalog()
Gets the document's catalog. |
java.util.Hashtable |
getDictionary(java.util.Hashtable dictionaryEntries,
java.lang.String key)
Gets a dictionary specified by the key in the dictionary
entries. |
float |
getFloat(java.util.Hashtable dictionaryEntries,
java.lang.String key)
Gets a float specified by the key in the dictionary
entries. |
ICCBased |
getICCBased(Reference ref)
The Reference is to the Stream from which the ICC color space data is to be parsed. |
int |
getInt(java.util.Hashtable dictionaryEntries,
java.lang.String key)
Gets an int specified by the key in the dictionary
entries. |
long |
getLong(java.util.Hashtable dictionaryEntries,
java.lang.String key)
Gets a float specified by the key in the dictionary
entries. |
java.lang.String |
getName(java.util.Hashtable dictionaryEntries,
java.lang.String key)
Gets a Name specified by the key in the dictionary
entries. |
java.lang.Number |
getNumber(java.util.Hashtable dictionaryEntries,
java.lang.String key)
Gets a Number specified by the key in the dictionary
entries. |
java.lang.Object |
getObject(java.util.Hashtable dictionaryEntries,
java.lang.String key)
Gets the PDF object specified by the key in the dictionary
entries. |
java.lang.Object |
getObject(java.lang.Object referenceObject)
Gets the PDF object that the referenceObject references. |
java.lang.Object |
getObject(Reference reference)
Gets the object specified by the reference. |
Reference |
getObjectReference(java.util.Hashtable dictionaryEntries,
java.lang.String key)
Gets the PDF object specified by the key in the dictionary
entries. |
java.awt.geom.Rectangle2D.Float |
getRectangle(java.util.Hashtable dictionaryEntries,
java.lang.String key)
Gets a rectangle specified by the key. |
Reference |
getReference(java.util.Hashtable dictionaryEntries,
java.lang.String key)
Gets the reference association of the key if any. |
Resources |
getResources(java.util.Hashtable dictionaryEntries,
java.lang.String key)
|
Resources |
getResources(Reference reference)
|
SecurityManager |
getSecurityManager()
Gets the document's security manger. |
StateManager |
getStateManager()
Gets the state manager class which keeps track of changes PDF objects. |
PTrailer |
getTrailerByFilePosition(long position)
Gets the document's trailer. |
boolean |
isEncrypted()
Indicates that document is encrypted using Adobe Standard Encryption. |
boolean |
isLinearTraversal()
There are several implications from using linear traversal, which affect how we parse the PDF objects, and maintain them in memory, so those sections of code need to check this flag here. |
boolean |
isReference(java.util.Hashtable dictionaryEntries,
java.lang.String key)
Test to see if the given key is a reference and not an inline dictinary |
boolean |
isValidEntry(java.util.Hashtable dictionaryEntries,
java.lang.String key)
Tests if the given key will return a non-null PDF object from the specified dictionary entries. |
boolean |
isValidEntry(Reference reference)
Tests if there exists a cross-reference entry for this reference. |
void |
removeObject(Reference objetReference)
Removes an object from from the library. |
void |
setCatalog(Catalog c)
Sets the document's catalog. |
void |
setEncrypted(boolean flag)
Set the document is encrypted flag. |
void |
setLazyObjectLoader(LazyObjectLoader lol)
Sets a document loader for the library. |
void |
setLinearTraversal()
When we fail to load the required xref tables or streams that are needed to access the objects in the PDF, then we simply go to the beginning of the file and read in all of the objects into memory, which we call linear traversal. |
void |
setStateManager(StateManager stateManager)
Sets the document state manager so that all object can access the state manager via the central library instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public MemoryManager memoryManager
public CacheManager cacheManager
public SecurityManager securityManager
public StateManager stateManager
| Constructor Detail |
|---|
public Library()
| Method Detail |
|---|
public void setLazyObjectLoader(LazyObjectLoader lol)
lol - loader object.public PTrailer getTrailerByFilePosition(long position)
position - byte offset of the trailer in the PDF file.
public java.lang.Object getObject(Reference reference)
reference - reference to a PDF object in the document structure.
public java.lang.Object getObject(java.util.Hashtable dictionaryEntries,
java.lang.String key)
key in the dictionary
entries. If the key value is a reference, the object that the reference
points to is returned.
dictionaryEntries - the dictionary entries to look up the key in.key - string value representing the dictionary key.
getObjectReference(java.util.Hashtable, String)
public boolean isReference(java.util.Hashtable dictionaryEntries,
java.lang.String key)
dictionaryEntries - dictionary to testkey - dictionary key
public Reference getReference(java.util.Hashtable dictionaryEntries,
java.lang.String key)
dictionaryEntries - dictionary to search in.key - key to search for in dictionary.
public StateManager getStateManager()
public void setStateManager(StateManager stateManager)
stateManager - public java.lang.Object getObject(java.lang.Object referenceObject)
referenceObject references.
referenceObject - reference object.
referenceObject references. If
referenceObject is not an instance of a Reference, the
origional referenceObject is returned.
public boolean isValidEntry(java.util.Hashtable dictionaryEntries,
java.lang.String key)
dictionaryEntries - dictionary entrieskey - dictionary key
public boolean isValidEntry(Reference reference)
reference - reference to a PDF object in the document structure.
public java.lang.Number getNumber(java.util.Hashtable dictionaryEntries,
java.lang.String key)
key in the dictionary
entries. If the key value is a reference, the Number object that the
reference points to is returned.
dictionaryEntries - the dictionary entries to look up the key in.key - string value representing the dictionary key.
public java.lang.Boolean getBoolean(java.util.Hashtable dictionaryEntries,
java.lang.String key)
key in the dictionary
entries. If the key value is a reference, the Boolean object that the
reference points to is returned.
dictionaryEntries - the dictionary entries to look up the key in.key - string value representing the dictionary key.
public float getFloat(java.util.Hashtable dictionaryEntries,
java.lang.String key)
key in the dictionary
entries. If the key value is a reference, the object that the
reference points to is returned.
dictionaryEntries - the dictionary entries to look up the key in.key - string value representing the dictionary key.
public int getInt(java.util.Hashtable dictionaryEntries,
java.lang.String key)
key in the dictionary
entries. If the key value is a reference, the object that the
reference points to is returned.
dictionaryEntries - the dictionary entries to look up the key in.key - string value representing the dictionary key.
public long getLong(java.util.Hashtable dictionaryEntries,
java.lang.String key)
key in the dictionary
entries. If the key value is a reference, the object that the
reference points to is returned.
dictionaryEntries - the dictionary entries to look up the key in.key - string value representing the dictionary key.
public java.lang.String getName(java.util.Hashtable dictionaryEntries,
java.lang.String key)
key in the dictionary
entries. If the key value is a reference, the Name object that the
reference points to is returned.
dictionaryEntries - the dictionary entries to look up the key in.key - string value representing the dictionary key.
public java.util.Hashtable getDictionary(java.util.Hashtable dictionaryEntries,
java.lang.String key)
key in the dictionary
entries. If the key value is a reference, the dictionary object that the
reference points to is returned.
dictionaryEntries - the dictionary entries to look up the key in.key - string value representing the dictionary key.
public java.awt.geom.Rectangle2D.Float getRectangle(java.util.Hashtable dictionaryEntries,
java.lang.String key)
dictionaryEntries - the dictionary entries to look up the key in.key - string value representing the dictionary key.
public ICCBased getICCBased(Reference ref)
ref - Reference to Stream containing ICC color space data
public Resources getResources(java.util.Hashtable dictionaryEntries,
java.lang.String key)
public Resources getResources(Reference reference)
public void addObject(java.lang.Object object,
Reference objectReference)
object - PDF object to add.objectReference - PDF object reference object.public void removeObject(Reference objetReference)
objetReference -
public Reference getObjectReference(java.util.Hashtable dictionaryEntries,
java.lang.String key)
key in the dictionary
entries. If the key value is a reference it is returned.
dictionaryEntries - the dictionary entries to look up the key in.key - string value representing the dictionary key.
getObject(java.util.Hashtable, String)public boolean isEncrypted()
public SecurityManager getSecurityManager()
public void setEncrypted(boolean flag)
flag - true, if the document is encrypted; false, otherwize.public void setLinearTraversal()
public boolean isLinearTraversal()
public CacheManager getCacheManager()
public Catalog getCatalog()
public void setCatalog(Catalog c)
c - document catalog object.public void disposeFontResources()
public void dispose()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||