|
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.pd.PDDocument
public class PDDocument
The PD Level representation of a PDF Document. PD Level objects provide the PDF semantics on top of the COS objects.
A PDDocument object should not be shared between threads without thought. Some clients may store information along with the PDDocument extensions in a non thread safe manner.
Field Summary | |
---|---|
static Set |
CATALOG_ACTION_TRIGGERS
|
static COSName |
CN_Perms_DocMDP
|
static COSName |
CN_Perms_UR
|
static COSName |
DK_OpenAction
|
static COSName |
DK_Perms
|
Fields inherited from interface de.intarsys.pdf.pd.IAdditionalActionSupport |
---|
DK_AA |
Method Summary | |
---|---|
void |
addAction(PDAction action)
|
void |
addOpenAction(PDAction newAction)
Add a PDAction to be exceuted when this is opened. |
void |
addPageNode(PDPageNode newNode)
Add a page object to this documents root page tree. |
void |
addPageNodeAfter(PDPageNode newNode,
PDPageNode destination)
Add a page object to this document after the designated page. |
void |
close()
Close the document. |
PDDocument |
copyDeep()
Make a deep copy of the receiver. |
COSDocument |
cosGetDoc()
The COS level implementation of the document |
COSDictionary |
cosGetPermissionsDict()
The permissions dictionary of the document. |
COSDictionary |
cosGetPieceInfoDict()
The piece info dictionary of the document. |
COSDictionary |
cosGetURI()
The uri dictionary of the document. |
void |
cosSetPermissionsDict(COSDictionary permsDict)
Set the permissions dictionary of the document. |
void |
cosSetPieceInfoDict(COSDictionary dict)
Set the piece info dictionary of the document. |
PDAcroForm |
createAcroForm()
create an AcroForm in a PDF Document. |
static PDDocument |
createFromCos(COSDocument doc)
create a pd document based on a cos level object |
static PDDocument |
createFromLocator(ILocator locator)
|
static PDDocument |
createNew()
create a PDDocument from scratch |
PDPageTree |
createPageTree()
create a new page tree for this document. tha page tree must still be added to the document or a page tree to get visible. |
IAccessPermissions |
getAccessPermissions()
Simple delegate to COSDocument.getAccessPermissions() |
PDAcroForm |
getAcroForm()
read an AcroForm from a PDF Document. return null if no AcroForm is available. |
PDAdditionalActions |
getAdditionalActions()
|
List |
getAnnotations()
|
PDApplicationData |
getApplicationData(String name)
|
Object |
getAttribute(Object key)
get an attribute from the context |
String |
getAuthor()
|
COSCatalog |
getCatalog()
lookup the catalog dictionary in a document |
CDSDate |
getCreationDate()
|
String |
getCreationDateString()
|
String |
getCreator()
|
COSInfoDict |
getInfoDict()
Get the info dictionary containing metadata. |
String |
getKeywords()
|
ILocator |
getLocator()
Return the ILocator that defines the physical resource location
for the reciver. |
String |
getMetadata()
|
CDSDate |
getModDate()
|
String |
getModDateString()
|
String |
getName()
|
PDAction |
getOpenAction()
|
PDOutline |
getOutline()
|
PDOutputIntent |
getOutputIntent(COSName oiName)
|
List |
getOutputIntents()
|
PDPageTree |
getPageTree()
return the documents root page tree |
PDSignature |
getPermissions(COSName key)
Shortcut to a signature dictionary in the document permissions dictionary. |
String |
getProducer()
|
String |
getSubject()
|
Set |
getSupportedTriggerEvents()
|
String |
getTitle()
|
String |
getTrapped()
|
EnumWriteMode |
getWriteModeHint()
The write mode to be used when the document is written the next time. |
boolean |
isAppendOnly()
true if the document has a flag to prefere incremental
save. |
boolean |
isDirty()
|
boolean |
isEncrypted()
Lookup if this document is encrypted, means it has a security handler. |
boolean |
isNew()
|
boolean |
isPreferIncrementalSave()
true if the document should be saved in an incremental way
only. |
boolean |
isReadOnly()
|
boolean |
isSigned()
true if the document contains digital signatures. |
COSObject |
lookupDestination(String name)
|
void |
removeApplicationData(String name)
|
Object |
removeAttribute(Object key)
remove an attribute in the context |
void |
restore(ILocator locator)
|
void |
save()
|
void |
save(ILocator locator)
|
void |
save(ILocator locator,
Map options)
|
void |
setAcroForm(PDAcroForm form)
Set AcroForm in PDF Document. |
void |
setAdditionalActions(PDAdditionalActions actions)
|
void |
setApplicationData(String name,
PDApplicationData data)
|
Object |
setAttribute(Object key,
Object o)
set the value of an attribute in the context |
void |
setAuthor(String value)
|
void |
setCreationDateString(String value)
|
void |
setCreator(String value)
|
void |
setDocumentInfo(COSName name,
String value)
|
void |
setInfoDict(COSInfoDict infoDict)
Set the info dictionary containing metadata. |
void |
setKeywords(String value)
|
void |
setModDateString(String value)
|
void |
setName(String name)
|
void |
setOpenAction(PDAction newAction)
|
void |
setOutline(PDOutline outline)
|
void |
setPageTree(PDPageTree newTree)
|
void |
setPermissions(COSName name,
PDSignature signature)
|
void |
setProducer(String value)
|
void |
setSubject(String value)
|
void |
setTitle(String value)
|
void |
setTrapped(String value)
|
void |
setWriteModeHint(EnumWriteMode writeMode)
The write mode to be used when the document is written the next time. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Set CATALOG_ACTION_TRIGGERS
public static final COSName DK_OpenAction
public static final COSName DK_Perms
public static final COSName CN_Perms_DocMDP
public static final COSName CN_Perms_UR
Method Detail |
---|
public static PDDocument createFromCos(COSDocument doc) throws COSLoadException
doc
- COSDocument to base this PDDocument on
COSLoadException
public static PDDocument createFromLocator(ILocator locator) throws IOException, COSLoadException
IOException
COSLoadException
public static PDDocument createNew()
public void addAction(PDAction action)
public void addOpenAction(PDAction newAction)
PDAction
to be exceuted when this is opened.
newAction
- The new PDAction
public void addPageNode(PDPageNode newNode)
newNode
- The page to be addedpublic void addPageNodeAfter(PDPageNode newNode, PDPageNode destination)
newNode
- the page to be addeddestination
- The page after the new one is insertedpublic void close() throws IOException
close
.
IOException
public PDDocument copyDeep()
public COSDocument cosGetDoc()
public COSDictionary cosGetPermissionsDict()
public COSDictionary cosGetPieceInfoDict()
public COSDictionary cosGetURI()
public void cosSetPermissionsDict(COSDictionary permsDict)
permsDict
- the new permission dictionarypublic void cosSetPieceInfoDict(COSDictionary dict)
dict
- the new piece info dictionarypublic PDAcroForm createAcroForm()
IllegalStateException
public PDPageTree createPageTree()
public IAccessPermissions getAccessPermissions()
public PDAcroForm getAcroForm()
public PDAdditionalActions getAdditionalActions()
getAdditionalActions
in interface IAdditionalActionSupport
public List getAnnotations()
public PDApplicationData getApplicationData(String name)
public Object getAttribute(Object key)
IAttributeSupport
getAttribute
in interface IAttributeSupport
key
- the name of the attribute to get
public String getAuthor()
public COSCatalog getCatalog()
public CDSDate getCreationDate()
public String getCreationDateString()
public String getCreator()
public COSInfoDict getInfoDict()
public String getKeywords()
public ILocator getLocator()
ILocatorSupport
ILocator
that defines the physical resource location
for the reciver.
getLocator
in interface ILocatorSupport
ILocator
that defines the physical resource
location for the reciver.public String getMetadata()
public CDSDate getModDate()
public String getModDateString()
public String getName()
public PDAction getOpenAction()
public PDOutline getOutline()
public PDOutputIntent getOutputIntent(COSName oiName)
public List getOutputIntents()
public PDPageTree getPageTree()
public PDSignature getPermissions(COSName key)
key
- key which should be ether "DocMDP" or "UR"
public String getProducer()
public String getSubject()
public Set getSupportedTriggerEvents()
getSupportedTriggerEvents
in interface IAdditionalActionSupport
public String getTitle()
public String getTrapped()
public EnumWriteMode getWriteModeHint()
public boolean isDirty()
public boolean isEncrypted()
ISystemSecurityHandler
public boolean isNew()
public boolean isReadOnly()
public boolean isPreferIncrementalSave()
true
if the document should be saved in an incremental way
only. This is for example the case when the document contains digital
signatures.
true
if the document should be saved in an
incremental way only.public boolean isAppendOnly()
true
if the document has a flag to prefere incremental
save.
true
if the document should be saved in an
incremental way only.public boolean isSigned()
true
if the document contains digital signatures. This
should be reflected in the SigFlags entry of the form - but who knows...
true
if the document contains digital signatures.public COSObject lookupDestination(String name)
public void removeApplicationData(String name)
public Object removeAttribute(Object key)
IAttributeSupport
removeAttribute
in interface IAttributeSupport
key
- the name of the attribute to remove
key
public void restore(ILocator locator) throws IOException, COSLoadException
IOException
COSLoadException
public void save() throws IOException
IOException
public void save(ILocator locator) throws IOException
IOException
public void save(ILocator locator, Map options) throws IOException
IOException
public void setAcroForm(PDAcroForm form)
public void setAdditionalActions(PDAdditionalActions actions)
setAdditionalActions
in interface IAdditionalActionSupport
public void setApplicationData(String name, PDApplicationData data)
public Object setAttribute(Object key, Object o)
IAttributeSupport
setAttribute
in interface IAttributeSupport
key
- the name of the attribute to seto
- the new value the attribute
key
public void setAuthor(String value)
public void setCreationDateString(String value)
public void setCreator(String value)
public void setDocumentInfo(COSName name, String value)
public void setInfoDict(COSInfoDict infoDict)
infoDict
- The info dictionary containing metadata.public void setKeywords(String value)
public void setModDateString(String value)
public void setName(String name)
public void setOpenAction(PDAction newAction)
public void setOutline(PDOutline outline)
public void setPageTree(PDPageTree newTree)
public void setPermissions(COSName name, PDSignature signature)
public void setProducer(String value)
public void setSubject(String value)
public void setTitle(String value)
public void setTrapped(String value)
public void setWriteModeHint(EnumWriteMode writeMode)
writeMode
- The write mode to be used when the document is written.
|
intarsys PDF library API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |