Package org.apache.pdfbox.pdmodel
Class PDDocumentInformation
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.PDDocumentInformation
-
- All Implemented Interfaces:
COSObjectable
public class PDDocumentInformation extends java.lang.Object implements 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.
-
-
Field Summary
Fields Modifier and Type Field Description private COSDictionary
info
-
Constructor Summary
Constructors Constructor Description PDDocumentInformation()
Default Constructor.PDDocumentInformation(COSDictionary dic)
Constructor that is used for a preexisting dictionary.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAuthor()
This will get the author of the document.COSDictionary
getCOSObject()
This will get the underlying dictionary that this object wraps.java.util.Calendar
getCreationDate()
This will get the creation date of the document.java.lang.String
getCreator()
This will get the creator of the document.java.lang.String
getCustomMetadataValue(java.lang.String fieldName)
This will get the value of a custom metadata information field for the document.java.lang.String
getKeywords()
This will get the keywords of the document.java.util.Set<java.lang.String>
getMetadataKeys()
This will get the keys of all metadata information fields for the document.java.util.Calendar
getModificationDate()
This will get the modification date of the document.java.lang.String
getProducer()
This will get the producer of the document.java.lang.Object
getPropertyStringValue(java.lang.String propertyKey)
Return the properties String value.java.lang.String
getSubject()
This will get the subject of the document.java.lang.String
getTitle()
This will get the title of the document.java.lang.String
getTrapped()
This will get the trapped value for the document.void
setAuthor(java.lang.String author)
This will set the author of the document.void
setCreationDate(java.util.Calendar date)
This will set the creation date of the document.void
setCreator(java.lang.String creator)
This will set the creator of the document.void
setCustomMetadataValue(java.lang.String fieldName, java.lang.String fieldValue)
Set the custom metadata value.void
setKeywords(java.lang.String keywords)
This will set the keywords of the document.void
setModificationDate(java.util.Calendar date)
This will set the modification date of the document.void
setProducer(java.lang.String producer)
This will set the producer of the document.void
setSubject(java.lang.String subject)
This will set the subject of the document.void
setTitle(java.lang.String title)
This will set the title of the document.void
setTrapped(java.lang.String value)
This will set the trapped of the document.
-
-
-
Field Detail
-
info
private final COSDictionary info
-
-
Constructor Detail
-
PDDocumentInformation
public PDDocumentInformation()
Default Constructor.
-
PDDocumentInformation
public PDDocumentInformation(COSDictionary dic)
Constructor that is used for a preexisting dictionary.- Parameters:
dic
- The underlying dictionary.
-
-
Method Detail
-
getCOSObject
public COSDictionary getCOSObject()
This will get the underlying dictionary that this object wraps.- Specified by:
getCOSObject
in interfaceCOSObjectable
- Returns:
- The underlying info dictionary.
-
getPropertyStringValue
public java.lang.Object getPropertyStringValue(java.lang.String propertyKey)
Return the properties String value.Allows to retrieve the low level date for validation purposes.
- Parameters:
propertyKey
- the dictionaries key- Returns:
- the properties value
-
getTitle
public java.lang.String getTitle()
This will get the title of the document. This will return null if no title exists.- Returns:
- The title of the document.
-
setTitle
public void setTitle(java.lang.String title)
This will set the title of the document.- Parameters:
title
- The new title for the document.
-
getAuthor
public java.lang.String getAuthor()
This will get the author of the document. This will return null if no author exists.- Returns:
- The author of the document.
-
setAuthor
public void setAuthor(java.lang.String author)
This will set the author of the document.- Parameters:
author
- The new author for the document.
-
getSubject
public java.lang.String getSubject()
This will get the subject of the document. This will return null if no subject exists.- Returns:
- The subject of the document.
-
setSubject
public void setSubject(java.lang.String subject)
This will set the subject of the document.- Parameters:
subject
- The new subject for the document.
-
getKeywords
public java.lang.String getKeywords()
This will get the keywords of the document. This will return null if no keywords exists.- Returns:
- The keywords of the document.
-
setKeywords
public void setKeywords(java.lang.String keywords)
This will set the keywords of the document.- Parameters:
keywords
- The new keywords for the document.
-
getCreator
public java.lang.String getCreator()
This will get the creator of the document. This will return null if no creator exists.- Returns:
- The creator of the document.
-
setCreator
public void setCreator(java.lang.String creator)
This will set the creator of the document.- Parameters:
creator
- The new creator for the document.
-
getProducer
public java.lang.String getProducer()
This will get the producer of the document. This will return null if no producer exists.- Returns:
- The producer of the document.
-
setProducer
public void setProducer(java.lang.String producer)
This will set the producer of the document.- Parameters:
producer
- The new producer for the document.
-
getCreationDate
public java.util.Calendar getCreationDate()
This will get the creation date of the document. This will return null if no creation date exists.- Returns:
- The creation date of the document.
-
setCreationDate
public void setCreationDate(java.util.Calendar date)
This will set the creation date of the document.- Parameters:
date
- The new creation date for the document.
-
getModificationDate
public java.util.Calendar getModificationDate()
This will get the modification date of the document. This will return null if no modification date exists.- Returns:
- The modification date of the document.
-
setModificationDate
public void setModificationDate(java.util.Calendar date)
This will set the modification date of the document.- Parameters:
date
- The new modification date for the document.
-
getTrapped
public java.lang.String getTrapped()
This will get the trapped value for the document. This will return null if one is not found.- Returns:
- The trapped value for the document.
-
getMetadataKeys
public java.util.Set<java.lang.String> getMetadataKeys()
This will get the keys of all metadata information fields for the document.- Returns:
- all metadata key strings.
- Since:
- Apache PDFBox 1.3.0
-
getCustomMetadataValue
public java.lang.String getCustomMetadataValue(java.lang.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
- Name of custom metadata field from pdf document.- Returns:
- String Value of metadata field
-
setCustomMetadataValue
public void setCustomMetadataValue(java.lang.String fieldName, java.lang.String fieldValue)
Set the custom metadata value.- Parameters:
fieldName
- The name of the custom metadata field.fieldValue
- The value to the custom metadata field.
-
setTrapped
public void setTrapped(java.lang.String value)
This will set the trapped of the document. This will be 'True', 'False', or 'Unknown'.- Parameters:
value
- The new trapped value for the document.- Throws:
java.lang.IllegalArgumentException
- if the parameter is invalid.
-
-