public class PdfPackage extends DocumentPackage
Represents native metadata in a PDF document.
Learn more
This code snippet demonstrates how to update built-in metadata properties in a PDF document.
try (Metadata metadata = new Metadata(Constants.InputPdf)) { PdfRootPackage root = metadata.getRootPackageGeneric(); root.getDocumentProperties().setAuthor("test author"); root.getDocumentProperties().setCreatedDate(new Date()); root.getDocumentProperties().setTitle("test title"); root.getDocumentProperties().setKeywords("metadata, built-in, update"); // ... metadata.save(Constants.OutputPdf); }
Modifier and Type | Method and Description |
---|---|
String |
getAuthor()
Gets the document author.
|
Date |
getCreatedDate()
Gets the date of document creation.
|
String |
getCreator()
Gets the creator of the document.
|
String |
getKeywords()
Gets the keywords.
|
Date |
getModifiedDate()
Gets the date of the last modification.
|
String |
getProducer()
Gets the document producer.
|
String |
getSubject()
Gets the subject of the document.
|
String |
getTitle()
Gets the title of the document.
|
Boolean |
getTrappedFlag()
Gets the trapped flag.
|
void |
set(String propertyName,
String value)
Adds or replaces the metadata property with the specified name.
|
void |
setAuthor(String value)
Sets the document author.
|
void |
setCreatedDate(Date value)
Sets the date of document creation.
|
void |
setKeywords(String value)
Sets the keywords.
|
void |
setModifiedDate(Date value)
Sets the date of the last modification.
|
void |
setSubject(String value)
Sets the subject of the document.
|
void |
setTitle(String value)
Sets the title of the document.
|
void |
setTrappedFlag(Boolean value)
Sets the trapped flag.
|
clear, clearBuiltInProperties, clearCustomProperties, remove
addProperties, contains, findProperties, get_Item, getCount, getKeys, getKnowPropertyDescriptors, getMetadataType, getPropertyDescriptors, iterator, removeProperties, sanitize, setProperties, updateProperties
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public final String getAuthor()
Gets the document author.
public final void setAuthor(String value)
Sets the document author.
value
- The document author.public final Date getCreatedDate()
Gets the date of document creation.
public final void setCreatedDate(Date value)
Sets the date of document creation.
value
- The date of document creation.public final String getCreator()
Gets the creator of the document.
public final String getKeywords()
Gets the keywords.
public final void setKeywords(String value)
Sets the keywords.
value
- The keywords.public final Date getModifiedDate()
Gets the date of the last modification.
public final void setModifiedDate(Date value)
Sets the date of the last modification.
value
- The date of the last modification.public final String getProducer()
Gets the document producer.
public final String getSubject()
Gets the subject of the document.
public final void setSubject(String value)
Sets the subject of the document.
value
- The subject of the document.public final String getTitle()
Gets the title of the document.
public final void setTitle(String value)
Sets the title of the document.
value
- The title of the document.public final Boolean getTrappedFlag()
Gets the trapped flag.
true
if the trapped flag is set; otherwise, false
.public final void setTrappedFlag(Boolean value)
Sets the trapped flag.
value
- true
if the trapped flag is set; otherwise, false
.