The class printer is a terminal class to support direct printing to a printer. This is done via the eps terminal: a temporary eps file is created, printed to the printer, and then removed. The static printer::print() function accepts two arguments:
The default command can be set for example in $HOME/.blop/bloprc.C.
In my institute I usually have to work at different places, at
different PCs. There are many printers, and I want to send print jobs
to the nearest one. So I have put this into my ~/.blop/bloprc.C (BLOP_USER_INIT is the
function which is automatically called at program startup)
void BLOP_USER_INIT()
{
const char *hn = getenv("HOST");
if(hn == 0) { cerr<<"Could not getenv HOST, no default printer set"<<endl; }
else
{
var host = hn;
if(hn.find("machine1") != var::npos) {printer::default_command("lpr -h -Pprinter1");
else if(hn.find("machine2") != var::npos) {printer::default_command("lpr -h -Pprinter2");
...
else
{
cerr<<"Don't know where is this machine: "<<host<<endl;
cerr<<"No default printer is set"<<endl;
}
}
}
Source files: terminal.h terminal.cc