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.
Method from org.apache.pdfbox.pdmodel.PDDocumentInformation Detail: |
public String getAuthor() {
return info.getString( AUTHOR );
}
This will get the author of the document. This will return null if no author exists. |
public COSBase getCOSObject() {
return info;
}
Convert this standard java object to a COS object. |
public Calendar getCreationDate() throws IOException {
return info.getDate( CREATION_DATE );
}
This will get the creation date of the document. This will return null if no creation date exists. |
public String getCreator() {
return info.getString( CREATOR );
}
This will get the creator of the document. This will return null if no creator exists. |
public String getCustomMetadataValue(String fieldName) {
return info.getString( fieldName );
}
This will get the value of a custom metadata information field for the document.
This will return null if one is not found. |
public COSDictionary getDictionary() {
return info;
}
This will get the underlying dictionary that this object wraps. |
public String getKeywords() {
return info.getString( KEYWORDS );
}
This will get the keywords of the document. This will return null if no keywords exists. |
public Calendar getModificationDate() throws IOException {
return info.getDate( MODIFICATION_DATE );
}
This will get the modification date of the document. This will return null if no modification date exists. |
public String getProducer() {
return info.getString( PRODUCER );
}
This will get the producer of the document. This will return null if no producer exists. |
public String getSubject() {
return info.getString( SUBJECT );
}
This will get the subject of the document. This will return null if no subject exists. |
public String getTitle() {
return info.getString( TITLE );
}
This will get the title of the document. This will return null if no title exists. |
public String getTrapped() {
return info.getNameAsString( TRAPPED );
}
This will get the trapped value for the document.
This will return null if one is not found. |
public void setAuthor(String author) {
info.setString( AUTHOR, author );
}
This will set the author of the document. |
public void setCreationDate(Calendar date) {
info.setDate( CREATION_DATE, date );
}
This will set the creation date of the document. |
public void setCreator(String creator) {
info.setString( CREATOR, creator );
}
This will set the creator of the document. |
public void setCustomMetadataValue(String fieldName,
String fieldValue) {
info.setString( fieldName, fieldValue );
}
Set the custom metadata value. |
public void setKeywords(String keywords) {
info.setString( KEYWORDS, keywords );
}
This will set the keywords of the document. |
public void setModificationDate(Calendar date) {
info.setDate( MODIFICATION_DATE, date );
}
This will set the modification date of the document. |
public void setProducer(String producer) {
info.setString( PRODUCER, producer );
}
This will set the producer of the document. |
public void setSubject(String subject) {
info.setString( SUBJECT, subject );
}
This will set the subject of the document. |
public void setTitle(String title) {
info.setString( TITLE, title );
}
This will set the title of the document. |
public void setTrapped(String value) {
if( value != null &&
!value.equals( "True" ) &&
!value.equals( "False" ) &&
!value.equals( "Unknown" ) )
{
throw new RuntimeException( "Valid values for trapped are " +
"'True', 'False', or 'Unknown'" );
}
info.setName( TRAPPED, value );
}
This will set the trapped of the document. This will be
'True', 'False', or 'Unknown'. |