Discussion:
Submit a pdf form to web server
(too old to reply)
A***@adobeforums.com
2004-06-02 19:28:27 UTC
Permalink
Is the FDF Toolkit installed AND registered on the server?

Aandi Inston
P***@adobeforums.com
2004-06-02 19:23:20 UTC
Permalink
The line at which it generates an error is

Set FdfAcX = Server.CreateObject("FdfApp.FdfApp")

Thanks,
Puja
P***@adobeforums.com
2004-06-02 20:13:59 UTC
Permalink
I've downloaded the fdf toolkit on the server.I don't know exactly how to register it with the server though.Is downloading it to the server different from registering it?

Regards,
Puja
A***@adobeforums.com
2004-06-03 08:21:12 UTC
Permalink
You must follow the documentation precisely for installation - don't
make any changes or skip any steps.

Aandi Inston
G***@adobeforums.com
2004-06-02 20:43:12 UTC
Permalink
I don't know exactly how to register it with the server though.




You will know after reading the documentation that comes with the FDF Tookit.

George
P***@adobeforums.com
2004-06-04 17:47:43 UTC
Permalink
Thanks a lot.I fixed that error by registering the dll files properly.But now I've another error coming up in my asp script.
The error is

error '80040202'
Unable to open the access token of the current thread

And it's at the line,
myFDF.FDFSaveToFile "D:\inetpub\wwwroot\pdf_project\CheckThis.fdf"

Response.Write "pdf <http://www.orsp.rutgers.edu/pdf_project/CheckThis.fdf>"

Am I doing something wrong here. I thought I was just trying to save the data in a new file which will get created here on the server.

Any help is appreciated a lot.
Thanks again,
Puja Thakral
A***@adobeforums.com
2004-06-05 09:45:16 UTC
Permalink
Although the error doesn't really suggest it, it might be that the
problem is permissions. Most web servers are set up so that ASPs
CANNOT write to anywhere, and especially wwwroot files. This is an
extra protection against hackers modifying web sites.

So, you need to check with the web server administrator that ASPs have
permission to write to the pdf_project folder.

Aandi Inston
P***@adobeforums.com
2004-06-08 18:15:07 UTC
Permalink
Thanks Aandi,
With your help I'm definitely solving the problems but coming acroos more errors.I fixed the permissions things as I saved it to a different location on the server where permissions is not a problem. It did solve that error and it created a .fdf file there but that .fdf file does not contain the information I entered in the pdf form. Instead it gives me the error,
"No input file page data" and then it points to the url of my .asp page.
When I click ok on that error,it creates the .fdf file but that contains just the structure of fdf and not the information.

I'm sure someone definitely has the answer for this.Thanks for all the help.I really appreciate it a lot.

Regrads,
Puja
P***@adobeforums.com
2004-06-08 18:47:45 UTC
Permalink
Here is the .fdf file but it contains just the genral fdf info and not the field entries I made for FirstName ,LastName,etc..

%FDF-1.2
%âãÏÓ
1 0 obj<</FDF<</F(http://orsp.rutgers.edu/pdf_project/form1.pdf)/Fields 2 0 R>>>>
endobj
2 0 obj[<</T(FirstName)>><</T(LastName)>><</T(Address)>><</T(City)>><</T(State)>><</T(Zip)>>]
endobj
trailer
<>
%%EOF
A***@adobeforums.com
2004-06-08 19:31:21 UTC
Permalink
Interesting. I assume you made this FDF completely in your program.
What lines of code did you use to set the value for FirstName?

Aandi Inston
P***@adobeforums.com
2004-06-09 15:18:59 UTC
Permalink
Here is the code for my .asp file,

I'm using this to retreive the response,

FirstName = Request.form("txtFirstName")
LastName = Request.form("txt.LastName")
Address = Request.form("txtAddress")
City = Request.form("txtCity")
State = Request.form("txtState")
Zip = Request.form("txtZip")

Then I'm using this to stuff the variables,

myFdf.fdfsetvalue "FirstName", FirstName, false
myFdf.fdfsetvalue "LastName", LastName, false
myFdf.fdfsetvalue "Address", Address, false
myFdf.fdfsetvalue "City", City, false
myFdf.fdfsetvalue "State", State, false
myFdf.fdfsetvalue "Zip", Zip, false

In my pdf form ,I'm just using the text buttons to create all this.

Thanks again,
Regards,
Puja
A***@adobeforums.com
2004-06-09 15:21:39 UTC
Permalink
Maybe Request.form("txtFirstName") is not returning what you expect.
To test this, try

myFdf.fdfsetvalue "FirstName", "TestFirstName", false

and see if the FDF contains what you want.

Aandi Inston
P***@adobeforums.com
2004-06-09 15:41:29 UTC
Permalink
Hi Aandi,
I tried this but it still returns the same fdf without any information that I filled out in the form.

The other thing is that when I simply try "export form data" in the pdf form,the fdf file it generates contains the information I entered in the form.

So looks like it is definitely some problem with the code.

Here is the whole code.I hope it doesn't gets formated..

First of all I'm trying to Retrieve the user response by

FirstName = Request.form("txtFirstName")
LastName = Request.form("txt.LastName")

Then I'm creating the instance of the object

Set FdfAcX = Server.CreateObject("FdfApp.FdfApp")

Then I'm feeding the variables by

Dim myFDF
Set myFdf = FdfAcX.FDFCreate

Then I stuff the variables,

myFdf.fdfsetvalue "FirstName", TestFirstName, false
myFdf.fdfsetvalue "LastName", LastName, false
myFdf.fdfsetvalue "Address", Address, false
myFdf.fdfsetvalue "City", City, false
myFdf.fdfsetvalue "State", State, false
myFdf.fdfsetvalue "Zip", Zip, false

Then I'm pointing to my pdf file,

myFDF.fdfSetFile "http://orsp.rutgers.edu/pdf_project/form1.pdf"
Response.ContentType = "text/html"

myFDF.fdfSaveToFile "C:\formData\CheckThis.fdf"

Finally I'm closing the objects...
myFDF.fdfclose
Set myFDF = Nothing
Set FDFAcX = Nothing

Can u see any problem in the code...,maybe I missing something important.
Thanks again,
Puja
A***@adobeforums.com
2004-06-09 19:42:34 UTC
Permalink
No, not
Post by P***@adobeforums.com
myFdf.fdfsetvalue "FirstName", TestFirstName, false
That will certainly store nothing as TestFirstName is not initialised.
Please refer to my post. For testing, I was suggesting you use a fixed
string.

Aandi Inston
P***@adobeforums.com
2004-06-10 14:35:22 UTC
Permalink
I did not get it properly.Can u be a little more brief regarding what should I do,I mean how to use fixed string?

Thanks,
Puja
A***@adobeforums.com
2004-06-10 14:38:28 UTC
Permalink
I mean to use exacty the string I posted.

myFdf.fdfsetvalue "FirstName", "TestFirstName", false

which uses a fixed string of "TestFirstName".

That is not what you typed. You were using

myFdf.fdfsetvalue "FirstName", TestFirstName, false

which refers to a variable called TestFirstName.

It is very important to understand the difference, I think.

Aandi Inston
P***@adobeforums.com
2004-06-10 14:52:32 UTC
Permalink
I'm sorry as I did not understand it earlier.I tried what u said and infact now I can see the "TestFirstName" in my fdf file. But why is it not showing the data I 'm entering in the pdf file?

After I submit the data to the server,it shows that it's connecting to the server,downloading,etc But then in the end it again says that "No input file page data"

Thanks for your patience,
Puja
A***@adobeforums.com
2004-06-10 16:43:26 UTC
Permalink
Ok, so this has narrowed the problem down. The problem is not how you
make the PDF, but how you read the response. I see you have lines
like

FirstName = Request.form("txtFirstName")

I have no idea what this Request object is. I suspect it is designed
for HTML forms, though. Are you submitting in HTML format?

Aandi Inston
P***@adobeforums.com
2004-06-10 17:14:22 UTC
Permalink
Yes,I am submitting the data to the web server in HTML format.When I was setting the properties for Submit button,I set the "Properties"---"Action"--"Submit a form".And then in that I set the "url" link to my 'asp page' and "Export" format to 'HTML'.I was following a tutorial from www.15seconds.com and thats how that guy suggested to do.

What do we read the response in pdf.Is there any other way to do that?

Thanks again,
Puja
P***@adobeforums.com
2004-06-14 17:14:49 UTC
Permalink
Hi All,
Please help me with this problem.I've been getting help through this list.Please let me know somebody,how to retrieve the response in asp file from a pdf file?I want to submit the pdf form to the web so that the information gets stored in a file.I've the asp code which is retrieving the response and is writing it to a file.

Thanks again all of you.Thanks Aandi for all your help.
Regards,
Puja
A***@adobeforums.com
2004-06-15 06:37:25 UTC
Permalink
Sorry, I have no knowledge of this "Request" object or how it works.

Aandi Inston
x***@adobeforums.com
2004-06-14 22:51:01 UTC
Permalink
The easiest way (not the best):
Set the pdf to submit as HTTP-POST.
Write the asp page while pretending it's dealing with POST data (request.form) from some HTML form.
P***@adobeforums.com
2004-06-15 18:01:06 UTC
Permalink
PDF gives me four options to submit data or export data.First as FDF,then as HTML,as XPDF and as PDF.I chose the option of submitting it as HTML.And in the URL,I've entered the path to the .asp file which contains the code to retrieve the response from pdf and write it to .fdf file.So finally .fdf file is being created but it's empty as it doesn't create the information I'm entering in the pdf form before submitting it to the web server.

FirstName = Request.form("txtFirstName")
This is how I'm retrieving the response.

Then I'm creating the instance of the object

Set FdfAcX = Server.CreateObject("FdfApp.FdfApp")

Then I'm feeding the variables by

Dim myFDF
Set myFdf = FdfAcX.FDFCreate

Then I stuff the variables,

myFdf.fdfsetvalue "FirstName", TestFirstName, false
myFdf.fdfsetvalue "LastName", LastName, false
myFdf.fdfsetvalue "Address", Address, false
myFdf.fdfsetvalue "City", City, false
myFdf.fdfsetvalue "State", State, false
myFdf.fdfsetvalue "Zip", Zip, false

Then I'm pointing to my pdf file,

myFDF.fdfSetFile "http://orsp.rutgers.edu/pdf_project/form1.pdf"
Response.ContentType = "text/html"

myFDF.fdfSaveToFile "C:\formData\CheckThis.fdf"

Finally I'm closing the objects...
myFDF.fdfclose
Set myFDF = Nothing
Set FDFAcX = Nothing

Do you see any problem here?

Thanks for any help..
Regards,
Puja
A***@adobeforums.com
2004-06-15 18:03:28 UTC
Permalink
Although it isn't the problem at the moment,

Response.ContentType = "text/html"

is not right.

Aandi Inston
P***@adobeforums.com
2004-06-15 18:39:04 UTC
Permalink
Should it be
Response.ContentType = "application/vnd.fdf"

If I do that,it says that submission of the form failed and gives a genral error.

I guess the Response.ContentType = "text/html" because the pdf is being exported in HTMl formal and also I'm using the html format to retrieve the user response by using
FirstName = Request.form("txtFirstName")

I maynot be right,it's just what I'm guesiing..

Thanks for the reply.
Regards,
Puja
A***@adobeforums.com
2004-06-15 19:20:33 UTC
Permalink
Post by P***@adobeforums.com
Should it be
Response.ContentType = "application/vnd.fdf"
Yes.
Post by P***@adobeforums.com
If I do that,it says that submission of the form failed and gives a genral error.
That may be because

1. You are not generating an FDF
2. You are generating an FDF but are sending other data back with it
3. You are generating an FDF but not sending it back
4. You are generating an FDF but not setting an FDF key.
Post by P***@adobeforums.com
I guess the Response.ContentType = "text/html" because the pdf is being exported in HTMl formal
No, your response here is what matters. The response from your script
is an FDF, not HTML.

But, setting a response type of text/html, or especially text/plain is
a great debugging aid, since it helps you to examine the FDF you would
be making. No point changing this until you can figure out why you
aren't getting any input.
Post by P***@adobeforums.com
FirstName = Request.form("txtFirstName")
I maynot be right,it's just what I'm guesiing..
That may be a problem. I prefer reading mountains of documentation to
guessing anything, but maybe that's just me.

Aandi Inston
P***@adobeforums.com
2004-06-18 17:45:57 UTC
Permalink
Hi Aandi,

Thanks for your reply.Actually I finally got the fdf file which contains entries from my pdf document.But the concern is that when I submit the data from my pdf form,it still gives the "error code:No input file page data" and the "url of my .asp page".When I click 'ok' on that error box,it goes away.Finally when I check the fdf file on my web server,it 's created properly and it contains all the entries from pdf file.But I've no clue what that error is about?

Any help from anyone is appreciated a lot.Thanks again to Aandi and this mailing list.

Regards,
Puja
A***@adobeforums.com
2004-06-21 09:52:40 UTC
Permalink
Sorry, I have no idea on that problem.

Aandi Inston
x***@adobeforums.com
2004-06-21 15:07:35 UTC
Permalink
I think you're in for some server/client header/caching debugging. It might be the headers sent from the web server (which, IMHO, is about the trickiest part when dealing with PDF submissions, that is IF you want your application to be compatible with all versions of Acrobat AND Explorer).

Also, IE caches responses from PDF submissions (be it HTML or fdf), in order for the Reader to find the document, I guess. This "feature" has also caused developers a lot of trouble.

If you're going to debug headers, I would strongly recommend installing Firefox (Mozilla) and a nifty little extension called "HTTP live headers" (or something like that).
P***@adobeforums.com
2004-06-29 18:38:34 UTC
Permalink
Thanks for your replies guys but this problem is still unsolved although I tried a lot of things.anyways,as I'm getting my fdf file which has the information submitted by the user,I guess I 'm good to go to the next step.

I want to parse these fdf files and want to save the information to the database.Can someone please guide me in the right direction as how to do this?

Thanks a ton for all the help.
Regards,
Puja

Continue reading on narkive:
Loading...