0

I have created a PDF with a form that has a digital signature and other form fields. A submit button, when clicked, submits as PDF to a website. This all works fine, and in reader the behavior is as expected. If a user fills the form out in Acrobat Pro and submits, however, then the Pro takes the result of the post and creates a new PDF with the website's response. For example if the result from the server were a web page that reads "thank you", then Adobe Pro would create a new PDF that says "Thank you" when the form is submitted from Pro. My questions are:

  • In what scenario would this be at all useful?
  • Is there any way to prevent this behaviour? We just want to submit the form, not create a new PDF. A "thank you" message can then be done in Javascript.
Daniel
  • 3,021
  • 5
  • 35
  • 50

1 Answers1

0

I later discovered the way to prevent this is by returning FDF from the server instead of HTML. Below is an example of how to take a submitted PDF, save to the server, and then output a thank you message to Acrobat Pro.

   if (Request.HttpMethod == "POST")
        {
            using (var file = new FileStream(Server.MapPath("~/submitted.pdf"), FileMode.Create))
            {
                Request.InputStream.CopyTo(file);
            }
            Response.ContentType = "application/vnd.fdf";
            Response.Write(@"%FDF-1.2
1 0 obj
<< /FDF <<
/Status (Thanks - your information has been stored)
>>
>>
endobj
trailer
<< /Root 1 0 R >>
%%EOF
RESPONSE;
?>");

            Response.End();
        }
Daniel
  • 3,021
  • 5
  • 35
  • 50