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

public Class ImportFDF

extends Object
implements Callable<Integer>
Class Inheritance
All Implemented Interfaces
java.util.concurrent.Callable
Annotations
@Command
name:importfdf
header:Imports AcroForm form data from FDF
versionProvider:Version
mixinStandardHelpOptions:true
Imports
java.io.File, .IOException, .PrintStream, java.util.concurrent.Callable, org.apache.pdfbox.pdmodel.PDDocument, .PDDocumentCatalog, org.apache.pdfbox.Loader, org.apache.pdfbox.pdmodel.fdf.FDFDocument, org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm, picocli.CommandLine, .CommandLine.Command, .CommandLine.Option

This example will take a PDF document and fill the fields with data from the FDF fields.
Author
Ben Litchfield

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
ImportFDF()

Constructor.

Method Summary

Modifier and TypeMethod and Description
public Integer
call()

Implements java.util.concurrent.Callable.call.

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

public void
importFDF(PDDocument
The document to put the fdf data into.
pdfDocument
,
FDFDocument
The FDF document to get the data from.
fdfDocument
)

This will takes the values from the fdf document and import them into the PDF document.

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

This will import an fdf document and write out another pdf.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fdffileback to summary
private File fdffile
Annotations
@Option
names:--data
description:the FDF data file to import from
required:true
infileback to summary
private File infile
Annotations
@Option
names:-i, --input
description:the PDF file to import to
required:true
outfileback to summary
private File outfile
Annotations
@Option
names:-o, --output
description:the PDF file to save to. If omitted the original file will be used
SYSERRback to summary
private final PrintStream SYSERR
Annotations
@SuppressWarnings:squid:S106

Constructor Detail

ImportFDFback to summary
public ImportFDF()

Constructor.

Method Detail

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

importFDFback to summary
public void importFDF(PDDocument pdfDocument, FDFDocument fdfDocument) throws IOException

This will takes the values from the fdf document and import them into the PDF document.

Parameters
pdfDocument:PDDocument

The document to put the fdf data into.

fdfDocument:FDFDocument

The FDF document to get the data from.

Exceptions
IOException:
If there is an error setting the data in the field.
mainback to summary
public static void main(String[] args)

This will import an fdf document and write out another pdf.
see usage() for commandline

Parameters
args:String[]

command line arguments