These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

forms submit response

eminaguil
Registered: Oct 5 2010
Posts: 4
Answered

I've created a form that uses a button to validate the user creddentials and submit the form via html but i need to get the response for example if the users credentials are wrong. I have used the content type text/html and text/plain for my responses but the reader tells me that it can't process the content type and,
if i don´t use a response and I only use a return it displays that the content is text/html and it can´t process it.
 
I don't have any problems with pro extended but my clients will use the reader.
 
I've used pro extended for creating the form and coding and, reader 9 for filling the forms and sending the data.

My Product Information:
Acrobat Pro Extended 9.3.1, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
The server needs to return a response that Reader can understand. I normally use FDF, which can cause an informational pop-up to display, or a redirect (e.g., HTTP 302) to a URL that's a static or dynamically generated HTML page. Reader cannot convert the HTML response generated by the server, so you must do one of these other things. If you want to do a redirect, probably the most reliable thing to do is return an FDF that just contains a /F key that points to the redirect URL. If the response is going to be an FDF, the end of the URL that you specify in the submit form action needs to end in "#FDF".
eminaguil
Registered: Oct 5 2010
Posts: 4
Thanks, the FDF response is what I need, but I've been looking how to send an FDF Response from the server but, until now i didn't found anything. I´ve only found the oJaascript option in the submit form, but only when you submit from the pdf an FDF not an HTML

can you send some examples on how to do the FDF response?
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
What type of server-side programming are you using to process the form submissions?
eminaguil
Registered: Oct 5 2010
Posts: 4
I´m usig C# 4.0, some fragments of my code are

context.Response.ContentType = "text/plain"; //is there an "aplication/fdf"?

try
{
AuthenticateDto user = AuthenticateUser
(context.Request.Form["Usuario"], context.Request.Form["Clave"]);

if (!user.Success)
{
context.Response.Write("El usurio y/o la clave no son los correctos");
return;
}//Some processing code for the request

//if no errors
context.Response.Write("La información se guardo");
}
catch(...)
...
context.Response.Write("Error... " + detaill);
}
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
The MIME tpye for FDF is "application/vnd.fdf"

Here is a Perl routine that returns an FDF that causes a pop-up message to be displayed to the user:

sub FDF_Status { # This routine returns an FDF response that causes Acrobat (Reader) to# display a message in a pop-up window. print <<END_OF_RESPONSE; Content-type: application/vnd.fdf %FDF-1.21 0 obj<< /FDF << /Status ($_[0]) >> >>endobj

trailer

<< /Root 1 0 R >>%%EOFEND_OF_RESPONSE

 }
Here is another that causes a redirect:

sub FDF_redirect { # Return a simple FDF that just contains a /F key# that redirects to a resource

 print "Content-type: application/vnd.fdf\n\n"; print <<END_OF_RESPONSE; %FDF-1.21 0 obj<< /FDF << /F ($_[0]) >> >>endobj

trailer

<< /Root 1 0 R >>%%EOFEND_OF_RESPONSE

 }
So as you can see, most of the FDF that the server has to generate is just boilerplate. What I didn't show is the code that ensures that the string that gets passed ($_[0]) to these routines is correctly encoded. For example, parentheses need to be properly escaped.

The PDF spec has more details on FDF and strings in PDF.
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
The forum software didn't correctly format that code, but I hope you can figure it out.

Edit: Here's a file that shows the code: https://acrobat.com/#d=COn7HhOSHIuGo4R*ByS3uw
eminaguil
Registered: Oct 5 2010
Posts: 4
Thaks for the file, it's working great.
In the previus code it apperas %FDF-1.21 as a line and 0 obj as another and that was the error.
theresen
Registered: Oct 19 2010
Posts: 6
I have created a form and added a submit button. I want the form to be emailed to a group of people and then filled out and sent back to me via email. I set up the submit button to email form to me but when I test it, it doesn't work. The form is emailed and then when I fill it out and click the submit button, first it asks about an email address but then I get the Save As window on the screen. I don't know what I am doing wrong. I have recreated the submit button several times but it will not email back to me. HELP!

tniemiec

NK-INC.COM
Registered: Apr 17 2010
Posts: 93
Check out FDFToolkit.net: http://www.fdftoolkit.net/

FDFToolkit.net can parse, e-mail, populate just about any kind of PDF form data, including FDF, XFDF, XML, XDP and parse PDF fields.

FDFToolkit.net can import a PDF submit response using ASP + C# or VB.net, and merge the data back with the blank PDF form, attach to e-mail and send using SMTP server without E-mail client software, or save the file to a location on the server.

FDFToolkit.net comes with 1 year of free technical support and updates. FDFToolkit.net utilizes iTextSharp technologies.

FDFToolkit.net can also easily import and export HTML Form submissions or ADO.net datasets or datarows, and populate a PDF, or database with the same field name structure.

FDFToolkit.net is a Visual Studio .net PDF form data library. It comes in version 1.1 or 2.0. Version 2.0 supports .net 2.0, 3.5, and 4.0.

For more information:
http://www.fdftoolkit.net/

For ASP.net programming tutorials:
http://www.nk-inc.com/blog

For online examples:
http://www.fdftoolkit.net/examples