|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--com.justformspdf.lib.PDFObjectImp
|
+--com.justformspdf.lib.PDFObjectGeneric
|
+--com.justformspdf.pdf.FormElement
|
+--com.justformspdf.pdf.FormText
This class represents the Text Box element of PDF Form.
The text box allows input of information in text or numerical form. Text Box fields can be single or multi-line.
Here is an example of filling in a Text Box element.
FileInputStream fis = new FileInputStream("C:\\JustFormsPDF\\examples\\AddressForm32A2.pdf");
PDF pdf = new PDF(new PDFReader(fis));
Form form = pdf.getForm();
FormText text = (FormText) form.getElement("Name");
text.setValue("John K. Baker");
pdf.render();
pdf.writeTo(new FileOutputStream("C:\\JustFormsPDF\\examples\\AddressForm32A2_out.pdf"));
| Field Summary |
| Fields inherited from class com.justformspdf.pdf.FormElement |
JUSTIFICATION_CENTER, JUSTIFICATION_LEFT, JUSTIFICATION_RIGHT |
| Constructor Summary | |
FormText(java.lang.String name)
|
|
| Method Summary | |
void |
setValue(java.lang.String value)
Set value of this form element. |
boolean |
isMultiline()
Get the value of multiline flag |
| Methods inherited from class com.justformspdf.pdf.FormElement |
getName,getType,getRect,getValue,setReadOnly,isReadOnly
|
| Constructor Detail |
public FormText(java.lang.String name)
| Method Detail |
public void setValue(java.lang.String value)
throws java.lang.Exception
This method is applibale to all type of form elements.
Here is an example of filling in a Text Box element.
FileInputStream fis = new FileInputStream("C:\\JustFormsPDF\\examples\\AddressForm32A2.pdf");
PDF pdf = new PDF(new PDFReader(fis));
Form form = pdf.getForm();
FormText text = (FormText) form.getElement("Name");
text.setValue("John K. Baker");
pdf.render();
pdf.writeTo(new FileOutputStream("C:\\JustFormsPDF\\examples\\AddressForm32A2_out.pdf"));
FormText comments = (FormText) form.getElement("comments");
String commentsStr = "The JustFormsPDF library is a Java class library for " +
"filling or editing interactive PDF forms on-the-fly. Empower " +
"your applications with the industry-standard PDF forms technology " +
"using JustFormsPDF. ";
comments.setValue(commentsStr);
FormText address = (FormText) form.getElement("address");
address.setValue("37254 Spring Valley Av.\\rSimi Valley, CA 93063\\r1-800-222-3333");
setValue
in class FormElement
value -
java.lang.Exception
public boolean isMultiline()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||