public class FieldPositioningEvents extends PdfPageEventHelper implements PdfPCellEvent
Modifier and Type | Field and Description |
---|---|
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<String,PdfFormField> |
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 and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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) |
onChapter, onChapterEnd, onCloseDocument, onEndPage, onOpenDocument, onParagraph, onParagraphEnd, onSection, onSectionEnd, onStartPage
protected HashMap<String,PdfFormField> genericChunkFields
protected PdfFormField cellField
protected PdfWriter fieldWriter
protected PdfFormField parent
public float padding
public FieldPositioningEvents()
public FieldPositioningEvents(PdfWriter writer, PdfFormField field)
public FieldPositioningEvents(PdfFormField parent, PdfFormField field)
public FieldPositioningEvents(PdfWriter writer, String text) throws IOException, DocumentException
DocumentException
IOException
public FieldPositioningEvents(PdfWriter writer, PdfFormField parent, String text) throws IOException, DocumentException
DocumentException
IOException
public void addField(String text, PdfFormField field)
public void setPadding(float padding)
padding
- The padding to set.
public void setParent(PdfFormField parent)
parent
- The parent to set.
public void onGenericTag(PdfWriter writer, Document document, Rectangle rect, String text)
PdfPageEventHelper
Chunk
with a generic tag is written.
It is useful to pinpoint the Chunk
location to generate bookmarks, for example.
onGenericTag
in interface PdfPageEvent
onGenericTag
in class PdfPageEventHelper
writer
- the PdfWriter
for this document
document
- the document
rect
- the Rectangle
containing the Chunk
text
- the text of the tag
PdfPageEvent.onGenericTag(com.itextpdf.text.pdf.PdfWriter, com.itextpdf.text.Document, com.itextpdf.text.Rectangle, java.lang.String)
public void cellLayout(PdfPCell cell, Rectangle rect, PdfContentByte[] canvases)
PdfPCellEvent
PdfContentByte
contained in canvases
.
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. cellLayout
in interface PdfPCellEvent
cell
- the cell
rect
- the coordinates of the cell
canvases
- an array of PdfContentByte
PdfPCellEvent.cellLayout(com.itextpdf.text.pdf.PdfPCell, com.itextpdf.text.Rectangle, com.itextpdf.text.pdf.PdfContentByte[])
Copyright © 2016. All rights reserved.