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

public Class ImportXFDF

extends Object
implements Callable<Integer>
Class Inheritance
All Implemented Interfaces
java.util.concurrent.Callable
Annotations
@Command
name:importxfdf
header:Imports AcroForm form data from XFDF
versionProvider:Version
mixinStandardHelpOptions:true
Imports
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, java.io.File, .IOException, .PrintStream, java.util.concurrent.Callable

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

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
ImportXFDF()

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

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
xfdffileback to summary
private File xfdffile
Annotations
@Option
names:--data
description:the XFDF data file to import from
required:true

Constructor Detail

ImportXFDFback to summary
public ImportXFDF()

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