com.pspdfkit.document.metadata.DocumentPdfMetadata |
This class allows you to modify a PDF documents metadata.
Metadata is defined in two ways in the PDF spec (§ 14.3): - The Info PDF dictionary. This
class is handling this. - A metadata stream containing XMP data. See DocumentXmpMetadata
for that.
Use getPdfMetadata()
to retrieve an instance of this class.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract PdfValue |
get(String key)
Retrieves a single metadata value from PDF.
| ||||||||||
abstract String |
getAuthor()
Returns the author of the document.
| ||||||||||
abstract Date |
getCreationDate()
Returns the document creation date (if set).
| ||||||||||
abstract String |
getCreator()
Returns software used to create the document.
| ||||||||||
abstract List<String> |
getKeywords()
Returns document keywords.
| ||||||||||
abstract Map<String, PdfValue> |
getMetadata()
Returns full metadata of the document.
| ||||||||||
abstract Date |
getModificationDate()
Returns the date of when the document was last modified (if any).
| ||||||||||
abstract String |
getProducer()
Returns software library used to create the document.
| ||||||||||
abstract String |
getSubject()
Returns the subject of the document.
| ||||||||||
abstract String |
getTitle()
Returns the title given to the document.
| ||||||||||
abstract boolean |
hasUnsavedChanges()
Returns
true if there were any changes to the PDF metadata without save. | ||||||||||
abstract void |
set(String key, PdfValue value)
Sets a single value in the PDF.
| ||||||||||
abstract void |
setAuthor(String author)
Sets the author for the document.
| ||||||||||
abstract void |
setCreationDate(Date creationDate)
Sets the creation date for the document.
| ||||||||||
abstract void |
setCreator(String creator)
Sets the creator for the document.
| ||||||||||
abstract void |
setKeywords(List<String> keywords)
Sets the keywords for the document.
| ||||||||||
abstract void |
setModificationDate(Date modificationDate)
Sets the modification date for the document.
| ||||||||||
abstract void |
setProducer(String producer)
Sets the producer for the document.
| ||||||||||
abstract void |
setSubject(String subject)
Sets the subject for the document.
| ||||||||||
abstract void |
setTitle(String title)
Sets the title for the document.
|
Retrieves a single metadata value from PDF.
key | Metadata key, must not be null. |
---|
PdfValue
instance representing a value or null
.
Returns the author of the document.
null
if non-existent.
Returns the document creation date (if set).
null
if not set.
Returns software used to create the document.
null
if not set.
Returns document keywords.
null
if none set.
Returns full metadata of the document.
Returns the date of when the document was last modified (if any).
null
if not set.
Returns software library used to create the document.
null
if not set.
Returns the subject of the document.
null
if non-existent.
Returns the title given to the document.
null
of there's not title.
Returns true
if there were any changes to the PDF metadata without save.
true
if PDF metadata was changed, false
otherwise.
Sets a single value in the PDF.
key | Metadata key, must not be null. |
---|---|
value | New value or null to remove the value.
|
Sets the author for the document.
author | Author for the document, or null to remove it.
|
---|
Sets the creation date for the document.
creationDate | Creation date for the document, or null to remove it.
|
---|
Sets the creator for the document.
creator | Creator for the document, or null to remove it.
|
---|
Sets the keywords for the document.
keywords | List of keywords for the document, or null /empty list to remove them.
|
---|
Sets the modification date for the document.
modificationDate | Modification date for the document, or null to remove it.
|
---|
Sets the producer for the document.
producer | Producer for the document, or null to remove it.
|
---|
Sets the subject for the document.
subject | Subject for the document, or null to remove it.
|
---|
Sets the title for the document.
title | Title for the document, or null to remove it.
|
---|