source.setLogWriter(new OutputStreamWriter(System.err)); // send
// log
// messages
// to
// stderr
FormFields formFields=source.findFormFields();
System.out.println("The document contains "+formFields.size()+" form fields:\n");
StringBuffer sb = new StringBuffer();
for (Iterator i=formFields.iterator(); i.hasNext();) {
FormField formField=(FormField)i.next();
System.out.println(formField.getName());
System.out.println(formField.getFormControl().getFormControlType().toString());
System.out.println(formField.getDebugInfo());
// sb.append("<" + "%=" + formField.getName() + "%" + ">");
formFields.addValue(formField.getName(),sb.toString());
sb.setLength(0);
}
OutputDocument outputDocument=new OutputDocument(source);