Expand my Community achievements bar.

How to set to print to a specific printer name

Avatar

Level 2

Background:

I have a form (one page) which has two hidden pages to it (front and back of certificate).  The details entered on form appear on certificate.  I have a hidden button on form which when pressed asks for a password and unhides certificate if correct password is entered as well as a button on form to print the certificate.  This button to print the certificate is preset to print only pages 2 and 3.

Question:

I would like to know if there is a way of setting the "print certificate" button to automatically select a printer name as forms can be printed on any local printer but the certificate needs to print to a specific printer which is colour and has card stock.

The only code I have currently behind this print button is the following:

 

xfa.host.print(1, (xfa.host.numPages -2).toString(), (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);

1 Reply

Avatar

Level 10

Hi,

I am fairly sure that you cannot do it using the xfa.host.print, but you may get a printParams working. See an example here https://acrobat.com/#d=Kuivy1SdOSbQnRs3kyeVDQ, in particular on page 2.

Hope that helps,

Niall