Top Description Fields Constructors Methods
org.apache.pdfbox.tools

public Class WriteDecodedDoc

extends Object
implements Callable<Integer>
Class Inheritance
All Implemented Interfaces
java.util.concurrent.Callable
Annotations
@Command
name:writedecodeddoc
header:Writes a PDF document with all streams decoded
versionProvider:Version
mixinStandardHelpOptions:true
Imports
java.io.File, .IOException, .OutputStream, .PrintStream, java.util.concurrent.Callable, org.apache.pdfbox.Loader, org.apache.pdfbox.cos.COSBase, .COSDocument, .COSName, .COSObject, .COSStream, org.apache.pdfbox.pdfwriter.compress.CompressParameters, org.apache.pdfbox.pdmodel.PDDocument, org.apache.pdfbox.pdmodel.common.PDStream, picocli.CommandLine, .CommandLine.Command, .CommandLine.Option, .CommandLine.Parameters

load document and write with all streams decoded.
Author
Michael Traut

Field Summary

Modifier and TypeField and Description
private File
private File
private String
private boolean
private final PrintStream

Constructor Summary

AccessConstructor and Description
public
WriteDecodedDoc()

Constructor.

Method Summary

Modifier and TypeMethod and Description
private static String
public Integer
call()

Implements java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

public void
doIt(String
The filename used for input.
in
,
String
The filename used for output.
out
,
String
The password to open the document.
password
,
boolean
Whether to skip decoding images.
skipImages
)

This will perform the document reading, decoding and writing.

public static void
main(String[]
command line arguments
args
)

This will write a PDF document with completely decoded streams.

private void
processObject(COSObject cosObject, boolean skipImages)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

infileback to summary
private File infile
Annotations
@Parameters
paramLabel:inputfile
index:0
description:the PDF document to be decompressed
outfileback to summary
private File outfile
Annotations
@Parameters
paramLabel:outputfile
arity:0..1
description:the PDF file to save to.
passwordback to summary
private String password
Annotations
@Option
names:-password
description:the password to decrypt the document
arity:0..1
interactive:true
skipImagesback to summary
private boolean skipImages
Annotations
@Option
names:-skipImages
description:don\'t uncompress images
SYSERRback to summary
private final PrintStream SYSERR
Annotations
@SuppressWarnings:squid:S106

Constructor Detail

WriteDecodedDocback to summary
public WriteDecodedDoc()

Constructor.

Method Detail

calculateOutputFilenameback to summary
private static String calculateOutputFilename(String filename)
callback to summary
public Integer call()

Implements java.util.concurrent.Callable.call.

Doc from java.util.concurrent.Callable.call.

Computes a result, or throws an exception if unable to do so.

Returns:Integer

computed result

doItback to summary
public void doIt(String in, String out, String password, boolean skipImages) throws IOException

This will perform the document reading, decoding and writing.

Parameters
in:String

The filename used for input.

out:String

The filename used for output.

password:String

The password to open the document.

skipImages:boolean

Whether to skip decoding images.

Exceptions
IOException:
if the output could not be written
mainback to summary
public static void main(String[] args)

This will write a PDF document with completely decoded streams.
see usage() for commandline

Parameters
args:String[]

command line arguments

processObjectback to summary
private void processObject(COSObject cosObject, boolean skipImages)