I have a .ps file that I want to print from my mac. I'm trying to use lpr. But every time I print it all I get is the actual bytes just printed with like hundreds of pages and this is not what I want. I want the printer to just print the ps directly. What command should I use to make this work?
I have a .ps file that I want to print from my mac. I'm trying to use lpr. But every time I print it all I get is the actual bytes just printed with like hundreds of pages and this is not what I want. I want the printer to just print the ps directly. What command should I use to make this work?
The issue you're encountering is likely because the `lpr` command is treating the `.ps` (PostScript) file as raw data rather than interpreting it as a PostScript file. To properly print a PostScript file, you need to ensure that the printer or the print system understands that it's a PostScript file. Here’s how you can print a `.ps` file correctly using `lpr` on a Mac: ### 1. Use the `-o raw` option The `-o raw` option tells `lpr` to send the file directly to the printer without any additional processing. This is useful if your printer supports PostScript natively.
1 | lpr -o raw yourfile.ps |
1 | brew install ghostscript |
1 | gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=- yourfile.ps | lpr |
1 | lp yourfile.ps
|
Testing if the previous output contains the string -l
: False
Testing if the previous output contains the string -o raw
: True