0

I am trying to set up an automatic printing solution on a Windows 2012 R2 Server.

So far I have written a .bat file that loops through and prints all pdf files that are in a folder. The main command looks something like this :

lpr -S 100.100.100.100 -P printQ %%F

(Where %%F is the file name)

Looking at Microsoft's documentation on this page, there doesn't seem to be anyway to specify the printer tray.

I could specify the printer tray through the control panel, but the batch script needs to dynamically assign different paper trays for different files.

I've come across some commercial command line printing solutions that use lpr and that are able to specify paper tray. Would I be correct to assume that it is therefore possible to dynamically specify paper tray using lpr?

Terence
  • 104
  • 8

1 Answers1

1

I worked around the lpr limitations by creating 2 instances of the same printer in the control panel > Devices and Printers. And setting up both instances with a different paper tray source.

The lpr command seemed to ignore different printers set using the "-P" argument, probably because the "-S" argument was the same IP for the same printer. So I ended up using the PDF-XChange command line printing function instead.

"C:\Program Files\Tracker Software\PDF Viewer\PDFXCView.exe" /print:printer=!printer! "%%F"

I'm not sure if this is the best solution, but it works for now.

Terence
  • 104
  • 8