Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a cups line printer (Epson 9 pin).Printing works fine but it skips the page after one print.

I'm using echo "Hi" | lpr -P myprinter command to test.

It prints the message,But when I again print using this command, it skips the current page and print on the next page(Obviously there is lot of space in current page). Any Idea?

share|improve this question

2 Answers 2

The CUPS printer server considers everything that you send it as a separate printer job. This means, your line containing "Hi" is a printer job. By default, different printer jobs go to different pages; this explains what you are now getting.

Now, 30 years ago when all printers were like your Epson 9pin, things were different. Printer managers like CUPS were seldom used. It was very common to send data to the printer one line at a time, like you do with your echo, and it was natural for the printer to wait for the next line, without going to the next page. This is how we used to print stuff. If you want to do that now, you'll have to print using "RAW" mode, practically bypassing the printer job management that CUPS performs. You'll also need to suppress the "form feed" that CUPS by default sends in between printer jobs, which causes the page change; you'll need to print a final "form feed" yourself.

I suggest that you take a look here, you may find your answer already waiting.

share|improve this answer
up vote 0 down vote accepted

Adding switch l fixed the issue.

echo "Hi" | lpr -l -P myprinter

-l Switch Specifies that the print file is already formatted for the destination and should be sent without filtering. This option is equivalent to "-o raw".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.