When I run this, it populates the form fields correctly, and opens the PDF in the browser correctly. However, once the PDF is open, if I edit the value of the "EmpAddress" field in the browser, (change from '5' to '7' for example) close the browser, then re-run the code above, it opens the document again with '7' in EmpAddress, instead of the expect value '5' .
Why is this? Is this being cached somewhere? How can I fix it? (test document is attached)
I read the post you referred to, but I'm not sure if it really answered my question. I'm not having a problem filling the form or displaying it, and I don't need to be able to save it permanently. The problem occurs when I do the following:
1) Use pdf.kit form.FillField method to fill the field ( eg FillField("EmpAddress", "5") ) [works fine]
2) Display the filled form in a browser [works fine]
3) Use adobe reader to modify a value in one of the fields (eg, change "5" to "7") [works fine]
4) Close the browser [works fine]
5) Use pdf.kit to fill the same form with the original data (eg FillField("EmpAddress", "5") ) [broken]:
The pdf displays my modified data from step 3, instead of the value I inserted by using the .FillField method. That is, I do newForm.FillField("EmpAddress", "5"), so I expect to see a '5' when the form opens. Instead, I see a '7', which tells me that the value in the field is cached somewhere...it is keeping the value from the previous time the form was opened and modified.
If this line is not in the program, the pdf will be opened correctly in the Reader independently even when the field is filled multi-times, otherwise, the pdf will be shown in IE as you said.
Perhaps it is the problem of IE's settings or the Reader's settings. I will study this and tell you the result. By the way, if you are experienced in this enviroment, please give some advices to me.
You pointed me in the right direction...I found the problem. It is a setting in Adobe Reader. The way to change it (in Reader 7.0) is to click Edit>Preferences>Forms and then uncheck "Keep forms data temporarily available on disk"