Package com.lowagie.text.pdf
Class FdfWriter
java.lang.Object
com.lowagie.text.pdf.FdfWriter
Writes an FDF form.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the field value.Gets all the fields.getFile()
Gets the PDF file name associated with the FDF.(package private) void
boolean
removeField
(String field) Removes the field value.(package private) boolean
boolean
setFieldAsAction
(String field, PdfAction action) Sets the field value as aPDFAction
.boolean
setFieldAsName
(String field, String value) Sets the field value as a name.boolean
setFieldAsString
(String field, String value) Sets the field value as a string.void
setFields
(AcroFields af) Sets all the fields from thisAcroFields
void
Sets all the fields from thisFdfReader
void
Sets all the fields from thisPdfReader
void
Sets the PDF file name associated with the FDF.void
writeTo
(OutputStream os) Writes the content to a stream.
-
Field Details
-
HEADER_FDF
private static final byte[] HEADER_FDF -
fields
-
file
The PDF file associated with the FDF.
-
-
Constructor Details
-
FdfWriter
public FdfWriter()Creates a new FdfWriter.
-
-
Method Details
-
writeTo
Writes the content to a stream.- Parameters:
os
- the stream- Throws:
IOException
- on error
-
setField
-
iterateFields
-
removeField
Removes the field value.- Parameters:
field
- the field name- Returns:
true
if the field was found and removed,false
otherwise
-
getFields
Gets all the fields. The map is keyed by the fully qualified field name and the values arePdfObject
.- Returns:
- a map with all the fields
-
setFields
Sets all the fields from thisFdfReader
- Parameters:
fdf
- theFdfReader
-
setFields
Sets all the fields from thisPdfReader
- Parameters:
pdf
- thePdfReader
-
setFields
Sets all the fields from thisAcroFields
- Parameters:
af
- theAcroFields
-
getField
Gets the field value.- Parameters:
field
- the field name- Returns:
- the field value or
null
if not found
-
setFieldAsName
Sets the field value as a name.- Parameters:
field
- the fully qualified field namevalue
- the value- Returns:
true
if the value was inserted,false
if the name is incompatible with an existing field
-
setFieldAsString
Sets the field value as a string.- Parameters:
field
- the fully qualified field namevalue
- the value- Returns:
true
if the value was inserted,false
if the name is incompatible with an existing field
-
setFieldAsAction
Sets the field value as aPDFAction
. For example, this method allows setting a form submit button action usingPdfAction.createSubmitForm(String, Object[], int)
. This method creates anA
entry for the specified field in the underlying FDF file. Method contributed by Philippe Laflamme (plaflamme)- Parameters:
field
- the fully qualified field nameaction
- the field's action- Returns:
true
if the value was inserted,false
if the name is incompatible with an existing field- Since:
- 2.1.5
-
getFile
Gets the PDF file name associated with the FDF.- Returns:
- the PDF file name associated with the FDF
-
setFile
Sets the PDF file name associated with the FDF.- Parameters:
file
- the PDF file name associated with the FDF
-