Class PrintDocumentMetaData


  • public class PrintDocumentMetaData
    extends java.lang.Object
    This is an example on how to get a documents metadata information.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.lang.String formatDate​(java.util.Calendar date)
      This will format a date object.
      static void main​(java.lang.String[] args)
      This will print the documents data.
      void printMetadata​(PDDocument document)
      This will print the documents data to System.out.
      private static void usage()
      This will print the usage for this document.
      • Methods inherited from class java.lang.Object

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

      • PrintDocumentMetaData

        public PrintDocumentMetaData()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        This will print the documents data.
        Parameters:
        args - The command line arguments.
        Throws:
        java.io.IOException - If there is an error parsing the document.
      • usage

        private static void usage()
        This will print the usage for this document.
      • printMetadata

        public void printMetadata​(PDDocument document)
                           throws java.io.IOException
        This will print the documents data to System.out.
        Parameters:
        document - The document to get the metadata from.
        Throws:
        java.io.IOException - If there is an error getting the page count.
      • formatDate

        private java.lang.String formatDate​(java.util.Calendar date)
        This will format a date object.
        Parameters:
        date - The date to format.
        Returns:
        A string representation of the date.