Silent Printing as a new document to local disk via "PDF Printer".
Dear all:
After filling the fields in the dynamic form, without touching and changing the master form. I want to use "PDF Printer" to save as a new purely static document cleared of the JavaScript codes which is embedded, by changing the file name from the reference field information (ex.DocumentNumber+DocumentDate). I want to assign a button to all these and use the following User level and button level code combination.
This is JavaScript for User Level
// JavaScript of Silent Print for Folder Level
sPrint = app.trustedFunction(function(doc) {
app.beginPriv();
var pp = doc.getPrintParams();
bUI: true
pp.interactive = pp.constants.interactionLevel.automatic; // pp.interactive = pp.constants.interactionLevel.silent OR automatic;
pp.printerName = "PDF Printer";
doc.print(pp);
app.endPriv();
});This is JavaScript for Button
// JavaScript For Button
// Add Stamp
this.addAnnot({type:"Stamp",AP:"#-_qO5DiVhB8W6rvdDCXd8D",page:this.pageNum,rect: [306,175,394,263],rotate: 8});
// Set the buttons to hidden
getField("function").display = display.noPrint;
getField("Approve").display = display.noPrint;
event.target.display = display.noPrint;
// Print
sPrint(this);
var annots=this.getAnnots();
for (i in annots) annots[i].destroy();
