Class FdfWriter
- java.lang.Object
-
- com.gitlab.pdftk_java.com.lowagie.text.pdf.FdfWriter
-
public class FdfWriter extends Object
Writes an FDF form.- Author:
- Paulo Soares (psoares@consiste.pt)
-
-
Constructor Summary
Constructors Constructor Description FdfWriter()Creates a new FdfWriter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetField(String field)Gets the field value.HashMapgetFields()Gets all the fields.StringgetFile()Gets the PDF file name associated with the FDF.booleanremoveField(String field)Removes the field value.booleansetFieldAsName(String field, String value)Sets the field value as a name.booleansetFieldAsString(String field, String value)Sets the field value as a string.voidsetFields(AcroFields af)Sets all the fields from thisAcroFieldsvoidsetFields(FdfReader fdf)Sets all the fields from thisFdfReadervoidsetFields(PdfReader pdf)Sets all the fields from thisPdfReadervoidsetFile(String file)Sets the PDF file name associated with the FDF.voidwriteTo(OutputStream os)Writes the content to a stream.
-
-
-
Method Detail
-
writeTo
public void writeTo(OutputStream os) throws DocumentException, IOException
Writes the content to a stream.- Parameters:
os- the stream- Throws:
DocumentException- on errorIOException- on error
-
removeField
public boolean removeField(String field)
Removes the field value.- Parameters:
field- the field name- Returns:
trueif the field was found and removed,falseotherwise
-
getFields
public HashMap 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
-
getField
public String getField(String field)
Gets the field value.- Parameters:
field- the field name- Returns:
- the field value or
nullif not found
-
setFieldAsName
public boolean setFieldAsName(String field, String value)
Sets the field value as a name.- Parameters:
field- the fully qualified field namevalue- the value- Returns:
trueif the value was inserted,falseif the name is incompatible with an existing field
-
setFieldAsString
public boolean setFieldAsString(String field, String value)
Sets the field value as a string.- Parameters:
field- the fully qualified field namevalue- the value- Returns:
trueif the value was inserted,falseif the name is incompatible with an existing field
-
setFields
public void setFields(FdfReader fdf)
Sets all the fields from thisFdfReader- Parameters:
fdf- theFdfReader
-
setFields
public void setFields(PdfReader pdf)
Sets all the fields from thisPdfReader- Parameters:
pdf- thePdfReader
-
setFields
public void setFields(AcroFields af)
Sets all the fields from thisAcroFields- Parameters:
af- theAcroFields
-
getFile
public String getFile()
Gets the PDF file name associated with the FDF.- Returns:
- the PDF file name associated with the FDF
-
setFile
public void setFile(String file)
Sets the PDF file name associated with the FDF.- Parameters:
file- the PDF file name associated with the FDF
-
-