Dear Paulo,

I want to create PDF Form to replace html submit form.
But, as I create a pdf form using the following code. 

There is no Submit to the server. Just no connection
to the URL.

Please do me a favor to give me help.


By the way, on the documentation of PushButtonField

PdfFormField ff = bt.getButton();

should be: getField();




Thanks,

yun wang




Document document = new Document(PageSize.A4, 50, 50,
50, 50);

try {
PdfWriter writer = PdfWriter.getInstance(document, new
FileOutputStream("test.pdf"));
            
document.open();
                
int x = 100; int y = 700;

TextField app = new TextField(writer, new Rectangle(x,
y, x + 100, y + 20), "email");
app.setText("type email here");
PdfFormField field = app.getTextField();
writer.addAnnotation(field);

y = 675;
PushbuttonField bt = new PushbuttonField(writer, new
Rectangle(x, y, x + 100, y + 20), "submit");
bt.setText("Sumbit");
bt.setBackgroundColor(Color.cyan);
 
PdfFormField ff = bt.getField();
Object options [] = {"email"} ;
PdfAction ac =
PdfAction.createSubmitForm("http://localhost::8080/test/test.php";,
options, PdfAction.SUBMIT_HTML_FORMAT);
                        
ff.setAction(ac);
writer.addAnnotation(ff);
                        
document.close();
System.out.println("Finished.");

}
catch (Exception de) {
  de.printStackTrace();
}



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to