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

Import Data using Reader

wdrspens
Registered: Jul 22 2008
Posts: 94

Is it possible to code a button to import certain Data into a form where the person using the form will almost certainly only have Reader?

I have a form which gives booking details and address details for the hirer. The hirer could well hire more than once and I would like the person entering the hirer's new booking data to import just the hirer's address details from the previous hiring/booking. Is that possible?

Thanks

David

My Product Information:
LiveCycle Designer, Windows
scottsheck
Registered: May 3 2007
Posts: 138
yes, that is possible just using reader with the importdata() function.
wdrspens
Registered: Jul 22 2008
Posts: 94
Unfortunately my copy of Reader does NOT import the data. It will export it, but not import it. Any suggestions? Of course Acrobat 7 (and presumably 8)does import it, but that is of no help to me where, as here, the person filling in the form only has Reader.
Thanks anyway.
David
scottsheck
Registered: May 3 2007
Posts: 138
I thought you meant programattically import data. Do you mean import from the menu?
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
This has to be done using JavaScript in LiveCycle Designer and the "Extended Reader Rights" need to be applied. One can import text data, XFDF data, or a data object.

George Kaiser

wdrspens
Registered: Jul 22 2008
Posts: 94
You are quite right, I do mean programmatically import data.

I have made a button on my form and have used the javascript code:
xfa.host.importData();
on the click event, but although it works fine in Acrobat 7 and 9, it does not work in Reader 9.

I press the button and nothing, nothing at all happens, ecept that the button momentarily chages colour and appears to depress. Unfortunately the option to import the data is not given.

I have just discovered that the export data button does not work in Reader either! I can get around that by emailing it to the person who has filled it in, but I cannot circumvent the import problem.

I have tried it both with and without extended features in Adobe Reader, with the same results.

I have saved the form complete with data after extending the features, but I cannot either import or export.

Regards
David
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Are there any console error messages?

Have the "Extended Reader Rights" been enabled/applied to the form?

George Kaiser

wdrspens
Registered: Jul 22 2008
Posts: 94
Hi,

If by "extended reader rights" you mean under the Advanced tab of Acrobat 9 clicking on "Extend Features in Adobe Reader" then the answer is yes.

I can and have used a "Save Form" button which I have programmed with the code:
app.execMenuItem("SaveAs");

For that I had to extend reader rights (as above described) to get it to work and it has always worked perfectly.

I wanted to replace that button with an Export and Import pair of buttons, so used the code:
xfa.host.importData();
on the import and, on the other export button,
xfa.host.exportData("",0);

And it is that code that I cannot get to work even though I have again extended reader rights. (It works perfectly alright in Acrobat 9 and 7)

I get no error messages, just a slight change in colour of the button when I click on it, and nothing, but nothing happening.

Thank you very much

David
scottsheck
Registered: May 3 2007
Posts: 138
I figured that the exportData was not working programatically, because it does not work in Reader. That's why I thought maybe you were trying to interactively do this.

Both of course will work in acrobat, but for some reason, only the import works in reader.
wdrspens
Registered: Jul 22 2008
Posts: 94
I wish the import did work in Reader, as I can get round the failure to export, but cannot get round the failure to import, and it is the importing that I want to work.

Still I will have to persuade the person who will mostly be filling in the form to invest in the full program.

It is so annoying that import does not work in Reader.

Thanks for your help, anyway,

David
scottsheck
Registered: May 3 2007
Posts: 138
The import DOES definately work in Reader. Have you tried all of the things gkaiseril mentions.
wdrspens
Registered: Jul 22 2008
Posts: 94
It is funny that you emphasise that it DOES work in Reader, when my experience is to the contrary.

It could be that I am doing something wrong, but I have put up here all the code I use and how I extend Reader rights, and no one has suggested I should be doing something else.

I am left, therefore, with the inevtiable conclusion that it does not work in Reader.

Very Annoying.

Again, thank you very much for your assistance.

David