In the JS guide this.print is used as an example like the one below. I get TypeError: this.print is not a function when I try to use this.print on a button click event. I"m trying to print to pdf to remove any db connections which always error out when the form is opened by anyone but me since the connection is only local. Someone said I might try printing to pdf and this is the script I found in the JS Guide. Should this work for me from a function in config.js in a trusted folder. All the other functions in this file work fine.
var printmenowtopdf = app.trustedFunction(function(doc,two,three) {
app.beginPriv();
var myPath = app.getPath("user", "documents") + "/_pdf/" + three + two + "_" + myDateString() + ".pdf";
this.print({
bUI: false,
printerName:"Adobe PDF",
fileName:myPath,
bSilent: true,
bShrinkToFit: true,
});
app.endPriv();
});
thanks for your help
Milton