Add specific printer output tray as new printer

I need to add printer output tray which has virtual name how can I add that tray as printer in Ubuntu.

I need to add that printer with shell command not in GUI.


I found the answer

  1. I need to add new printer as shell script which can be part of my charm config.

  2. With lpadmin (adding new network /shared printer) there is an option part -o [options]

  3. All options are printer specific and all defined in printer's PPD

  4. Install printer with correct PPD

  5. Look at all "options" with lpoptions -p [Printer Name -l]; it displays all printer's features as options and finds Output Tray or Output Bin

  6. In my case it was "OutputBin=" however in one of my printers the tray or bin numbers were Bin1,Bin2, ... and the other one was MailBoxBin1, MailBoxBin2,..

So the correct command is:

lpadmin  -p [printer local name] -v smb://domain/user:pass@printer_server_IP/Printer_shared_name  [ or socket://printer_IP:port/ ] virologic/apprunner:[email protected]/ITPrinterBW -E -P [printer PPD file]-o OutputBin=Bin1