-1

I've got a silly problem which is literally driving me mad:

When I try to print a file using lpr file.pdf depending on the file I obtain one of the following issues:

  1. the printer does not recognise the A4 format
  2. the file is printed but together with a countless number of pages of programming code ( the 'real' face of a PDF file I guess), characters and numbers.

The same happens also for PNG files.

I'm using MAC OS X El capitan and a Xerox colorQube printer. Clearly if I open the file with Acrobat or Preview and just make the printing manually I have no problem at all.

I hope you can give me some clues because I couldn't find anything useful on the web.

PS: If I use the option -l the printer prints a sheet saying that the printer is not configured to print pdf files directly.

1 Answers1

0

lpr sends file directly to printer, it may not understand pdf as-is, but since pdf is a successor to postscript - it can contain familiar commands so something gets printed, but the rest, probably the embedded preview and so on - gets printed as raw text

Try using ghostscript to convert to postscript before sending to printer:

gs -dSAFER -dNOPAUSE -sDEVICE=(your printer name) -sOutputFile=\|lpr file.pdf
Vasfed
  • 18,013
  • 10
  • 47
  • 53
  • Thanks for help. I tried your suggestion (I had to add a space between the backslash and the pipe though) for one file and it actually worked fine, even if it took some minutes for a relatively small file. I tried the same line for the 3 files in the directory ( `lpr -l *.ps` ) but I got the problem 2 and I stopped the printing. Anyway if the problem is the pdf format I would probably better make the conversion first and the printing after as I have around 150 files. – serehrenfest Jan 16 '16 at 21:00