Top Description Constructors Methods
org.apache.pdfbox.examples.util

public final Class RemoveAllText

extends Object
Class Inheritance
Imports
java.io.File, .IOException, .OutputStream, java.util.ArrayList, .List, org.apache.pdfbox.Loader, org.apache.pdfbox.contentstream.PDContentStream, org.apache.pdfbox.contentstream.operator.Operator, .OperatorName, org.apache.pdfbox.cos.COSName, org.apache.pdfbox.pdfparser.PDFStreamParser, org.apache.pdfbox.pdfwriter.ContentStreamWriter, org.apache.pdfbox.pdmodel.PDDocument, .PDPage, .PDResources, org.apache.pdfbox.pdmodel.common.PDStream, org.apache.pdfbox.pdmodel.graphics.PDXObject, org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject, org.apache.pdfbox.pdmodel.graphics.pattern.PDAbstractPattern, .PDTilingPattern

This is an example on how to remove all text from PDF document.
Author
Ben Litchfield

Constructor Summary

AccessConstructor and Description
private
RemoveAllText()

Default constructor.

Method Summary

Modifier and TypeMethod and Description
private static List<Object>
public static void
main(String[]
The command line arguments.
args
)

This will remove all text from a PDF document.

private static void
private static void
usage()

This will print the usage for this document.

private static void
writeTokensToStream(PDStream newContents, List<Object> newTokens)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

RemoveAllTextback to summary
private RemoveAllText()

Default constructor.

Method Detail

createTokensWithoutTextback to summary
private static List<Object> createTokensWithoutText(PDContentStream contentStream) throws IOException
mainback to summary
public static void main(String[] args) throws IOException

This will remove all text from a PDF document.

Parameters
args:String[]

The command line arguments.

Exceptions
IOException:
If there is an error parsing the document.
processResourcesback to summary
private static void processResources(PDResources resources) throws IOException
usageback to summary
private static void usage()

This will print the usage for this document.

writeTokensToStreamback to summary
private static void writeTokensToStream(PDStream newContents, List<Object> newTokens) throws IOException