Skip to main content
Participant
April 17, 2020
Question

Want to print mutiple booklet copies of a pdf and stapled individually but copies are merged

  • April 17, 2020
  • 1 reply
  • 360 views

Here is the code to print the document in mutliple copies sliently.

/* SilentPrint */
var pp = this.getPrintParams();
pp.NumCopies = global.numberOfCopies;
pp.interactive = pp.constants.interactionLevel.silent;
this.print(pp);

////////////////////////////////////////////////////////////////////////////////////////////////

Here is the code for me to put in the number of copies.

app.addMenuItem({ cName: "Set Batch Printing Copies", cParent: "File", cExec: "AskForPrintingCount();", nPos: 0 });

if (typeof global.numberOfCopies === 'undefined'){
global.numberOfCopies = 1;
global.setPersistent("numberOfCopies", true);
}

function AskForPrintingCount()
{
var response = parseInt(app.response("Number of copies to be printed", "Printing Count Setting", global.numberOfCopies));
if (!isNaN(response)){
if (response >= 1) {
if (response >= 500){
var largeAmountPrintingConfirmation = app.response("You are going to print " + response + " copies, Are you sure? (Y/N)" , "Confirmation", "N");
if (largeAmountPrintingConfirmation == "Y" || largeAmountPrintingConfirmation =="y"){
global.numberOfCopies = response;
}
} else {
global.numberOfCopies = response;
}
} else {
app.alert("You have entered " + response + ". The printing count is not changed." );
}
}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

The issue i am running into is that:

1. I can print pdf to say 5 copies booklet which is stapled individually.

2. My colleage failed to reproduce the same result using the same script, the same printer and the same setting. His result is a single copy of booklet. And 5 copies are merged together (The first page of the next copy is printed directly after the last page of the prior copy) and stapled together.

 

Can anyone give me some idea on what could be the issue here?

This topic has been closed for replies.

1 reply

ls_rbls
Community Expert
Community Expert
April 17, 2020

The script doesn't specify a default printer.

 

By default it will grab the printer parameters from whatever printing device is set as default by the operating system.

 

If using windows, make sure that he has set as the default the same printer that your computer is set to with exactly the same preferences and printing properties.

 

It may be necessary  to differenciate what exactly are the printer properties and preferences set to on each computer , and then manually adjustt in   his computer.

 

If this is not the issue, ensure that both computers have the same updated printing device firmware and driver.

1LMYAuthor
Participant
April 17, 2020

Thanks very much for your comment.

 

So i am pretty sure we have the same default printer, printer driver and printer setting because out working instance are virtual machine derived from the same template. And i have tried to 1:1 compare the printer setting (at least what visiually avaiable to me) on both computer to make sure the setting is the same.

 

And i just tried to use the javascript again and guess what, i cannot get the script to work as well. I am so confused right now.

ls_rbls
Community Expert
Community Expert
April 17, 2020

You can't get it to work on both computers or just his computer?

 

Open the form in Acrobat, and hit Ctrl+J keys in your keyboard to open the javascript console. See what errors are thrown by the script