|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.intarsys.pdf.st.STDocument
public class STDocument
The most physical abstraction of a PDF document. This object handles the random access representation of the PDF file.
An STDocument manages the cross ref access to data stream positions from COS level objects. As such the ST and the COS package are highly interdependent.
Field Summary | |
---|---|
static STDocType |
DOCTYPE_FDF
our current fdf version number * |
static STDocType |
DOCTYPE_PDF
our current pdf version number * |
static String |
OPTION_WRITEMODEHINT
|
Method Summary | |
---|---|
void |
addChangedReference(COSIndirectObject object)
Mark object as changed within this document. |
void |
addObjectReference(COSIndirectObject newRef)
Add another indirect object to the document. |
void |
close()
Close the document. |
STDocument |
copyDeep()
Return a deep copy of the document. |
COSDictionary |
cosGetTrailer()
The documents trailer dictionary |
static STDocument |
createFromLocator(ILocator locator)
Create a new document representing the data referenced by locator. |
static STDocument |
createNew()
create a new empty pdf document. |
static STDocument |
createNew(STDocType docType)
create a new empty document. |
STXRefSection |
createNewXRefSection()
|
COSObjectKey |
createObjectKey()
Create a new valid key for use in the document. |
void |
garbageCollect()
Start a garbage collection for the receiver. |
Object |
getAccessLock()
|
Collection |
getChanges()
|
COSDocument |
getDoc()
|
STDocType |
getDocType()
|
int |
getIncrementalCount()
|
COSDictionary |
getLinearizedDict()
The /Linearized dictionary of the document. |
ILocator |
getLocator()
THe locator for the document data. |
String |
getName()
A name for the document. |
COSIndirectObject |
getObjectReference(COSObjectKey key)
The indirect object with object number objNum and generation number genNum is looked up in the document. |
COSDocumentParser |
getParser()
The parser used for decoding the document data stream. |
IRandomAccess |
getRandomAccess()
The random access object for the documents data. |
ISystemSecurityHandler |
getSystemSecurityHandler()
The documents security handler |
COSTrailer |
getTrailer()
|
String |
getVersion()
The version of the PDF spec for this document |
EnumWriteMode |
getWriteModeHint()
The write mode to be used when the document is written the next time. |
STXRefSection |
getXRefSection()
The most recent STXrefSection of the document. |
void |
incrementalGarbageCollect()
|
boolean |
isClosed()
|
boolean |
isDirty()
true if this has been changed. |
boolean |
isEncrypted()
|
boolean |
isLinearized()
true if this document is linearized. |
boolean |
isNew()
|
boolean |
isReadOnly()
true if this is read only. |
boolean |
isStreamed()
true if this has only streamed xref sections. |
COSObject |
load(COSIndirectObject ref)
Load a COSObject from the documents data. |
void |
loadAll()
|
int |
loadedSize()
The number of objects currently loaded. |
Iterator |
objects()
An iterator on the indirect objects of the storage layer document. |
void |
reparseFromLocator()
Reparses the XREF sections without actually instantiating. |
void |
restore(ILocator newLocator)
|
void |
save()
|
void |
save(ILocator pLocator)
|
void |
save(ILocator pLocator,
Map options)
|
void |
setDirty(boolean dirty)
Set the change flag of this. |
void |
setDoc(COSDocument doc)
|
void |
setName(String name)
Rename the document locally. |
void |
setWriteModeHint(EnumWriteMode writeMode)
The write mode to be used when the document is written the next time. |
void |
setXRefSection(STXRefSection xRefSection)
Attach the most recent x ref section to the document. |
void |
updateModificationDate()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final STDocType DOCTYPE_FDF
public static final STDocType DOCTYPE_PDF
public static final String OPTION_WRITEMODEHINT
Method Detail |
---|
public static STDocument createFromLocator(ILocator locator) throws IOException, COSLoadException
locator
- The locator to the documents data
IOException
COSLoadException
public static STDocument createNew()
public static STDocument createNew(STDocType docType)
public void addChangedReference(COSIndirectObject object)
object
- The object that is new or changedpublic void addObjectReference(COSIndirectObject newRef)
newRef
- The new indirect object.public void close() throws IOException
close
.
IOException
public STDocument copyDeep()
public COSDictionary cosGetTrailer()
public STXRefSection createNewXRefSection()
public COSObjectKey createObjectKey()
public void garbageCollect()
public Object getAccessLock()
public Collection getChanges()
public COSDocument getDoc()
public STDocType getDocType()
public int getIncrementalCount()
public ILocator getLocator()
getLocator
in interface ILocatorSupport
public String getName()
This is either a "local" name or the name of the locator reference if present.
public COSIndirectObject getObjectReference(COSObjectKey key)
key
-
public COSDocumentParser getParser()
public IRandomAccess getRandomAccess()
public ISystemSecurityHandler getSystemSecurityHandler()
public COSTrailer getTrailer()
public String getVersion()
public EnumWriteMode getWriteModeHint()
public STXRefSection getXRefSection()
public void incrementalGarbageCollect()
public boolean isClosed()
public boolean isDirty()
true
if this has been changed.
true
if this has been changed.public boolean isEncrypted()
ISystemSecurityHandler
public boolean isNew()
public boolean isReadOnly()
true
if this is read only.
true
if this is read only.public boolean isStreamed()
true
if this has only streamed xref sections.
true
if this has only streamed xref sections.public COSObject load(COSIndirectObject ref) throws IOException, COSLoadException
ref
- The object reference to be loaded.
IOException
COSLoadException
public void loadAll() throws IOException, COSLoadException
IOException
COSLoadException
public int loadedSize()
public Iterator objects()
public void reparseFromLocator() throws IOException, COSLoadException
IOException
COSLoadException
public void restore(ILocator newLocator) throws IOException, COSLoadException
IOException
COSLoadException
public void save() throws IOException
IOException
public void save(ILocator pLocator) throws IOException
IOException
public void save(ILocator pLocator, Map options) throws IOException
IOException
public void setDirty(boolean dirty)
dirty
- true
if this should be marked as changedpublic void setDoc(COSDocument doc)
public void setName(String name)
This has no effect if a locator is present.
name
- The new local name of thispublic void setWriteModeHint(EnumWriteMode writeMode)
writeMode
- The write mode to be used when the document is written.public void setXRefSection(STXRefSection xRefSection)
xRefSection
- The x ref section representing the most recent document
changes.public void updateModificationDate()
public boolean isLinearized()
true
if this document is linearized.
When linearized reading is truly implemented, this check should be made using the document length instead for performance reasons.
true
if this document is linearized.public COSDictionary getLinearizedDict()
Note that this method may NOT return a dictionary even if the document contains a /Linearized dictionary as the first object. This is the case when the document was linearized and was written with an incremental change so that the linearization is obsolete.
|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |