Filling out PDF form.

Filling out PDF form.

Forum member · Mar 7, 2007
Is there a cache that DynamicPDF merger uses? I have a simple PDF form with 4 text fields - txtNumber, txtExpires, txtName, txtTitle. I set the values to these 4 fields and DrawToWeb. The first time it came up correctly. However, every time I set these 4 fields new values (by debugging I can see that the fields have been updated), I keep getting the PDF from the first time. But if I force a download, then the DrawToWeb works. Any idea on how to fix it? Here are my code. private void Page_Load(object sender, System.EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Cache.SetExpires(DateTime.Now); } private void Button1_Click(object sender, System.EventArgs e) { MergeDocument document = new MergeDocument( MapPath("~/Test2.pdf") ); document.Form.Fields[0].ChildFields[0].ChildFields["txtNumber[0]"].Value = TextBox1.Text; document.Form.Fields[0].ChildFields[0].ChildFields["txtName[0]"].Value = TextBox2.Text; document.Form.Fields[0].ChildFields[0].ChildFields["txtExpires[0]"].Value = TextBox1.Text; document.Form.Fields[0].ChildFields[0].ChildFields["txtTitle[0]"].Value = TextBox2.Text; Guid g = Guid.NewGuid(); // Got the first result document.DrawToWeb(false); // Got the first result document.DrawToWeb(String.Format("{0}.pdf", g.ToString())); // This one works. document.DrawToWeb(String.Format("{0}.pdf", g.ToString()), true); Response.End(); }

Re: Filling out PDF form.

Support · Mar 7, 2007
Hello, The reason you are facing the problem is because the Acrobat Reader caches the values temporarily and there is nothing within our product that controls the caching of field values. So if you are getting the data from a query string and you are resubmitting the same query, the changes you make to the form field will not be reflected unless you make changes to the query. A workaround to this problem would be going to Edit Menu --> Preferences --> Select Forms on the left Panel --> Uncheck the check box that says “Keep forms data temporarily available on disk. This will solve the problem on your machine but you will need to do this on all client machines. More efficient way of doing this is by appending a random number or time stamp to the query string every time it gets submitted. This will prevent the values from being cached. Thanks, ceTe Software Support Team

Re: Filling out PDF form.

Forum member · Mar 7, 2007
Thanks for the quick response.

Re: Filling out PDF form.

Forum member · Jun 6, 2007
Hi, I have the exact same problem as this, with basically the same code. From the code posted above, I can see that he doesn't use any querystring to get the values, he just fetches them from a textbox or something. Could you provide a code snippet, based on the code above, on how to solve this? Sincerely Kristian Walle

Re: Filling out PDF form.

Support · Jun 6, 2007
Hello Kristian, Can you please send a mail to our [^a|mailto:support@cete.com|Support Team^] referencing this forum so that they can send you an example to add a timestamp to the query. Thanks, ceTe Software Support Team.