HiraokaHyperTools.iTextSharp-LGPL
0.2.5
|
Public Member Functions | |
RadioCheckField (PdfWriter writer, Rectangle box, String fieldName, String onValue) | |
PdfAppearance | GetAppearance (bool isRadio, bool on) |
PdfAppearance | GetAppearanceRadioCircle (bool on) |
PdfFormField | GetRadioGroup (bool noToggleToOff, bool radiosInUnison) |
![]() | |
BaseField (PdfWriter writer, Rectangle box, String fieldName) | |
void | SetRotationFromPage (Rectangle page) |
Static Public Attributes | |
const int | TYPE_CHECK = 1 |
const int | TYPE_CIRCLE = 2 |
const int | TYPE_CROSS = 3 |
const int | TYPE_DIAMOND = 4 |
const int | TYPE_SQUARE = 5 |
const int | TYPE_STAR = 6 |
![]() | |
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 |
Protected Member Functions | |
PdfFormField | GetField (bool isRadio) |
![]() | |
PdfAppearance | GetBorderAppearance () |
Properties | |
int | CheckType [get, set] |
string | OnValue [get, set] |
bool | Checked [get, set] |
PdfFormField | RadioField [get] |
PdfFormField | CheckField [get] |
![]() | |
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 void | MoveFields (PdfDictionary from, PdfDictionary to) |
![]() | |
static ArrayList | GetHardBreaks (String text) |
static void | TrimRight (StringBuilder buf) |
static ArrayList | BreakLines (ArrayList breaks, BaseFont font, float fontSize, float width) |
![]() | |
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 |
Creates a radio or a check field.
Example usage:
Document document = new Document(PageSize.A4, 50, 50, 50, 50); PdfWriter writer = PdfWriter.GetInstance(document, new FileOutputStream("output.pdf")); document.Open(); PdfContentByte cb = writer.GetDirectContent(); RadioCheckField bt = new RadioCheckField(writer, new Rectangle(100, 100, 200, 200), "radio", "v1"); bt.SetCheckType(RadioCheckField.TYPE_CIRCLE); bt.SetBackgroundColor(Color.CYAN); bt.SetBorderStyle(PdfBorderDictionary.STYLE_SOLID); bt.SetBorderColor(Color.red); bt.SetTextColor(Color.yellow); bt.SetBorderWidth(BaseField.BORDER_WIDTH_THICK); bt.SetChecked(false); PdfFormField f1 = bt.GetRadioField(); bt.SetOnValue("v2"); bt.SetChecked(true); bt.SetBox(new Rectangle(100, 300, 200, 400)); PdfFormField f2 = bt.GetRadioField(); bt.SetChecked(false); PdfFormField top = bt.GetRadioGroup(true, false); bt.SetOnValue("v3"); bt.SetBox(new Rectangle(100, 500, 200, 600)); PdfFormField f3 = bt.GetRadioField(); top.AddKid(f1); top.AddKid(f2); top.AddKid(f3); writer.AddAnnotation(top); bt = new RadioCheckField(writer, new Rectangle(300, 300, 400, 400), "check1", "Yes"); bt.SetCheckType(RadioCheckField.TYPE_CHECK); bt.SetBorderWidth(BaseField.BORDER_WIDTH_THIN); bt.SetBorderColor(Color.black); bt.SetBackgroundColor(Color.white); PdfFormField ck = bt.GetCheckField(); writer.AddAnnotation(ck); document.Close();
iTextSharp.text.pdf.RadioCheckField.RadioCheckField | ( | PdfWriter | writer, |
Rectangle | box, | ||
String | fieldName, | ||
String | onValue | ||
) |
Creates a new instance of RadioCheckField
writer | the document PdfWriter |
box | the field location and dimensions |
fieldName | the field name. It must not be null |
onValue | the value when the field is checked |
PdfAppearance iTextSharp.text.pdf.RadioCheckField.GetAppearance | ( | bool | isRadio, |
bool | on | ||
) |
Gets the field appearance.
isRadio | true for a radio field and false for a check field |
on | true for the checked state, false otherwise |
IOException | on error |
DocumentException | on error |
PdfAppearance iTextSharp.text.pdf.RadioCheckField.GetAppearanceRadioCircle | ( | bool | on | ) |
Gets the special field appearance for the radio circle.
on | true for the checked state, false otherwise |
|
protected |
Gets a radio or check field.
isRadio | true to get a radio field, false to get a check field |
IOException | on error |
DocumentException | on error |
PdfFormField iTextSharp.text.pdf.RadioCheckField.GetRadioGroup | ( | bool | noToggleToOff, |
bool | radiosInUnison | ||
) |
Gets a radio group. It's composed of the field specific keys, without the widget ones. This field is to be used as a field aggregator with AddKid().
noToggleToOff | if true , exactly one radio button must be selected at all times; clicking the currently selected button has no effect. If false , clicking the selected button deselects it, leaving no button selected. |
radiosInUnison | if true , a group of radio buttons within a radio button field that use the same value for the on state will turn on and off in unison; that is if one is checked, they are all checked. If false , the buttons are mutually exclusive (the same behavior as HTML radio buttons) |
|
static |
A field with the symbol check
|
static |
A field with the symbol circle
|
static |
A field with the symbol cross
|
static |
A field with the symbol diamond
|
static |
A field with the symbol square
|
static |
A field with the symbol star
|
getset |
Sets the state of the field to checked or unchecked.
checked | the state of the field, true for checked and false for unchecked |
|
get |
Gets the check field.
IOException | on error |
DocumentException | on error |
|
getset |
Sets the checked symbol. It can be TYPE_CHECK
, TYPE_CIRCLE
, TYPE_CROSS
, TYPE_DIAMOND
, TYPE_SQUARE
and TYPE_STAR
.
checkType | the checked symbol |
|
getset |
Sets the value when the field is checked.
onValue | the value when the field is checked |
|
get |
Gets the radio field. It's only composed of the widget keys and must be used with getRadioGroup(bool,bool).
IOException | on error |
DocumentException | on error |