I have problem with adding textfield to PDF. I have document that contains
AcroForms all kinds: radiobuttons, checkboxes etc. This documnet wasn't
created by me. I want to add new textfield (multiline) to second page of
this document. I've tried this:

PdfReader reader = new PdfReader("c:/file.pdf");
Document doc = new Document(reader.getPageSizeWithRotation(1));
PdfCopy writer = new PdfCopy(doc, new FileOutputStream("C:/1.pdf"));        
doc.open();
writer.addPage(writer.getImportedPage(reader, 2));

TextField tf1 = new TextField(writer, new Rectangle(297, 295, 573, 333),
"fox");
tf1.setBackgroundColor(Color.yellow);
tf1.setBorderColor(Color.red);
tf1.setBorderWidth(1);
tf1.setVisibility(TextField.VISIBLE);
tf1.setBorderStyle(PdfBorderDictionary.STYLE_SOLID);
tf1.setText("Quick brown fox jumps over the lazy dog");
tf1.setAlignment(Element.ALIGN_LEFT);
tf1.setOptions(TextField.REQUIRED | TextField.MULTILINE);
writer.addAnnotation(tf1.getTextField());
doc.close();

and it doesn't work. Could somebody help me please with this one ?
-- 
View this message in context: 
http://www.nabble.com/Problem-with-adding-textfield-tp20222830p20222830.html
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to