I have the following code in a folder level JS (not the only code):
app.beginPriv();
var myDoc = event.target;
myDoc.saveAs(path, formato);
app.endPriv();
})
It works OK woth Adobe Profesional but with Abobe Reader it gives me the following error:
TypeError: Invalid argument type.
Global.saveAs:18:XFA:topmostSubform[0].Page1[0].PrintButton1[0]:click
===> Parameter cPath.
I noticed that when using Adobe profesional, the variable myDoc is translated to "object Doc" but when using Reader it translate to "object Global". Maybe it has something to do with the problem.
Please help me!! Any Idea???
What version are you using? This function is considered an un-safe funtion. It could be used maliciously, but it's also very useful. So the restrictions on it have varied with just about every new version.
As for "event.target", this is context dependant. From where is it being called? I did a test script calling your function from a menu item and didn't have any problems on either Acrobat or Reader 8.1
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script