0 Replies Latest reply on Apr 3, 2012 6:56 AM by WASEEM Hamdan

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

    WASEEM Hamdan

      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.