Class RemoveAllText


  • public final class RemoveAllText
    extends java.lang.Object
    This is an example on how to remove all text from PDF document.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private RemoveAllText()
      Default constructor.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.util.List<java.lang.Object> createTokensWithoutText​(PDContentStream contentStream)  
      static void main​(java.lang.String[] args)
      This will remove all text from a PDF document.
      private static void processResources​(PDResources resources)  
      private static void usage()
      This will print the usage for this document.
      private static void writeTokensToStream​(PDStream newContents, java.util.List<java.lang.Object> newTokens)  
      • Methods inherited from class java.lang.Object

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

      • RemoveAllText

        private RemoveAllText()
        Default constructor.
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.io.IOException
        This will remove all text from a PDF document.
        Parameters:
        args - The command line arguments.
        Throws:
        java.io.IOException - If there is an error parsing the document.
      • processResources

        private static void processResources​(PDResources resources)
                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • writeTokensToStream

        private static void writeTokensToStream​(PDStream newContents,
                                                java.util.List<java.lang.Object> newTokens)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • createTokensWithoutText

        private static java.util.List<java.lang.Object> createTokensWithoutText​(PDContentStream contentStream)
                                                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • usage

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