Document Properties in Apache PDFBox

Document properties of a pdf can be accessed/created using the Apache PDFBox library. Lets see an example on all the document properties in Apache PDFBox.
The class used for accessing the document properties in Apache PDFBox is org.apache.pdfbox.pdmodel.PDDocumentInformation

Some of its useful methods to set the properties are
setAuthor(String author)
This will set the author of the document.
setCreationDate(Calendar date)
This will set the creation date of the document.
setCreator(String creator)
This will set the creator of the document.
setCustomMetadataValue(String fieldName, String fieldValue)
Set the custom metadata value.
setKeywords(String keywords)
This will set the keywords of the document.
setModificationDate(Calendar date)
This will set the modification date of the document.
setProducer(String producer)
This will set the producer of the document.
setSubject(String subject)
This will set the subject of the document.
setTitle(String title)
This will set the title of the document.
setTrapped(String value)
This will set the trapped of the document.

Example

Output
Document Properties in Apache PDFBox

It's only fair to share...Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn