Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel

public Class PDDocumentInformation

extends Object
implements COSObjectable
Class Inheritance
All Implemented Interfaces
org.apache.pdfbox.pdmodel.common.COSObjectable
Imports
java.util.Calendar, .Set, .TreeSet, org.apache.pdfbox.cos.COSDictionary, .COSName, org.apache.pdfbox.pdmodel.common.COSObjectable

This is the document metadata. Each getXXX method will return the entry if it exists or null if it does not exist. If you pass in null for the setXXX method then it will clear the value.
Authors
Ben Litchfield, Gerardo Ortiz

Field Summary

Modifier and TypeField and Description
private final COSDictionary

Constructor Summary

AccessConstructor and Description
public
PDDocumentInformation()

Default Constructor.

public
PDDocumentInformation(COSDictionary
The underlying dictionary.
dic
)

Constructor that is used for a preexisting dictionary.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The author of the document.
getAuthor
()

This will get the author of the document.

public COSDictionary

Returns:

The underlying info dictionary.
getCOSObject
()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

This will get the underlying dictionary that this object wraps.

public Calendar

Returns:

The creation date of the document.
getCreationDate
()

This will get the creation date of the document.

public String

Returns:

The creator of the document.
getCreator
()

This will get the creator of the document.

public String

Returns:

String Value of metadata field
getCustomMetadataValue
(String
Name of custom metadata field from pdf document.
fieldName
)

This will get the value of a custom metadata information field for the document.

public String

Returns:

The keywords of the document.
getKeywords
()

This will get the keywords of the document.

public Set<String>

Returns:

all metadata key strings.
getMetadataKeys
()

This will get the keys of all metadata information fields for the document.

public Calendar

Returns:

The modification date of the document.
getModificationDate
()

This will get the modification date of the document.

public String

Returns:

The producer of the document.
getProducer
()

This will get the producer of the document.

public Object

Returns:

the properties value
getPropertyStringValue
(String
the dictionaries key
propertyKey
)

Return the properties String value.

public String

Returns:

The subject of the document.
getSubject
()

This will get the subject of the document.

public String

Returns:

The title of the document.
getTitle
()

This will get the title of the document.

public String

Returns:

The trapped value for the document.
getTrapped
()

This will get the trapped value for the document.

public void
setAuthor(String
The new author for the document.
author
)

This will set the author of the document.

public void
setCreationDate(Calendar
The new creation date for the document.
date
)

This will set the creation date of the document.

public void
setCreator(String
The new creator for the document.
creator
)

This will set the creator of the document.

public void
setCustomMetadataValue(String
The name of the custom metadata field.
fieldName
,
String
The value to the custom metadata field.
fieldValue
)

Set the custom metadata value.

public void
setKeywords(String
The new keywords for the document.
keywords
)

This will set the keywords of the document.

public void
setModificationDate(Calendar
The new modification date for the document.
date
)

This will set the modification date of the document.

public void
setProducer(String
The new producer for the document.
producer
)

This will set the producer of the document.

public void
setSubject(String
The new subject for the document.
subject
)

This will set the subject of the document.

public void
setTitle(String
The new title for the document.
title
)

This will set the title of the document.

public void
setTrapped(String
The new trapped value for the document.
value
)

This will set the trapped of the document.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

infoback to summary
private final COSDictionary info

Constructor Detail

PDDocumentInformationback to summary
public PDDocumentInformation()

Default Constructor.

PDDocumentInformationback to summary
public PDDocumentInformation(COSDictionary dic)

Constructor that is used for a preexisting dictionary.

Parameters
dic:COSDictionary

The underlying dictionary.

Method Detail

getAuthorback to summary
public String getAuthor()

This will get the author of the document. This will return null if no author exists.

Returns:String

The author of the document.

getCOSObjectback to summary
public COSDictionary getCOSObject()

Implements org.apache.pdfbox.pdmodel.common.COSObjectable.getCOSObject.

This will get the underlying dictionary that this object wraps.

Returns:COSDictionary

The underlying info dictionary.

Annotations
@Override
getCreationDateback to summary
public Calendar getCreationDate()

This will get the creation date of the document. This will return null if no creation date exists.

Returns:Calendar

The creation date of the document.

getCreatorback to summary
public String getCreator()

This will get the creator of the document. This will return null if no creator exists.

Returns:String

The creator of the document.

getCustomMetadataValueback to summary
public String getCustomMetadataValue(String fieldName)

This will get the value of a custom metadata information field for the document. This will return null if one is not found.

Parameters
fieldName:String

Name of custom metadata field from pdf document.

Returns:String

String Value of metadata field

getKeywordsback to summary
public String getKeywords()

This will get the keywords of the document. This will return null if no keywords exists.

Returns:String

The keywords of the document.

getMetadataKeysback to summary
public Set<String> getMetadataKeys()

This will get the keys of all metadata information fields for the document.

Returns:Set<String>

all metadata key strings.

Since
Apache PDFBox 1.3.0
getModificationDateback to summary
public Calendar getModificationDate()

This will get the modification date of the document. This will return null if no modification date exists.

Returns:Calendar

The modification date of the document.

getProducerback to summary
public String getProducer()

This will get the producer of the document. This will return null if no producer exists.

Returns:String

The producer of the document.

getPropertyStringValueback to summary
public Object getPropertyStringValue(String propertyKey)

Return the properties String value.

Allows to retrieve the low level date for validation purposes.

Parameters
propertyKey:String

the dictionaries key

Returns:Object

the properties value

getSubjectback to summary
public String getSubject()

This will get the subject of the document. This will return null if no subject exists.

Returns:String

The subject of the document.

getTitleback to summary
public String getTitle()

This will get the title of the document. This will return null if no title exists.

Returns:String

The title of the document.

getTrappedback to summary
public String getTrapped()

This will get the trapped value for the document. This will return null if one is not found.

Returns:String

The trapped value for the document.

setAuthorback to summary
public void setAuthor(String author)

This will set the author of the document.

Parameters
author:String

The new author for the document.

setCreationDateback to summary
public void setCreationDate(Calendar date)

This will set the creation date of the document.

Parameters
date:Calendar

The new creation date for the document.

setCreatorback to summary
public void setCreator(String creator)

This will set the creator of the document.

Parameters
creator:String

The new creator for the document.

setCustomMetadataValueback to summary
public void setCustomMetadataValue(String fieldName, String fieldValue)

Set the custom metadata value.

Parameters
fieldName:String

The name of the custom metadata field.

fieldValue:String

The value to the custom metadata field.

setKeywordsback to summary
public void setKeywords(String keywords)

This will set the keywords of the document.

Parameters
keywords:String

The new keywords for the document.

setModificationDateback to summary
public void setModificationDate(Calendar date)

This will set the modification date of the document.

Parameters
date:Calendar

The new modification date for the document.

setProducerback to summary
public void setProducer(String producer)

This will set the producer of the document.

Parameters
producer:String

The new producer for the document.

setSubjectback to summary
public void setSubject(String subject)

This will set the subject of the document.

Parameters
subject:String

The new subject for the document.

setTitleback to summary
public void setTitle(String title)

This will set the title of the document.

Parameters
title:String

The new title for the document.

setTrappedback to summary
public void setTrapped(String value)

This will set the trapped of the document. This will be 'True', 'False', or 'Unknown'.

Parameters
value:String

The new trapped value for the document.

Exceptions
IllegalArgumentException:
if the parameter is invalid.