Package org.apache.pdfbox.examples.util
Class RemoveAllText
java.lang.Object
org.apache.pdfbox.examples.util.RemoveAllText
This is an example on how to remove all text from PDF document.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateTokensWithoutText(PDContentStream contentStream) static voidThis will remove all text from a PDF document.private static voidprocessResources(PDResources resources) private static voidusage()This will print the usage for this document.private static voidwriteTokensToStream(PDStream newContents, List<Object> newTokens)
-
Constructor Details
-
RemoveAllText
private RemoveAllText()Default constructor.
-
-
Method Details
-
main
This will remove all text from a PDF document.- Parameters:
args- The command line arguments.- Throws:
IOException- If there is an error parsing the document.
-
processResources
- Throws:
IOException
-
writeTokensToStream
private static void writeTokensToStream(PDStream newContents, List<Object> newTokens) throws IOException - Throws:
IOException
-
createTokensWithoutText
private static List<Object> createTokensWithoutText(PDContentStream contentStream) throws IOException - Throws:
IOException
-
usage
private static void usage()This will print the usage for this document.
-