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

Print Attachment Button

GovDev
Registered: Jun 8 2010
Posts: 5

Hi,
I've been trying to be able to print an attachment imbedded in a LiveCycle form using the following JavaScript on the click event of a button:
 
var oThis = event.target;
var d = oThis.dataObjects;
var oDoc = oThis.openDataObject(d[0].name);
try {
var pp = oDoc.getPrintParams();
pp.interactive = pp.constants.interactionLevel.full;
oDoc.print(pp);
oDoc.closeDoc();
} catch(e) { app.alert("Operation failed------>"+e.name);}
 
The code assumes the user wants to print the first attachement, it successfully opens and returns the DataObject object for that attachement yet when I pass the object to the print method it returns a 'NotAllowedError' error. The Acrobat 8.0 API doesn't say it shouldn't work, the only constraints seam to be if the interactionLevel is set to silent.
 
Any help would be appreciated.
 
Thanks.
 
Kyle

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Does the script run from the console?

If so, then you need to follow the instructions for the "S" in the Quick Box for the "print" method.

George Kaiser

GovDev
Registered: Jun 8 2010
Posts: 5
My goal is to have a user open an xfa form, press a button and the attached flat pdf prints.

Kyle