Two fields with the same name into different page 2005-06-24 - By wang yun
Back Dear paulo,
I have two text fields with the same name. But, I want to add the first one into page 1 and add the second into page 2.
Here is the code to add two fields into one page. How can I change it so that app2 will be moved into page 2.
Thanks,
PdfReader reader = new PdfReader("input.pdf"); PdfStamper stamp = new PdfStamper(reader, new FileOutputStream("output.pdf")); PdfWriter writer = stamp.getWriter(); PdfFormField ff = PdfFormField.createTextField(writer, false,false,0); ff.setFieldName("CreditCard"); ff.setValueAsName("Visa");
TextField app1 = new TextField(writer, new Rectangle(100, 700, 100 + 200, 700 + 20), null); app1.setText("Visa"); PdfFormField field1 = app1.getTextField(); ff.addKid(field1); TextField app2 = new TextField(writer, new Rectangle(100, 650, 100 + 200, 650 + 20), null); app2.setText("Visa"); PdfFormField field2 = app2.getTextField(); ff.addKid(field2); stamp.addAnnotation(ff,1); stamp.close();
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- 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 iText-questions@(protected) https://lists.sourceforge.net/lists/listinfo/itext-questions
|
|