Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.lowagie.text.pdf.events
Class FieldPositioningEvents

    java.lang.Object
      com.lowagie.text.pdf.PdfPageEventHelper
          com.lowagie.text.pdf.events.FieldPositioningEvents

All Implemented Interfaces:
  PdfPageEvent, PdfPCellEvent

    public class FieldPositioningEvents

extends PdfPageEventHelper
implements PdfPCellEvent

Class for an index.

Author:
  Michael Niedermair

Field Summary
`protected PdfFormField` | `cellField` Keeps the form field that is to be positioned in a cellLayout event.
`protected PdfWriter` | `fieldWriter` The PdfWriter to use when a field has to added in a cell event.
`protected HashMap` | `genericChunkFields` Keeps a map with fields that are to be positioned in inGenericTag.
`float` | `padding` Some extra padding that will be taken into account when defining the widget.
`protected PdfFormField` | `parent` The PdfFormField that is the parent of the field added in a cell event.

Constructor Summary
`FieldPositioningEvents()` Creates a new event.
`FieldPositioningEvents(PdfFormField parent, PdfFormField field)` Creates a new event.
`FieldPositioningEvents(PdfWriter writer, PdfFormField field)` Creates a new event.
`FieldPositioningEvents(PdfWriter writer, PdfFormField parent, String text)` Creates a new event.
`FieldPositioningEvents(PdfWriter writer, String text)` Creates a new event.

Method Summary
`void` | `addField(String text, PdfFormField field)` Add a PdfFormField that has to be tied to a generic Chunk.
`void` | `cellLayout(PdfPCell cell, Rectangle rect, PdfContentByte[] canvases)` This method is called at the end of the cell rendering.
`void` | `onGenericTag(PdfWriter writer, Document document, Rectangle rect, String text)` Called when a `Chunk` with a generic tag is written.
`void` | `setPadding(float padding)`
`void` | `setParent(PdfFormField parent)`

Methods inherited from class com.lowagie.text.pdf.PdfPageEventHelper
`onChapter, onChapterEnd, onCloseDocument, onEndPage, onOpenDocument, onParagraph, onParagraphEnd, onSection, onSectionEnd, onStartPage`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### genericChunkFields

    protected HashMap genericChunkFields

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

### 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.

### parent

    protected PdfFormField parent

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

### padding

    public float padding

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

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)
                           throws IOException,
                                  DocumentException

  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)
                           throws IOException,
                                  DocumentException

  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.

### setPadding

    public void setPadding(float padding)

  Parameters:
    `padding` - The padding to set.

### setParent

    public void setParent(PdfFormField parent)

  Parameters:
    `parent` - The parent to set.

### onGenericTag

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

  Description copied from class: `PdfPageEventHelper`
  Called when a `Chunk` with a generic tag is written.

  It is usefull to pinpoint the `Chunk` location to generate bookmarks, for example.

  Specified by:
    `onGenericTag` in interface `PdfPageEvent`
  Overrides:
    `onGenericTag` in class `PdfPageEventHelper`
  Parameters:
    `writer` - the `PdfWriter` for this document
    `document` - the document
    `rect` - the `Rectangle` containing the `Chunk`
    `text` - the text of the tag
  See Also:
    `PdfPageEvent.onGenericTag(com.lowagie.text.pdf.PdfWriter, com.lowagie.text.Document, com.lowagie.text.Rectangle, java.lang.String)`

### cellLayout

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

  Description copied from interface: `PdfPCellEvent`
  This method is called at the end of the cell rendering. The text or graphics are added to one of the 4 `PdfContentByte` contained in `canvases`.
  The indexes to `canvases` are:

  - `PdfPTable.BASECANVAS` - the original `PdfContentByte`. Anything placed here will be under the cell.
  - `PdfPTable.BACKGROUNDCANVAS` - the layer where the background goes to.
  - `PdfPTable.LINECANVAS` - the layer where the lines go to.
  - `PdfPTable.TEXTCANVAS` - the layer where the text go to. Anything placed here will be over the cell.
  The layers are placed in sequence on top of each other.

  Specified by:
    `cellLayout` in interface `PdfPCellEvent`
  Parameters:
    `cell` - the cell
    `rect` - the coordinates of the cell
    `canvases` - an array of `PdfContentByte`
  See Also:
    `PdfPCellEvent.cellLayout(com.lowagie.text.pdf.PdfPCell, com.lowagie.text.Rectangle, com.lowagie.text.pdf.PdfContentByte[])`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD