Class PrintFields


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

      Constructors 
      Constructor Description
      PrintFields()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void main​(java.lang.String[] args)
      This will read a PDF file and print out the form elements.
      void printFields​(PDDocument pdfDocument)
      This will print all the fields from the document.
      private void processField​(PDField field, java.lang.String sLevel, java.lang.String sParent)  
      private static void usage()
      This will print out a message telling how to use this example.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PrintFields

        public PrintFields()
    • Method Detail

      • printFields

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

        private void processField​(PDField field,
                                  java.lang.String sLevel,
                                  java.lang.String sParent)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        This will read a PDF file and print out the form elements.
        see usage() for commandline
        Parameters:
        args - command line arguments
        Throws:
        java.io.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.