com.lowagie.text.pdf.events

Class FieldPositioningEvents

public class FieldPositioningEvents extends PdfPageEventHelper implements PdfPCellEvent

Class that can be used to position AcroForm fields.
Field Summary
protected PdfFormFieldcellField
Keeps the form field that is to be positioned in a cellLayout event.
protected PdfWriterfieldWriter
The PdfWriter to use when a field has to added in a cell event.
protected HashMapgenericChunkFields
Keeps a map with fields that are to be positioned in inGenericTag.
floatpadding
Some extra padding that will be taken into account when defining the widget.
protected PdfFormFieldparent
The PdfFormField that is the parent of the field added in a cell event.
Constructor Summary
FieldPositioningEvents()
Creates a new event.
FieldPositioningEvents(PdfWriter writer, PdfFormField field)
Creates a new event.
FieldPositioningEvents(PdfFormField parent, PdfFormField field)
Creates a new event.
FieldPositioningEvents(PdfWriter writer, String text)
Creates a new event.
FieldPositioningEvents(PdfWriter writer, PdfFormField parent, String text)
Creates a new event.
Method Summary
voidaddField(String text, PdfFormField field)
Add a PdfFormField that has to be tied to a generic Chunk.
voidcellLayout(PdfPCell cell, Rectangle rect, PdfContentByte[] canvases)
voidonGenericTag(PdfWriter writer, Document document, Rectangle rect, String text)
voidsetPadding(float padding)
voidsetParent(PdfFormField parent)

Field Detail

cellField

protected PdfFormField cellField
Keeps the form field that is to be positioned in a cellLayout event.

fieldWriter

protected PdfWriter fieldWriter
The PdfWriter to use when a field has to added in a cell event.

genericChunkFields

protected HashMap genericChunkFields
Keeps a map with fields that are to be positioned in inGenericTag.

padding

public float padding
Some extra padding that will be taken into account when defining the widget.

parent

protected PdfFormField parent
The PdfFormField that is the parent of the field added in a cell event.

Constructor Detail

FieldPositioningEvents

public FieldPositioningEvents()
Creates a new event. This constructor will be used if you need to position fields with Chunk objects.

FieldPositioningEvents

public FieldPositioningEvents(PdfWriter writer, PdfFormField field)
Creates a new event. This constructor will be used if you need to position fields with a Cell Event.

FieldPositioningEvents

public FieldPositioningEvents(PdfFormField parent, PdfFormField field)
Creates a new event. This constructor will be used if you need to position fields with a Cell Event.

FieldPositioningEvents

public FieldPositioningEvents(PdfWriter writer, String text)
Creates a new event. This constructor will be used if you need to position fields with a Cell Event.

Throws: DocumentException IOException

FieldPositioningEvents

public FieldPositioningEvents(PdfWriter writer, PdfFormField parent, String text)
Creates a new event. This constructor will be used if you need to position fields with a Cell Event.

Throws: DocumentException IOException

Method Detail

addField

public void addField(String text, PdfFormField field)
Add a PdfFormField that has to be tied to a generic Chunk.

cellLayout

public void cellLayout(PdfPCell cell, Rectangle rect, PdfContentByte[] canvases)

See Also: (com.lowagie.text.pdf.PdfPCell, com.lowagie.text.Rectangle, com.lowagie.text.pdf.PdfContentByte[])

onGenericTag

public void onGenericTag(PdfWriter writer, Document document, Rectangle rect, String text)

See Also: PdfPageEvent

setPadding

public void setPadding(float padding)

Parameters: padding The padding to set.

setParent

public void setParent(PdfFormField parent)

Parameters: parent The parent to set.