Package org.apache.pdfbox.examples.util
Class RemoveAllText
- java.lang.Object
-
- org.apache.pdfbox.examples.util.RemoveAllText
-
public final class RemoveAllText extends java.lang.ObjectThis is an example on how to remove all text from PDF document.
-
-
Constructor Summary
Constructors Modifier Constructor Description privateRemoveAllText()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 voidmain(java.lang.String[] args)This 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, java.util.List<java.lang.Object> newTokens)
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.io.IOExceptionThis 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.
-
-