Abhishek Srivastava wrote:

Bruno,

I went through your sample but I am not able to get things to work.

Basically the requirement is. In jsp app open the pdf document and set the
value of the text field. Change it to read only. And write the resultant
document on the http response stream.

Here is what I have done.

1) Went into Acrobat 7 and added a text field to the document (using Tools
-> Advanced Editing->Text Field Tool) and saved this file as test.pdf. the
name of the field is "text1".

2) Now in my jsp application, created a  PdfReader object and opened
test.pdf
Try it in a standalone application first.

3) on the reader I called getAcroFields() and then called setField
Where is the Stamper? You need a Stamper instance too.
Ask the Stamper for the AcroFields and list the fields and field names first.
That way you will know for sure if you created the form correctly.

Now after setting the field how do I write the resulting pdf document with
newly created values on the http response stream?
When creating the Stamper, you need to pass an OutputStream.
You could use a ServletOutputStream, but there are some browser
issues, please read: http://itextdocs.lowagie.com/tutorial/general/webapp/

Also, is my method of creating the AcroForm correct? (In the Acrobat 7 tool it 
always was taking me to the LiveCycle designer).

I am 99% sure you are creating the TextField correctly.
I think you have an option in LiveCycle Designer to create
Acrobat 6 forms, but doing it the way you did is less confusing.
br,
Bruno


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to