Specifying Printer Tray In Commander Script
I was wondering if it's possible to specify a printer tray in the commander script. I've been able to successfully setup my input text file so that Commander recognizes and sends the information to Bartender, however, my printer has 3 trays and when the text file is created, I would like to specify which printer tray to print to (tray 1 = regular paper, tray 2 = large labels, tray 3 = small labels). Is this possible?
I found a [url="http://www.seagullscientific.com/newsletter/2006_summer/DetailsCommandLineParameters.htm"]Seagull newsletter from 2006[/url] that shows the /Tray="<tray name>" parameter, but I haven't had any success in getting it to work.
I'm currently using Commander 9.4 RS3 and have included the text file contents below:
%BTW% /AF="c:\Users\...\Bartender Label Test\HardwareInvoice.btw" /D="%Trigger File Name%" /PRN=\\printers\xe5010 /Tray="Tray 1" /R=3 /P /DD
%END%
Around the Town,Jerome Davis,Buyer,1220 Governor Sq.,Hadden,Alberta,WA1 1DP,Canada,(171) 555-7788,(171) 555-6750, 6
-
Hello,
Perhaps you're not setting the name for the tray correctly. Please note that the tray name needs to match with the tray name you see in the printer driver for your printer. From BarTender's Help:
/Tray=<tray name>
Specifies the printer's paper tray to print from if multiple trays are available. The "tray name" string is compared to the list of tray names provided by the driver. Matching ignores whitespaces and is case-insensitive. If the specified tray is not available, this setting reverts to the default printer tray.0 -
Legacy Poster
★ BarTender Hero ★
[quote name='Domingo - Seagull Support' timestamp='1349853521' post='3460']
Hello,
Perhaps you're not setting the name for the tray correctly. Please note that the tray name needs to match with the tray name you see in the printer driver for your printer. From BarTender's Help:
/Tray=<tray name>
Specifies the printer's paper tray to print from if multiple trays are available. The "tray name" string is compared to the list of tray names provided by the driver. Matching ignores whitespaces and is case-insensitive. If the specified tray is not available, this setting reverts to the default printer tray.
[/quote]
Good Morning,
Thank you very much for the response. The printer I'm trying to print to is a Xerox Phaser 4510 Laser Printer with 3 trays. In the windows printer preferences, they're named "Tray 1", "Tray 2", "Tray 3". I've tried every combination I can think of to no avail. Tray 1, Tray_1, Tray-1, Tray1, etc. Bartender seems to default to the "automatically select" preference as the label will also print out of the default Tray 3.
As a work around I installed the printer 3 times, each one with tray preferences specified so Printer1_Tray1 by default is set to print from Tray 1, Printer1_Tray2 is set to print from tray 2, etc. When printing from within bartender, this works great. The newest challenge is when trying to print from commander, passing the printer via script /PRN="Printer1_Tray1" correctly prints to Printer1, but Bartender seems to default to whatever printer preferences are specified in the default printer. It's very weird, but from my testing the .btw template I created in Bartender is defaulting to the preferences in the printer specified in the .btw print screen. If, for example, my .btw template is set by default to print out of the windows default printer "Printer2" (which has a default preference to print from Tray 2) and I pass via commander script /PRN="Printer1_Tray1", Bartender correctly passes the label to Printer1, however, it'll print out of tray 2. I've setup my .btw so that in page setup, it's set to "use printer preferences", and in print, Bartender defaults to the default windows printer (It appears the .btw has to be associated with a printer, by default the windows default printer). Is there another setting somewhere that could be directing Bartender to use other printer preferences?
Thanks,
bpjohn0 -
Legacy Poster
★ BarTender Hero ★
[quote name='bpjohn' timestamp='1349880274' post='3470']
Good Morning,
Thank you very much for the response. The printer I'm trying to print to is a Xerox Phaser 4510 Laser Printer with 3 trays. In the windows printer preferences, they're named "Tray 1", "Tray 2", "Tray 3". I've tried every combination I can think of to no avail. Tray 1, Tray_1, Tray-1, Tray1, etc. Bartender seems to default to the "automatically select" preference as the label will also print out of the default Tray 3.
As a work around I installed the printer 3 times, each one with tray preferences specified so Printer1_Tray1 by default is set to print from Tray 1, Printer1_Tray2 is set to print from tray 2, etc. When printing from within bartender, this works great. The newest challenge is when trying to print from commander, passing the printer via script /PRN="Printer1_Tray1" correctly prints to Printer1, but Bartender seems to default to whatever printer preferences are specified in the default printer. It's very weird, but from my testing the .btw template I created in Bartender is defaulting to the preferences in the printer specified in the .btw print screen. If, for example, my .btw template is set by default to print out of the windows default printer "Printer2" (which has a default preference to print from Tray 2) and I pass via commander script /PRN="Printer1_Tray1", Bartender correctly passes the label to Printer1, however, it'll print out of tray 2. I've setup my .btw so that in page setup, it's set to "use printer preferences", and in print, Bartender defaults to the default windows printer (It appears the .btw has to be associated with a printer, by default the windows default printer). Is there another setting somewhere that could be directing Bartender to use other printer preferences?
Thanks,
bpjohn
[/quote]
Good Morning,
After doing some more testing, it appears my initial assessment was incorrect. The /Tray command is being recognized by Bartender. When I run Commander as an application , set it to "Show All Running Bartenders", and pass the file for Commander to read, Bartender is correctly opening up the template file, is correctly setting the printer based on the /PRN, and is correctly setting the Tray in the "Page Setup" settings based on /Tray. The correct printer prints, but the tray is wrong. If I manually re-print with the same settings, it still prints from the incorrect tray (As Bartender is already open with the template file loaded, I'm just doing File->Print). If I close and re-open Bartender, enter the same print settings by hand, and print manually, it works.0 -
Legacy Poster
★ BarTender Hero ★
Issue has been solved.
Turned out I had specified the network location as the /PRN parameter instead of the local printer name. Bartender was reading the right values, but the network settings on the printer were overwriting the commander parameters.
I also didn't realize I had to stop detection in commander between each test case when I tweaked the commander script. It was retaining some info in memory that was interfering. I will always stop commander and restart if I perform testing in the future.
Thanks for your help on this and other issues! You guys are great0 -
Legacy Poster
★ BarTender Hero ★
Hi,
I realize that this is an old post but I just wanted to comment if someone is looking for an alternative solution for printing with different settings from the same printer.
As OP suggested you can create multiple printers and name them accordingly, eg. "Printer_tray1", "Printer_tray2" etc. If you modify the Printer Preferences it will only work with the user account you logged into the system. When printing directly from Bartender this is not a problem. However when you let Commander handle the printing it either uses the System Account or the user account you have specified for it in system services. When the System Account or the Bartender service account prints they use the Printer Default Settings if not defined otherwise.
The trick is that when you specify your settings for your printer you have to modify the "Printing Defaults" for that particular printer. These can be found under "Printer Properties" --> "Advanced" -tab --> "Printing Defaults". Modifying the default values for the printer will make every user use these settings if not specified otherwise. This way you can utilize all the features your printer provides and just make one new printer for every setup you would like to use. Different paper types, stapling, sorting, stacker etc. You don't need the commander script "/Tray" for anything after this.
BR
Pete
[attachment=1449:default.PNG]
0
サインインしてコメントを残してください。
コメント
5件のコメント