|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.justformspdf.pdf.Form
The Form class represents the interactive Form of a PDF document. A PDF Form can be filled out by users and submitted just like an HTML form. However, unlike HTML Form, a PDF document has one and only only Form.
There are various type of fields in a PDF Form. Each field type serves a different function, depending on the function or information that will be entered into the field. JustFormsPDF library supports Button, Check Box, Combo Box, Radio Button and Text fields.
Using any PDF Writer (like Adobe Acrobat), user can design and create an entirely new form, or can quickly convert your existing paper and electronic forms to PDF and then add PDF form fields.
Here is an example showing how PDF Form should be accessed and how one of its elements should be filled.
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");
Constructor Summary | |
Form() |
Method Summary | |
java.util.Vector |
getAllFormElements() Get list of all form elements in the Form object. |
com.justformspdf.pdf.FormElement |
getElement(java.lang.String name) Return the specified form element. |
java.lang.String |
toString() To get information about all the form elements in PDF Form object. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Form()
Method Detail |
public com.justformspdf.pdf.FormElement getElement(java.lang.String name) throws java.lang.Exception
Example usage:
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");
java.lang.Exception
public java.util.Vector getAllFormElements()
Example usage:
FileInputStream fis = new FileInputStream("C:\\JustFormsPDF\\examples\\AddressForm32A2.pdf"); PDF pdf = new PDF(new PDFReader(fis)); Form form = pdf.getForm();
toString()
public java.lang.String toString()
Here is an example:
FileInputStream fis = new FileInputStream("C:\\JustFormsPDF\\examples\\AddressForm32A2.pdf"); PDF pdf = new PDF(new PDFReader(fis)); Form form = pdf.getForm(); Vector formElementList = form.getAllFormElements(); for (int i=0; i<formElementList.size(); i++) { FormElement formElement = (FormElement) formElementList.elementAt(i); String formElementName = formElement.getName(); if (formElement instanceof FormText) { String formElementType = "Text"; } }
toString
in class java.lang.Object
getAllFormElements()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |