Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Disable print to file printer (soft copy printer) using JavaScript

Avatar

Level 1

Hi All,

I have a case where end users would select printer from dropdown box and then push print button to print the document silently.  I have done that as following:

form1.main.printerDropdown::initialize - (JavaScript, client)

     var l = app.printerNames.length;

     for ( var i = 0; i < l; i++)   

     printerDropdown.addItem(app.printerNames[i]);

form1.main.printerDropdown::change - (JavaScript, client)

     printerName.value=xfa.event.newText;

form1.main.printBtn::click - (JavaScript, client)

     var doc=event.target;

     var pp = doc.getPrintParams();

     pp.interactive = pp.constants.interactionLevel.silent;

     pp.NumCopies= 3;

     pp.firstPage = 0;

     pp.lastPage = (xfa.host.numPages -2);

     pp.printerName=printerName.value;

     event.target.print(pp);

However, end users do not need soft copy printer (adobe PDF, MS Windows XPS document writer, … etc) to be listed in the dropdown box.  how to identify the printer type (printer or print to file) using JavaScript?

Please advise.

Thanks in advance.

Waseem.

0 Replies