Class FdfWriter
java.lang.Object
com.itextpdf.text.pdf.FdfWriter
Writes an FDF form.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Counterprivate StringThe PDF file associated with the FDF.private static final byte[]private String(package private) FdfWriter.Wrt -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateTemplate(float width, float height) protected CounterGets the field value.Gets all the fields.getFile()Gets the PDF file name associated with the FDF.getImportedPage(PdfReader reader, int pageNumber) (package private) voidbooleanremoveField(String field) Removes the field value.(package private) booleanbooleansetFieldAsAction(String field, PdfAction action) Sets the field value as aPDFAction.booleansetFieldAsImage(String field, Image image) booleansetFieldAsJavascript(String field, PdfName jsTrigName, String js) booleansetFieldAsName(String field, String value) Sets the field value as a name.booleansetFieldAsString(String field, String value) Sets the field value as a string.booleansetFieldAsTemplate(String field, PdfTemplate template) voidsetFields(AcroFields af) Sets all the fields from thisAcroFieldsvoidSets all the fields from thisFdfReadervoidSets all the fields from thisPdfReadervoidSets the PDF file name associated with the FDF.voidsetStatusMessage(String statusMessage) voidwrite()voidwriteTo(OutputStream os) Writes the content to a stream.
-
Field Details
-
HEADER_FDF
private static final byte[] HEADER_FDF -
fields
-
wrt
FdfWriter.Wrt wrt -
file
The PDF file associated with the FDF. -
statusMessage
-
COUNTER
-
-
Constructor Details
-
FdfWriter
public FdfWriter()Creates a new FdfWriter. -
FdfWriter
- Throws:
IOException
-
-
Method Details
-
writeTo
Writes the content to a stream.- Parameters:
os- the stream- Throws:
IOException- on error
-
write
- Throws:
IOException
-
getStatusMessage
-
setStatusMessage
-
setField
-
iterateFields
-
removeField
Removes the field value.- Parameters:
field- the field name- Returns:
trueif the field was found and removed,falseotherwise
-
getFields
-
getField
-
setFieldAsName
-
setFieldAsString
-
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 anAentry 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:
trueif the value was inserted,falseif the name is incompatible with an existing field- Since:
- 2.1.5
-
setFieldAsTemplate
-
setFieldAsImage
-
setFieldAsJavascript
-
getImportedPage
-
createTemplate
-
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
-
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
-
getCounter
-