public class PDFMetadata
extends java.lang.Object
PDFMetadata
represents PDF document Meta data. It defines
methods to get these meta data.
Metadata
class provides some application level information about
document, such as author, title, creation time and others.
It can be constructed in the following way.
Example:
PDFDocument document = PDFDocument.open(file,password); PDFMetadata pdfMetadata = document.getMetadata();
PDFDocument
Modifier and Type | Method and Description |
---|---|
DateTime |
getDateTime(java.lang.String key)
Get a date and time value from meta-data.
|
java.lang.String |
getString(java.lang.String key)
Get a string value from meta-data.
|
void |
setDateTime(java.lang.String key,
DateTime date)
Set a date value to a field indicated by the parameter key in meta-data.
|
void |
setString(java.lang.String key,
java.lang.String value)
Set a string value to a field indicated by the parameter key in
meta-data.
|
public java.lang.String getString(java.lang.String key) throws PDFException
key
- A String
object."Title"
"Author"
"Subject"
"Keywords"
"Creator"
"Producer"
Some other custom information keys, if
they're supported by the PDF file.
key
.key
is not found in dictionary document doesn't have metadata information,
it will return null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public DateTime getDateTime(java.lang.String key) throws PDFException
key
- A String
object."CreationDate"
"ModDate"
Some other custom information keys, if
they're supported by the PDF file.
DateTime
object that receives a date and time
value associated to parameters key
.key
is not found in dictionary document doesn't have metadata information,
it will return null
.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
DateTime
public void setString(java.lang.String key, java.lang.String value) throws PDFException
key
- A String
object."Title"
"Author"
"Subject"
"Keywords"
"Creator"
"Producer"
Some other custom information keys, if
they're supported by the PDF file.
value
- A String
object to be set.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
public void setDateTime(java.lang.String key, DateTime date) throws PDFException
key
- A String
object."CreationDate"
"ModDate"
Some other custom information keys, if
they're supported by the PDF file.
date
- A DataTime
object.PDFException
- For more exception information please see definitions
PDFException.ERRCODE_XXX
.PDFException
,
DateTime