Highlighted

importData()

Avatar

Guest

31-03-2009

Hi everybody,



I've just create a new Form with a button that should import xml data by clicking.

I use the xfa.host.importData() method.

It's works perfect when I open the form in my environment, but when I

open it in a computer which only has a simple Abode reader, my import

button doesn't work anymore and I don't understand why.



Any help would be appreciated.



Pascal.

Replies

Highlighted

Steve_L_Walker

31-03-2009

Pascal,



Importing and exporting data into a PDF form is possible under two circumstances:



1) The PDF is opened in Acrobat Professional (or the PDF is previewed in LiveCycle Designer and Acrobat Professional is running).



2) The PDF has been rights-enabled for importing and exporting data using LiveCycle Reader Extensions ES. If the PDF has not been rights-enabled for importing and exporting data, the import feature will not work in Reader.



This is true of other PDF document functions including local save and digital signatures, also.



Steve
Highlighted

jgrd

05-03-2010

Hi,

I've been searching a lot about this question. If I understand well, it seems possible to allow Adobe Reader to importData just by "Reader Extending" the form.

I did it in Adobe Pro-9.3 by doing:

Advanced > Extend Features in Adobe Reader ...> 'Save Now'.

But I still get the Error

NotAllowedError : Security Settings prevent access to this property or method

Doc.importXFAData: ....MyButton.click

even in Adobe Pro. If I don't "Reader Extend" the pdf forms, I can importData in Adobe Pro.

Can anybody tell if I can allow my form to importData in Adobe Reader ?

Thanks a lot,

Best regards

jgr

Highlighted

pguerett

05-03-2010

You do not need to Reader Extend to allow for a data import. But my guess is that you are nameing the file that needs to be imported a

nd that is what is causing the error. Acrobat/Reader wil not let you do an automatic operation like that unless the

script is running as a privelidged command. You can use the xfa.host.importData() without a paramater and a dialog will come up and allow the user to select a file. Note that by default an XDP extension will be require. If you have an XML file you want to load then the command woudl be:

xfa.host.importData("", false);

Hope that helps

Paul

Highlighted

jgrd

05-03-2010

Hi,

thanks a lot for your very quick answer.

I was indeed using xfa.host.importData() without any argument (as I thought I should) so that a file dialog pops up.

It's the only method which works out in LiveCycle and Adobe Pro, without Reader Extend.

I've just tried out your method with no result sadly!

Thanks for your help,

jgr

Highlighted

pguerett

05-03-2010

Sorry I messed up ...I gave you the exportData syntax ....importData only allows one paramater (the filename) ...so you should be using

xfa.host.importData();

Is that working for you?

Paul

Highlighted

jgrd

05-03-2010

Hi,

thx again.

But no!, xfa.host.importData(); doesn't work... Only in LiveCycle and Adobe Pro without using the Advanced>Reader extension.

So no way to make it work in Adobe Reader, though it might be possible nevertheless. I missed out something somewhere...

Regards,

jgrd

Highlighted

pguerett

05-03-2010

Sorry my mistake ...it will work if you Reader Extend using the server product .....it will not work if you Reader Extend using Acrobat (this is a subset of the server product). The server has an import/export form data right that can be set. When I turned that in it worked fine in reader. I assume that you do not have the server product....right?

Paul