Javascript- Acrobat print to file 'silently' is asking for a file name in 'save as' dialog box.
I am trying to print multiple pages per sheet (1x3) print to file using javascript. I want it to print in silent mode. I have the output file name specified in the code. But it it showing 'save as' dialog box before printing. Once file name is supplied, it prints as specified.
I don't want the 'save as' dialog box. I want it to be silent. What change do I need to make in the code here?
var re = /\.pdf$/i; //regex to to acquire the base name of file
var baseFileName = this.documentFileName.replace(re, ""); //***without base file name, all fails
var fName = baseFileName + " print test" + ".prn"
pp = this.getPrintParams();
pp.bUI = false //non-interactive printing
pp.bSilent = true //non-interactive printing
pp.bShrinkToFit = false
pp.interactive = pp.constants.interactionLevel.silent; //non-interactive printing
pp.printerName = "Adobe PDF"; //print to file
pp.fileName = fName; //"/c/print/myDoc.prn";
pp.pageHandling = pp.constants.handling.nUp; //setting up multiple pages per sheet
pp.nUpPageOrders = pp.constants.nUpPageOrders.Horizontal; //Vertical
// pp.firstPage = 0; //specify start page;0-indexed
// pp.lastPage = 4; //specify end page;0-indexed
pp.nUpNumPagesH = 1;
pp.nUpNumPagesV = 3;
pp.nUpPageBorder = false; //no borders
pp.nUpAutoRotate = false; //no auto rotation
this.print(pp);
