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

public final Class ExtractMetadata

extends Object
Class Inheritance
Imports
org.apache.pdfbox.Loader, org.apache.pdfbox.pdmodel.PDDocument, .PDDocumentCatalog, .PDDocumentInformation, org.apache.pdfbox.pdmodel.common.PDMetadata, java.io.File, .IOException, java.text.DateFormat, java.util.Calendar, .List, org.apache.xmpbox.XMPMetadata, org.apache.xmpbox.schema.AdobePDFSchema, .DublinCoreSchema, .XMPBasicSchema, org.apache.xmpbox.type.BadFieldValueException, org.apache.xmpbox.xml.DomXmpParser, .XmpParsingException

This is an example on how to extract metadata from a PDF document.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
display(String title, Object value)

private static String
private static void
private static void
listString(String title, List<String> list)

public static void
main(String[]
The command line arguments.
args
)

This is the main method.

private static void
private static void
private static void
private static void
private static void
usage()

This will print the usage for this program.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ExtractMetadataback to summary
private ExtractMetadata()

Method Detail

displayback to summary
private static void display(String title, Object value)
formatback to summary
private static String format(Object o)
listCalendarback to summary
private static void listCalendar(String title, List<Calendar> list)
listStringback to summary
private static void listString(String title, List<String> list)
mainback to summary
public static void main(String[] args) throws IOException, XmpParsingException, BadFieldValueException

This is the main method.

Parameters
args:String[]

The command line arguments.

Exceptions
IOException:
If there is an error parsing the document.
showAdobePDFSchemaback to summary
private static void showAdobePDFSchema(XMPMetadata metadata)
showDocumentInformationback to summary
private static void showDocumentInformation(PDDocumentInformation information)
showDublinCoreSchemaback to summary
private static void showDublinCoreSchema(XMPMetadata metadata) throws BadFieldValueException
showXMPBasicSchemaback to summary
private static void showXMPBasicSchema(XMPMetadata metadata)
usageback to summary
private static void usage()

This will print the usage for this program.