Class PrintFields

java.lang.Object
org.apache.pdfbox.examples.interactive.form.PrintFields

public class PrintFields extends Object
This example will take a PDF document and print all the fields from the file.
  • Constructor Details

    • PrintFields

      public PrintFields()
  • Method Details

    • printFields

      public void printFields(PDDocument pdfDocument) throws IOException
      This will print all the fields from the document.
      Parameters:
      pdfDocument - The PDF to get the fields from.
      Throws:
      IOException - If there is an error getting the fields.
    • processField

      private void processField(PDField field, String sLevel, String sParent) throws IOException
      Throws:
      IOException
    • main

      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 - command line arguments
      Throws:
      IOException - If there is an error importing the FDF document.
    • usage

      private static void usage()
      This will print out a message telling how to use this example.