Top Description Constructors Methods
org.apache.pdfbox.examples.interactive.form

public Class PrintFields

extends Object
Class Inheritance
Imports
java.io.File, .IOException, java.util.List, org.apache.pdfbox.Loader, org.apache.pdfbox.pdmodel.PDDocument, .PDDocumentCatalog, org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm, .PDField, .PDNonTerminalField

This example will take a PDF document and print all the fields from the file.
Author
Ben Litchfield

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
main(String[]
command line arguments
args
)

This will read a PDF file and print out the form elements.

public void
printFields(PDDocument
The PDF to get the fields from.
pdfDocument
)

This will print all the fields from the document.

private void
processField(PDField field, String sLevel, String sParent)

private static void
usage()

This will print out a message telling how to use this example.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PrintFieldsback to summary
public PrintFields()

Method Detail

mainback to summary
public static void main(String[] args) throws IOException

This will read a PDF file and print out the form elements.
see usage() for commandline

Parameters
args:String[]

command line arguments

Exceptions
IOException:
If there is an error importing the FDF document.
printFieldsback to summary
public void printFields(PDDocument pdfDocument) throws IOException

This will print all the fields from the document.

Parameters
pdfDocument:PDDocument

The PDF to get the fields from.

Exceptions
IOException:
If there is an error getting the fields.
processFieldback to summary
private void processField(PDField field, String sLevel, String sParent) throws IOException
usageback to summary
private static void usage()

This will print out a message telling how to use this example.