HiraokaHyperTools.iTextSharp-LGPL
0.2.5
|
Public Member Functions | |
PushbuttonField (PdfWriter writer, Rectangle box, String fieldName) | |
PdfAppearance | GetAppearance () |
![]() | |
BaseField (PdfWriter writer, Rectangle box, String fieldName) | |
void | SetRotationFromPage (Rectangle page) |
Properties | |
int | Layout [get, set] |
Image | Image [get, set] |
PdfTemplate | Template [get, set] |
int | ScaleIcon [get, set] |
bool | ProportionalIcon [get, set] |
float | IconVerticalAdjustment [get, set] |
float | IconHorizontalAdjustment [get, set] |
PdfFormField? | Field [get] |
bool | IconFitToBounds [get, set] |
PRIndirectReference | IconReference [get, set] |
![]() | |
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) |
![]() | |
PdfAppearance | GetBorderAppearance () |
![]() | |
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 pushbutton field. It supports all the text and icon alignments. The icon may be an image or a template.
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(); Image img = Image.GetInstance("image.png"); PushbuttonField bt = new PushbuttonField(writer, new Rectangle(100, 100, 200, 200), "Button1"); bt.SetText("My Caption"); bt.SetFontSize(0); bt.SetImage(img); bt.SetLayout(PushbuttonField.LAYOUT_ICON_TOP_LABEL_BOTTOM); bt.SetBackgroundColor(Color.cyan); bt.SetBorderStyle(PdfBorderDictionary.STYLE_SOLID); bt.SetBorderColor(Color.red); bt.SetBorderWidth(3); PdfFormField ff = bt.GetField(); PdfAction ac = PdfAction.CreateSubmitForm("http://www.submit-site.com", null, 0); ff.SetAction(ac); writer.AddAnnotation(ff); document.Close();
iTextSharp.text.pdf.PushbuttonField.PushbuttonField | ( | PdfWriter | writer, |
Rectangle | box, | ||
String | fieldName | ||
) |
Creates a new instance of PushbuttonField
writer | the document PdfWriter |
box | the field location and dimensions |
fieldName | the field name. If null only the widget keys will be included in the field allowing it to be used as a kid field. |
PdfAppearance iTextSharp.text.pdf.PushbuttonField.GetAppearance | ( | ) |
Gets the button appearance.
IOException | on error |
DocumentException | on error |
|
static |
A layout option
|
static |
A layout option
|
static |
A layout option
|
static |
A layout option
|
static |
A layout option
|
static |
A layout option
|
static |
A layout option
|
static |
An icon scaling option
|
static |
An icon scaling option
|
static |
An icon scaling option
|
static |
An icon scaling option
|
get |
Gets the pushbutton field.
IOException | on error |
DocumentException | on error |
|
getset |
If true
the icon will be scaled to fit fully within the bounds of the annotation, if false
the border width will be taken into account. The default is false
.
iconFitToBounds | if true the icon will be scaled to fit fully within the bounds of the annotation, if false the border width will be taken into account |
|
getset |
A number between 0 and 1 indicating the fraction of leftover space to allocate at the left of the icon. A value of 0 positions the icon at the left of the annotation rectangle. A value of 0.5 centers it within the rectangle. The default is 0.5.
iconHorizontalAdjustment | a number between 0 and 1 indicating the fraction of leftover space to allocate at the left of the icon |
|
getset |
Sets the reference to an existing icon.
iconReference | the reference to an existing icon |
|
getset |
A number between 0 and 1 indicating the fraction of leftover space to allocate at the bottom of the icon. A value of 0 positions the icon at the bottom of the annotation rectangle. A value of 0.5 centers it within the rectangle. The default is 0.5.
iconVerticalAdjustment | a number between 0 and 1 indicating the fraction of leftover space to allocate at the bottom of the icon |
|
getset |
Sets the icon as an image.
image | the image |
|
getset |
Sets the icon and label layout. Possible values are LAYOUT_LABEL_ONLY
, LAYOUT_ICON_ONLY
, LAYOUT_ICON_TOP_LABEL_BOTTOM
, LAYOUT_LABEL_TOP_ICON_BOTTOM
, LAYOUT_ICON_LEFT_LABEL_RIGHT
, LAYOUT_LABEL_LEFT_ICON_RIGHT
and LAYOUT_LABEL_OVER_ICON
. The default is LAYOUT_LABEL_ONLY
.
layout | New value of property layout. |
|
getset |
Sets the way the icon is scaled. If true
the icon is scaled proportionally, if false
the scaling is done anamorphicaly.
proportionalIcon | the way the icon is scaled |
|
getset |
Sets the way the icon will be scaled. Possible values are SCALE_ICON_ALWAYS
, SCALE_ICON_NEVER
, SCALE_ICON_IS_TOO_BIG
and SCALE_ICON_IS_TOO_SMALL
. The default is SCALE_ICON_ALWAYS
.
scaleIcon | the way the icon will be scaled |
|
getset |
Sets the icon as a template.
template | the template |