Discussion:
HOW Do I Import FDF from a URL with Acrobat Pro
(too old to reply)
R***@adobeforums.com
2004-07-07 18:21:12 UTC
Permalink
This Actually a 2 part Problem i'm seeking a solution too.

1)Problem IMPORTING FDF DATA FROM URL such as <http://www.yourdomain.com/FDF_Folder/fdfdata001.fdf>
I can Import FDF data into a form by adding a button to the pdf and assigning it an import routine. It works great if i'm doing it locally on my hard drive.... HOWEVER!.... I CANNOT get it to work if i upload the pdf and the FDF folder to my server... So what happens is when i click the button in my PDF form to import the FDF DATA i get an error that says FILE WAS NOT FOUND, and it asks if i would like to browse for it.
DOES ANYONE HAVE A WORK-A-ROUND FOR THIS where i can specify a URL to import the FDF data from using Adobe Acrobat Professional? PLEASE HELP

2)Problem Auto Import when PDF opens...
Is there a way to have my PDF form automatically Import FDF DATA into a PDF Template? What i'm trying to do is to dynamically import different types of FDF Data using only a single PDF Form Template.

Please if someone out there knows of a work-a-round for either of these to Problems while using Acrobat Pro.... PLEASE HELP.
G***@adobeforums.com
2004-07-07 18:44:57 UTC
Permalink
To get an FDF to populate the PDF that is currently being viewed, you will have to set up a Submit Form action (or use the submitForm JavaScript method). This means that the web server has to be programmed to respond by returning the FDF you want. You can't simply link to a static FDF.

Another approach it to link to the static FDF, but this requires that the FDF contains a /F key that points to the corresponding PDF, which will (re)load and populate with the data in the FDF, but not on a Mac using OSX.

George
R***@adobeforums.com
2004-07-07 19:43:26 UTC
Permalink
Thanks for responding ... i'm so glad someone did.
While i'm Not new to Acrobat... i am New to Version 6 and importing FDF data.

Yes.... I did manage to set up a Form Action that once a button is clicked it does the Import the FDF data from a folder on the server.

The problem is it doesn't work when I upload it via online internet. It only works Locally......

Could you explain FDF /F key that points to the corresponding PDF?
G***@adobeforums.com
2004-07-07 20:55:03 UTC
Permalink
The "Import Form Data" type action is not intended to be used and cannot be used for non-local files.

When you export the forms data from a form, either manually in Acrobat or by submitting to a web server, the FDF will normally contain a /F key that points to the PDF file from which the data was exported. In the case of a static FDF on a web server, you would set the value of the /F key to the URL of the corresponding PDF file on the web server. For example:

/F (http://www.peakforms.com/fdfs/record1.fdf)




George
unknown
2004-07-07 22:07:21 UTC
Permalink
sounds like you will have to create a script that goes to the server and either emails the file to you or allows you to save it to your PC.

you can email in ASP with
Server.CreateObject("CDONTS.Newmail")

or save the file with code available on the net
Mar Lyon
2004-07-08 14:24:55 UTC
Permalink
You should do this by passing FieldName=Value to the QueryString and reading the paired values to set the fields during the Doc/Open event.

I have developed a simple way to read data pairs from the QueryString and set the FieldName=Value based on the contents of the QueryString. I am assuming that this might be the first time for some people using QueryStrings so I will be fairly detailed. Apologies to those already in the know. Please follow the steps below.

1) Under Advanced>JavaScript>DocumentJavaScripts create a new script name called Doc/Open (yes, include the slash) and click Add. This creates an open event for the document and will fire off just before the document is displayed.

2) Replace the automatically generated code with the following and click Ok:

var sArray;
var sTemp;
var sURL;
var sQS;
// Get the URL with the QueryString information
sURL = this.URL;
// Split the URL so that we get everything after the ?
// This is the QueryString
sQS = sURL.split('?');
// Split the QueryString into paired values FieldName=Value
sArray = sQS[1].split('&');
// Loop through the list of paired values and set the
// FieldName (sTemp[0]) equal to the Value (sTemp[1])
for (var i = 0; i < sArray.length; i++) { sTemp = sArray[i].split('='); this.getField(sTemp[0]).value = unescape(sTemp[1]); }

It is important to replace the function Doc/Open declaration that is created by default.

Notice that during editing the javascript error window will appear. This is normal bacause there is no this.URL to read since you are editing the file locally, but it will work once you access the pdf from a webserver as a URL.

3) Create the URL and the QueryString on the end of the URL using paired values of FieldName=Value&FieldName=Value... like the example below using your domain and pdf file.

<http://www.mysite.com/subdir/document.pdf?FirstName=Mark&LastName=Lyon&Email=***@yahoo.com>

There are several rules to remember about creating this URL:

a) You cannot use single ' or double " quotes for values in the QueryString since Adobe Acrobat will truncate the URL at the first ' or " that it encounters. So no FieldName='Value' or FieldName="Value".
b) You should encode all special characters as escape characters using escape() for JavaScript or Server.URLEncode for ASP. This allows you to use ' and " as well as =,/\|?&@#$%^*()-+ etc.
c) You must place all QueryString data AFTER the ? AFTER the pdf document name. Do not forget the ? and the format of <http://URL?QueryString>.
d) You must place all QueryString data in pairs of FieldName=Value and separate them using the & character. FieldName=Value&FieldName=Value.
e) You must spell the FieldName EXACTLY as the field object appears on the Adobe form. I recommend that you name your fields like FieldName or Field-Name or Field_Name.

I hope this helps and feel free to contact me if you have any questions or comments.

Thanks

Mark Lyon
***@yahoo.com
R***@adobeforums.com
2004-07-08 15:24:32 UTC
Permalink
Hey....
wwwwwWOW...
The Audience is LISTENING!

THIS IS GREAT!!... WHAT A SIMPLE WORK-A-ROUND

This is FANTASTIC

Thanks
Reg
G***@adobeforums.com
2004-07-08 15:41:09 UTC
Permalink
You should do this by passing FieldName=Value to the QueryString and reading
the paired values to set the fields during the Doc/Open event.




You have to be careful with this approach. Some browsers will not let you pass very much data this way and it allows the user to set values that you may not want. You should test this with a wide range of browsers using typical and untypical field values.

George
e***@adobeforums.com
2004-07-09 20:27:05 UTC
Permalink
I tried modifying the FDF file where the /F key information was located. I entered the URL of the PDF. This did nothing when opening the PDF file. I tried opening the FDF file from the Web browser hoping that the new location specified in the FDF file would open the appropriate PDF file.

What I am trying to accomplish is the retreval of the FDF information when I click a button on the form. I have 3 buttons on my form. On clicking each I want the respective data to populate the fields. This only works locally.

I can get it to work somewhat with the importAnFDF("http://192.168.100.1/Policy/MGC-PROD.fdf"), nut this only seems to work on workstations that have the full version of Acrobat.

Driving me crazy...

Thanks in advance for any help...

Ed
e***@adobeforums.com
2004-07-09 20:50:38 UTC
Permalink
So, It appears that one can not import FDF files using the Acrobat Reader... What good is this anyway???
G***@adobeforums.com
2004-07-09 21:25:55 UTC
Permalink
I tried modifying the FDF file where the /F key information was located.
I entered the URL of the PDF. This did nothing when opening the PDF file.




No, it wouldn't.

I tried opening the FDF file from the Web browser hoping that the new
location specified in the FDF file would open the appropriate PDF file.




This should work. Are you saying that it doesn't?

So, It appears that one can not import FDF files using the Acrobat Reader




You can return an FDF to Reader in response to a Submit Form action, as mentioned before, and you can link directly to an appropriately contructed static FDF. If I needed to do what you want, I would program a CGI that read the FDF and returned it as the response to a Submit Form action (or submitForm JavaScript).

You can also use a link like:


<http://www.peakforms.com/pdfs/form1.pdf#FDF=http>://www.peakforms.com/fdfs/record1.fdf



in which case the FDF should not contain a /F key at all. This loads both the PDF and then the FDF. But this isn't a good approach to loading data into the PDF that's currently being viewed.

George
G***@adobeforums.com
2004-07-09 21:29:08 UTC
Permalink
The forum mangled that URL by adding a strange face. It should be:

<http://www.peakforms.com/pdfs/form1.pdf#FDF=>

followed immediately by:

<http://www.peakforms.com/fdfs/record1.fdf>

George
e***@adobeforums.com
2004-07-12 15:36:41 UTC
Permalink
I tried opening the FDF file from the Web browser hoping that the new location specified in the FDF file would open the appropriate PDF file.

This should work. Are you saying that it doesn't?




Not working. It only changes the address line in my browser and gives a blank page.

<http://www.peakforms.com/pdfs/form1.pdf#FDF=http>://www.peakforms.com/fdfs/record1.fdf




This works but the page must get a refresh in order for the new data to be displayed.

You can return an FDF to Reader in response to a Submit Form action, as
mentioned before, and you can link directly to an appropriately contructed
static FDF. If I needed to do what you want, I would program a CGI that
read the FDF and returned it as the response to a Submit Form action (or
submitForm JavaScript).




Sounds good but I do not know anything about CGI.

I'll play with the Submit Form Action and see what I can come up with. I have not done this either.

Thanks for the information. Anything else you can add is appreciated.

Thanks Ed
R***@adobeforums.com
2004-07-13 14:50:57 UTC
Permalink
I would be curious to know if you got this CGI approach to work?
And would like to see a sample....

I'm using the the QueryString approach which is ok for limited data and small pdf forms.... and my situation

I've tried the suggestions with FDF and it really doesn't perform well via a URL..... As mentioned all i have is Acrobat Pro. I'm having the exact same problems as described by posts from "edleej"

What were your Results using the CGI program.... did it work?

If it did, do you mind sharing your findings or a link to your research showing the solution working as was done with QueryString post?

Just curious if it works and would like to see a sample.

Thanks

Loading...