public class FdfWriter extends Object
Constructor and Description |
---|
FdfWriter()
Creates a new FdfWriter.
|
FdfWriter(OutputStream os) |
Modifier and Type | Method and Description |
---|---|
PdfTemplate |
createTemplate(float width, float height) |
protected Counter |
getCounter() |
String |
getField(String field)
Gets the field value.
|
HashMap<String,Object> |
getFields()
Gets all the fields.
|
String |
getFile()
Gets the PDF file name associated with the FDF.
|
PdfImportedPage |
getImportedPage(PdfReader reader, int pageNumber) |
String |
getStatusMessage() |
boolean |
removeField(String field)
Removes the field value.
|
boolean |
setFieldAsAction(String field, PdfAction action)
Sets the field value as a PDFAction .
|
boolean |
setFieldAsImage(String field, Image image) |
boolean |
setFieldAsJavascript(String field, PdfName jsTrigName, String js) |
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.
|
boolean |
setFieldAsTemplate(String field, PdfTemplate template) |
void |
setFields(AcroFields af)
Sets all the fields from this AcroFields
|
void |
setFields(FdfReader fdf)
Sets all the fields from this FdfReader
|
void |
setFields(PdfReader pdf)
Sets all the fields from this PdfReader
|
void |
setFile(String file)
Sets the PDF file name associated with the FDF.
|
void |
setStatusMessage(String statusMessage) |
void |
write() |
void |
writeTo(OutputStream os)
Writes the content to a stream.
|
protected Counter COUNTER
public FdfWriter()
public FdfWriter(OutputStream os) throws IOException
IOException
public void writeTo(OutputStream os) throws IOException
os
- the stream
IOException
- on error
public void write() throws IOException
IOException
public String getStatusMessage()
public void setStatusMessage(String statusMessage)
public boolean removeField(String field)
field
- the field name
true
if the field was found and removed, false
otherwise
public HashMap<String,Object> getFields()
PdfObject
.
public String getField(String field)
field
- the field name
null
if not found
public boolean setFieldAsName(String field, String value)
field
- the fully qualified field name
value
- the value
true
if the value was inserted, false
if the name is incompatible with an existing field
public boolean setFieldAsString(String field, String value)
field
- the fully qualified field name
value
- the value
true
if the value was inserted, false
if the name is incompatible with an existing field
public boolean setFieldAsAction(String field, PdfAction action)
PDFAction
. For example, this method allows setting a form submit button action using PdfAction.createSubmitForm(String, Object[], int)
. This method creates an A
entry for the specified field in the underlying FDF file. Method contributed by Philippe Laflamme (plaflamme)
field
- the fully qualified field name
action
- the field's action
true
if the value was inserted, false
if the name is incompatible with an existing field
public boolean setFieldAsTemplate(String field, PdfTemplate template)
public boolean setFieldAsJavascript(String field, PdfName jsTrigName, String js)
public PdfImportedPage getImportedPage(PdfReader reader, int pageNumber)
public PdfTemplate createTemplate(float width, float height)
public void setFields(FdfReader fdf)
FdfReader
fdf
- the FdfReader
public void setFields(PdfReader pdf)
PdfReader
pdf
- the PdfReader
public void setFields(AcroFields af)
AcroFields
af
- the AcroFields
public String getFile()
public void setFile(String file)
file
- the PDF file name associated with the FDF
protected Counter getCounter()
Copyright © 1998–2024. All rights reserved.