Page 1 of 1
cmd or lpr
Posted: Thu Jun 23, 2011 4:12 pm
by sherczog
Hi,
I am trying to send a postscript through lpr to a postscript printer. If I use a *.cmd file PowerSwitch logs : “postscript was discarded” and nothing is transported to the printer.
the commandline in the file is :
echo off
lpr -S 10.31.157.121 -P print %1
Can anyone tell me what I am doing wrong, or what a alternative method could be.
thanx
cmd or lpr
Posted: Thu Jun 23, 2011 5:02 pm
by rzacherl
Hi,
three things come to my mind:
- option -S is only supported on Windows
- %1 (the input path) must be surrounded by double quotes since Switch 09
- the permissions of the incoming folder of Execute command must have full read permissions for lpr
Regards
Robert
cmd or lpr
Posted: Fri Jun 24, 2011 4:12 pm
by dkelly
Assuming you are using Windows, the lpr command sends a reset prologue before the job. You have to use the '-o' option to prevent this behavior.
lpr -S myserver -P myprinter -o "%1"
Or you can copy the directly to the printer using its UNC name.
copy "%1" "myservermyprinter
Dwight Kelly
Apago, Inc.
dkelly@apago.com
cmd or lpr
Posted: Mon Jun 27, 2011 5:06 pm
by rzacherl
Using lpr has the big advantageof being able to make use of device specific control parameters via the lpr -o parameter. Examples are (depends on the device capabilities):
-o landscape
-o media=Upper
-o media=Lower
-o media=Tray1
-o media=A4
-o media=two-sided-short-edge
-o sides=one-sided
...
regards,
Robert
cmd or lpr
Posted: Tue Jun 28, 2011 12:53 pm
by sherczog
Hi rzacherl and dkelly,
thanx for your effort and reply. I will test it.
cmd or lpr
Posted: Tue Jun 28, 2011 2:34 pm
by sherczog
Hi rzacherl and dkelly,
It took some time to figure out, but it works!
the correct argumentfor the command is:
‘E:Testin’ “%1”
and the command for the lpr is :
lpr -S 10.31.157.122 -P print -o "%1"
It would be nice if Enfocus put some examples in their reference guide...anyway, thanx again!
regards
cmd or lpr
Posted: Tue Apr 03, 2012 12:46 pm
by sascha.koerber
Hello there,
perfect post that helped me a lot. Thank you!
If you're looking for another challenge, please help me solving the following problem with printing from switch:
Printing via Windows lpr-command works pretty well like described in the posts above - as long as you don`t need to send special commands to the printer. The Windows lpr-command does not provide the -o option in the way the linux lpr does, so you can`t pass on a command to choose a desired output tray.
In Linux i would use something like this:
lpr -P printer -o=">setpagedevice" [filename]
OK - here comes the challenge:
The printer that i`m printing to has a mailbox/sorter unit with output trays. Different flows on the same Switch need to output the prints to different output trays. Neither Windows lpr nor copying the print job to the windows print queue (printerqueue) let me manage, which tray the printer should use.
Do you have any idea/workaround how to solve that, besides creating a print queue for every single output tray?