HiraokaHyperTools.iTextSharp-LGPL  0.2.5
iTextSharp.text.pdf.TextField Class Reference
Inheritance diagram for iTextSharp.text.pdf.TextField:
iTextSharp.text.pdf.BaseField

Public Member Functions

 TextField (PdfWriter writer, Rectangle box, String fieldName)
 
PdfAppearance GetAppearance ()
 
PdfFormField GetTextField ()
 
PdfFormField GetComboField ()
 
PdfFormField GetListField ()
 
void SetExtraMargin (float extraMarginLeft, float extraMarginTop)
 
- Public Member Functions inherited from iTextSharp.text.pdf.BaseField
 BaseField (PdfWriter writer, Rectangle box, String fieldName)
 
void SetRotationFromPage (Rectangle page)
 

Static Public Member Functions

static String RemoveCRLF (String text)
 
static String ObfuscatePassword (String text)
 
- Static Public Member Functions inherited from iTextSharp.text.pdf.BaseField
static void MoveFields (PdfDictionary from, PdfDictionary to)
 

Protected Member Functions

PdfFormField GetChoiceField (bool isList)
 
- Protected Member Functions inherited from iTextSharp.text.pdf.BaseField
PdfAppearance GetBorderAppearance ()
 

Properties

string DefaultText [get, set]
 
string[] Choices [get, set]
 
string[] ChoiceExports [get, set]
 
int ChoiceSelection [get, set]
 
ArrayList SubstitutionFonts [get, set]
 
BaseFont ExtensionFont [get, set]
 
- Properties inherited from iTextSharp.text.pdf.BaseField
BaseFont RealFont [get]
 
float BorderWidth [get, set]
 
int BorderStyle [get, set]
 
Color BorderColor [get, set]
 
Color BackgroundColor [get, set]
 
Color TextColor [get, set]
 
BaseFont Font [get, set]
 
float FontSize [get, set]
 
int Alignment [get, set]
 
string Text [get, set]
 
Rectangle Box [get, set]
 
int Rotation [get, set]
 
int Visibility [get, set]
 
string FieldName [get, set]
 
int Options [get, set]
 
int MaxCharacterLength [get, set]
 
PdfWriter Writer [get, set]
 

Additional Inherited Members

- Static Public Attributes inherited from iTextSharp.text.pdf.BaseField
const float BORDER_WIDTH_THIN = 1
 
const float BORDER_WIDTH_MEDIUM = 2
 
const float BORDER_WIDTH_THICK = 3
 
const int VISIBLE = 0
 
const int HIDDEN = 1
 
const int VISIBLE_BUT_DOES_NOT_PRINT = 2
 
const int HIDDEN_BUT_PRINTABLE = 3
 
const int READ_ONLY = PdfFormField.FF_READ_ONLY
 
const int REQUIRED = PdfFormField.FF_REQUIRED
 
const int MULTILINE = PdfFormField.FF_MULTILINE
 
const int DO_NOT_SCROLL = PdfFormField.FF_DONOTSCROLL
 
const int PASSWORD = PdfFormField.FF_PASSWORD
 
const int FILE_SELECTION = PdfFormField.FF_FILESELECT
 
const int DO_NOT_SPELL_CHECK = PdfFormField.FF_DONOTSPELLCHECK
 
const int EDIT = PdfFormField.FF_EDIT
 
const int COMB = PdfFormField.FF_COMB
 
- Static Protected Member Functions inherited from iTextSharp.text.pdf.BaseField
static ArrayList GetHardBreaks (String text)
 
static void TrimRight (StringBuilder buf)
 
static ArrayList BreakLines (ArrayList breaks, BaseFont font, float fontSize, float width)
 
- Protected Attributes inherited from iTextSharp.text.pdf.BaseField
float borderWidth = BORDER_WIDTH_THIN
 
int borderStyle = PdfBorderDictionary.STYLE_SOLID
 
Color borderColor
 
Color backgroundColor
 
Color textColor
 
BaseFont font
 
float fontSize = 0
 
int alignment = Element.ALIGN_LEFT
 
PdfWriter writer
 
String text
 
Rectangle box
 
int rotation = 0
 
int visibility
 
String fieldName
 
int options
 
int maxCharacterLength
 

Detailed Description

Supports text, combo and list fields generating the correct appearances. All the option in the Acrobat GUI are supported in an easy to use API.

Author
Paulo Soares (psoar.nosp@m.es@c.nosp@m.onsis.nosp@m.te.p.nosp@m.t)

Constructor & Destructor Documentation

◆ TextField()

iTextSharp.text.pdf.TextField.TextField ( PdfWriter  writer,
Rectangle  box,
String  fieldName 
)

Creates a new TextField.

Parameters
writerthe document PdfWriter
boxthe field location and dimensions
fieldNamethe field name. If null only the widget keys will be included in the field allowing it to be used as a kid field.

Member Function Documentation

◆ GetAppearance()

PdfAppearance iTextSharp.text.pdf.TextField.GetAppearance ( )

Get the PdfAppearance of a text or combo field

Exceptions
IOExceptionon error
DocumentExceptionon error
Returns
A PdfAppearance

◆ GetChoiceField()

PdfFormField iTextSharp.text.pdf.TextField.GetChoiceField ( bool  isList)
protected

◆ GetComboField()

PdfFormField iTextSharp.text.pdf.TextField.GetComboField ( )

Gets a new combo field.

Exceptions
IOExceptionon error
DocumentExceptionon error
Returns
a new combo field

◆ GetListField()

PdfFormField iTextSharp.text.pdf.TextField.GetListField ( )

Gets a new list field.

Exceptions
IOExceptionon error
DocumentExceptionon error
Returns
a new list field

◆ GetTextField()

PdfFormField iTextSharp.text.pdf.TextField.GetTextField ( )

Gets a new text field.

Exceptions
IOExceptionon error
DocumentExceptionon error
Returns
a new text field

◆ ObfuscatePassword()

static String iTextSharp.text.pdf.TextField.ObfuscatePassword ( String  text)
static

Obfuscates a password String. Every character is replaced by an asterisk (*).

Parameters
text
Returns
String
Since
2.1.5

◆ RemoveCRLF()

static String iTextSharp.text.pdf.TextField.RemoveCRLF ( String  text)
static

◆ SetExtraMargin()

void iTextSharp.text.pdf.TextField.SetExtraMargin ( float  extraMarginLeft,
float  extraMarginTop 
)

Sets extra margins in text fields to better mimic the Acrobat layout.

Parameters
extraMarginLeftthe extra marging left
extraMarginTopthe extra margin top

Property Documentation

◆ ChoiceExports

string [] iTextSharp.text.pdf.TextField.ChoiceExports
getset

Sets the export values in list/combo fields. If this array is null then the choice values will also be used as the export values.

Parameters
choiceExportsthe export values in list/combo fields

◆ Choices

string [] iTextSharp.text.pdf.TextField.Choices
getset

Sets the choices to be presented to the user in list/combo fields.

Parameters
choicesthe choices to be presented to the user

◆ ChoiceSelection

int iTextSharp.text.pdf.TextField.ChoiceSelection
getset

Sets the zero based index of the selected item.

Parameters
choiceSelectionthe zero based index of the selected item

◆ DefaultText

string iTextSharp.text.pdf.TextField.DefaultText
getset

Sets the default text. It is only meaningful for text fields.

Parameters
defaultTextthe default text

◆ ExtensionFont

BaseFont iTextSharp.text.pdf.TextField.ExtensionFont
getset

Sets the extensionFont. This font will be searched before the substitution fonts. It may be null.

Parameters
extensionFontNew value of property extensionFont.

◆ SubstitutionFonts

ArrayList iTextSharp.text.pdf.TextField.SubstitutionFonts
getset

Sets a list of substitution fonts. The list is composed of BaseFont and can also be null. The fonts in this list will be used if the original font doesn't contain the needed glyphs.

Parameters
substitutionFontsthe list

The documentation for this class was generated from the following file: