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
cmd or lpr
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
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
-
- TOP CONTRIBUTOR
- Posts: 628
- Joined: Mon Nov 29, 2010 8:45 pm
- Location: Alpharetta GA USA
- Contact:
cmd or lpr
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
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
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
-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
Hi rzacherl and dkelly,
thanx for your effort and reply. I will test it.
thanx for your effort and reply. I will test it.
cmd or lpr
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
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
-
- Newbie
- Posts: 10
- Joined: Mon Mar 19, 2012 6:34 pm
cmd or lpr
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?
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?