Solved HP4050 allways prints out extra page with user/hostname

Hei,

I got myself a used HP4050 postscript printer.

It works well so far, but with every print job there is an additional page printed that contains the following:
Code:
User: madde
Host: nissen
Class: nissen
Job: stdin
I have now clue where that extra page is coming from and if it comes from lpr or the printer itself.

Setup was easy following the Handbook (though I'm totally new to this topic and unexperienced)
and I have setup printing via lpd.
I can print text directly via echo "some text\nand some more text" | lpr
and also printed a .pdf file from Firefox and that worked as well.

Configuration is simple and I simply followed the Handbook.
/etc/printcap
Code:
lp|hp4050:\
    :lp=:\
    :rm=hp4050:\
    :rp=auto:\
    :sh:\
    :mx#0:\
    :if=/usr/local/libexec/psif:\
    :sd=/var/spool/lpd/lp:\
    :lf=/var/log/lpd-errs:

/usr/local/libexec/psif like shown in the Handbook section 9.5.3.4

The printer has extensive menu to configure all kinds of stuff and I have configured the IP adress to use it as a network printer. I couldn't find anything in the depth of the menus (as far as I can tell) that could be responsible for that extra page.

What do the printing gurus say :D ?
I have to admit that, even if I have read all related recources prior to buying this printer like a lots of threads about printers here, the Handbook, openprinting.org but I still feel that I havn't understand everything. So I hope some learning by actually doing will help.
 
It sounds as if you have the "banner" turned on in your printing system. I thought it should be first (before the print job) but who knows. I don't know how to turn banner of in lpr (I use CUPS).
 
If the banner page comes from lpd, then you should be able to turn it off by setting the "sh" property in /etc/printcap. The man page is a little unclear; it says that "sh" is false by default, and that setting it to true suppresses the banner. That's a double negative. You have the "sh" property in your printcap, but without a value; maybe setting it with ":sh=true:" might help.

Some HP printers are also capable of having their own banner pages. I bet all the modern ones with web-based setup can. We have a HP2055 at home, so I just looked: It's in the "Networking" tab (rightmost, after "Status" and "Setting"), then under TCP/IP settings in the menu on the left, then all the way on the right in "advanced". The funny thing is that on our printer, banner is turned on, and it doesn't print a banner page. Try messing with that though, it might help.
 
Hei tingo, hei ralphbsz,
thanks for your answers.

Sadly it looks like it's not the banner. I changed sh= to sh=true in /etc/printcap and also removed that entry. No change :(
I digged through the printer's menu again like you suggested ralphbsz but
couldn't find banner options there.

I forgot to mention that that extra page comes last.
it could be some sort of page that should help to find your prints in a bunch of paper?
Does anyone use such pages to separate print jobs?

In printcap(5) I found an option called hl= (print header page last),
tried that one also with hl=true and hl=false but it didn't change.

Edit: Just fixed it kind of by calling lpr -h to supress the header and
that works. So, it was the header! Still weird that the header can't be suppressed via /etc/printcap
 
Hi,

Congratulations. I have three HP4050N printers (one in service, one spare, one broken). Had them for many years, and very happy.

However, I have just reached the point where I am about to give up my traditional BSD lpr/lpd setup, and move to cups.

The reason is that the HP4050 postscript implementation is old, and I frequently have to use ghostscript to convert modern postscript documents to level 1 format to get things to print. These can be very large files, and can take ages to print.

The cups drivers for the HP4050 seem to work quite reliably, but not fast either. So I don't expect to gain speed, but the regular need to reformat to level 1 and re-print should go away.

Also cups (very annoyingly) pollutes the lpr/lpd namespace and it's almost impossible to avoid if you install enough packages.

Cheers,
 
Actually, in office settings with shared printers they are quite useful. I've seen it set up so the printer is set up with colored paper in the 2nd bin, and the header page is a different color (sticks out in a stack of output), and tells you in really big letters who this print job is for.

I have no idea how to fix your problem, other than more trial and error. You probably have to restart lpd every time you change printcap, so this could get boring. And I hate to suggest things like replacing lpd with Cups, or making a shell alias for "lpr" to "lpr -h".
 
To suppress headers in lpr add
Code:
:sh:
suppress header

as the last line in your printcap

My /etc/printcap
Code:
# Default Network printer US letter
lp:\
    :lp=9100@Brother.home.yak:\
    :if=/usr/local/libexec/br_script:\
    :sd=/var/spool/output/lpd:\
    :lf=/var/log/lpd-errs:\
    :mx#0:\
    :sh:
# Same Network printer Duplex
duplex:\
    :lp=9100@Brother.home.yak:\
    :if=/usr/local/libexec/br_script_duplex:\
    :sd=/var/spool/output/lpd-duplex:\
    :lf=/var/log/lpd-errs:\
    :mx#0:\
    :sh:
 
However, I have just reached the point where I am about to give up my traditional BSD lpr/lpd setup, and move to cups.
Yeah true, I've also read that Open/LibreOffice and others are about to give up printing via lpr and PDF is about to become standard. I just gave CUPS a short try and noticed that in LibreOffice the default was a already set to print as PDF. I also tried to print from within Fireforx and I could choose both my printer via lpr and CUPS. Then tried to print from Qupzilla and could only print via CUPS. So, lpr is clearly fading away. That's sad because CUPS is so bloated.

Cups, or making a shell alias for "lpr" to "lpr -h".
I just noticed that in Gnumeric (which I use a lot and prefer it over Open/LibreOffice) when I choose to print via my lpr I can actually add options to the lpr command directly in the print-dialog. So just added -h and that supressed the header.

as the last line in your printcap
I moved :sh: to the end and that did the trick!

Thank you guys for your help, I am happy now :D
 
It doesn't make sense to me neither. That's why I was very surprised, too.
This is not mentioned in the Handbook or in printcap(9) and it could be a bug...? Maybe it behaves like this only with a few printers.
It's a little weird, no doubt , but it works for me. Or should I say works with my printer?
 
I just noticed that in Gnumeric (which I use a lot and prefer it over Open/LibreOffice) when I choose to print via my lpr I can actually add options to the lpr command directly in the print-dialog.

This depends on the toolkit used to compile the application. gtk2 apps support lpr; gtk3 apps do not. It was also dropped in Qt but I'm not sure at what point.

There are some legacy apps that use the motif toolkit, ie print/gv, that are handy for those who do not want to give up yet on lpr.
 
Last edited:
Looks almost like there's no way without CUPS in the future...
That's part of the "Linuxification" of the OS world. More and more FOSS is designed solely with Linux in mind. And when I say "Linux", I don't mean the standardized APIs (such as POSIX), but the whole ecosystem. The fact that the major desktop toolkits for KDE and Gnome may start relying on systemd is the extreme example of this. I don't like this, but there is little one can do about it.
 
I just noticed that in Gnumeric (which I use a lot and prefer it over Open/LibreOffice) when I choose to print via my lpr I can actually add options to the lpr command directly in the print-dialog
More on this:

One of the major advantages of the ports system in FreeBSD/OpenBSD/NetBSD are configuration options. The Makefile for libreoffice, https://svnweb.freebsd.org/ports/head/editors/libreoffice/Makefile?revision=463344&view=markup shows that it can be built with gtk2.
 
Yes, absolutely true.
I think some of those big project could become impossible to port in the future and developing on a possible fork of something like KDE or Gnome could be way to much work, too.
Well, here the Unix philosophy comes handy. Small and less bloated stuff gets the job done, too.
I don't like this, but there is little one can do about it.
No we can't. I hope medium or small size projects like XFCE or i3wm will be forked or at least remain portable.
Do you think all DEs will depend on systemd in the future when finally all Linux distros have switched to systemd?


Nice to see. I have never spend much thought about the differences between gtk2 and gtk3, but that's very interesting. Is that the main reason for gtk2 to exist? To keep legacy funktionalitiy like lpr alive?
I usually don't use ports on my desktop, but gtk2 seems worth to rethink that :)
 
Do you think all DEs will depend on systemd in the future when finally all Linux distros have switched to systemd?

Sadly, that's quite possible. With >95% of all open-source development happening on Linux, it could be that eventually the desktop environments on non-Linux platforms will get so little attention from developers that they fall apart, and will be unable to function, in particular not without systemd. Sad but true.

Getting back to printing: This whole discussion makes me think that I need to finally get an evening cleared to install and configure CUPS on my home server. Since it has no GUI running on it, printing directly on it happens very rarely; for the most part, an led server is sufficient for handling print requests coming from other machines that are scattered around the house. But occasionally you do want to print something, and that's really inconvenient: Text files are printed with the most basic font; postscript files hang the printer unless you manually add a Control-D to the end of the file, and printing a pdf file is outright impossible. For all these things, CUPS would be a solution, and it would preserve the lpd-like interface for other machines in the house to use.
 
No doubt, CUPS is convenient to use.
Sadly I have never understood the configuration and simply don't understand how to, e.g. make my normal user account (in wheel) able to do the printer configuration in the web interface.
Every time I want to change something and have to type in my root password on that normal http:// page simply doesn't feel right, even on the local machine. I think I have to read the documentation again and maybe I understand it this time, when I read it for the 10th time or so :rolleyes:
 
Back
Top