How to populate and read fields in PDF form using Javascript iframes.

Hi -
I have a Web app written in javascript with iframes.  I want to use a fillable PDF form that I can auto-populate with the user's name in javascript and then read the fields that the user populates.   The process flow would be: (1) user logs into web application (2) user selects "complete form X"  (3) the pdf form X would open in Adobe Acrobat (preferably in an iframe) (4) the web app javascript would populate the user's info in the appropriate pdf fields (5) the user would fill in the other pdf fields (6) user would select "submit" button on pdf form (7) web app javascript would read the other pdf fields that the user populated (8)  pdf form X would close (9) web app would complete with the data entered.

From what I gather on the Adobe site this is not possible to do.    I can export the fields to an XML and email it from the PDF,  but I really want to read them.  I don't understand why I cannot populate some fields either.   I have Adobe Acrobat 8 Professional that I am using to build the PDF form.

I appreciate any tips you can provide.
mollylabAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michel PlungjanIT ExpertCommented:
Likely a security issue
Can you load the PDF with the values in the query string? Those values should then be available to the code in the pdf
0
mollylabAuthor Commented:
mplungian - Thank you for your comment.   I'm not sure what you mean by the "query string".  I can open the PDF in an iframe  <iframe src="filename.pdf">, but I could not find a way to add arguments/ values to the src.      Even if I could, I still don't have a way of reading the fields in the PDF after it is populated.   Since I'm not finding a solution anywhere, I'm concluding that this just cannot be done.
0
Michel PlungjanIT ExpertCommented:
Query string is what comes after the ?
Filename.pdf?parm1=value1&parm2=value2
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

mollylabAuthor Commented:

My code is:

<iframe id="MAIN" name="MAIN" style="visibility:hidden;position:absolute;height:2650px;width:1000px;left:0px;top:32px" src="td1_11282011.pdf#toolbar=0&navpanes=0&scrollbar=0&Lastname=Smith" frameborder="no" marginwidth="0" marginheight="0" scrolling="no"></iframe>

Note that  toolbar, navpanes, & scrollbar are all predefined args that define the PDF frame.  I added "&Lastname=Smith" where "Lastname" is a field defined in the PDF.    I do not get an error, but nothing is displayed in the field.
0
Michel PlungjanIT ExpertCommented:
It of course does not work like that. You need a little more work. I'll see if I can find a PDF script you need to add inside the PDF
0
Michel PlungjanIT ExpertCommented:
First link I googled searching for
JavaScript access query string in PDF
gave
http://blogs.adobe.com/pdfdevjunkie/2009/12/populating_pdf_form_fields_fro.html


0
mollylabAuthor Commented:
mplungjan:  Thank you for your help, but I still don't think it is possible to do what I want.   I was able to add javascript to the PDF so that it read an argument from the URL (ie mypdffile.pdf?lastname=mollylab) and would display the "lastname" via an "alert", but I could NOT overwrite the "form_lastname" field in the PDF form with the data from "lastname".   Not sure why, but regardless, I want to open the PDF form in an <iframe>, not in a new window.   I have the "lastname" in the HTML code and want to pass it to the PDF form.   I've been searching the Adobe documentation and found this in the Acrobat Javascript Scripting Guide:
Acrobat Javascript does not have access to objects within an HTML page.  Similarily, HTML Javascript cannot access objects within a PDF file.
HTML Javascript is able to manipulate such objects as Window.  Acrobat JavaScript cannot access this particular object but it can manipulate PDF-specific objects.

I think that if it were possible to do what I want to accomplish I would have easily found others that did the same thing.   Adobe Acrobat Pro with LiveCycle Designer is a powerful tool, but does not interface with anything else.

0
Michel PlungjanIT ExpertCommented:
An iFrame IS a new window - so if you pass the value to the URL, the PDF can read and populate
0
mollylabAuthor Commented:
As I stated before: I was able to add javascript to the PDF so that it read an argument from the URL (ie mypdffile.pdf?lastname=mollylab) and would display the "lastname" via an "alert", but I could NOT overwrite the "form_lastname" field in the PDF form with the data from "lastname".

The question is: Is it possible to read and write into a PDF Form that was created using Adobe Pro 8 LiveCycle Designer?    I wrote Javascript that can read the value from the URL, but how do I get it to populate the Form?    The PDF Javascript I wrote does not recognize the Form's field name "form_lastname".
0
Michel PlungjanIT ExpertCommented:
How exactly are you accessing the field?
I expect something  like
this.forms["form_name"].fieldname.value
0
Michel PlungjanIT ExpertCommented:
0
Michel PlungjanIT ExpertCommented:
0
mollylabAuthor Commented:
That is the same link you posted on 12/20/11.  I've read it.
0
Michel PlungjanIT ExpertCommented:
And used it exactly as described?
I have not seen any code from you that looks like the code in the link
0
NKOWACommented:
If you need to parse PDF form submission fields on a Microsoft .NET webserver, check out FDFToolkit.net.

FDFToolkit.net can read, write, parse, populate and merge PDF forms with XML, XDP, XFDF, FDF data. Works with Adobe LiveCycle and Adobe Acrobat forms.

FDFToolkit.net is a .net programming component.

If your webserver is Non-Microsoft and you need to parse PDF form data, then Google "iText".

Useful links:
http://www.fdftoolkit.net/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
James MurrellProduct SpecialistCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Acrobat

From novice to tech pro — start learning today.