ooo can't find default printer even though any other app can

Jens Schweikhardt schweikh at schweikhardt.net
Sun Mar 12 17:29:10 UTC 2006


hello, world\n

I'm trying to get ooo to print to my Laserjet 2300d. The details:
openoffice.org-2.0.2.rc2 on FreeBSD 7-CURRENT as of a few days ago,
using CUPS (cups-1.1.23.0_1, cups-lpr-1.1.23.0_1,
cups-base-1.1.23.0_8, cups-pstoraster-8.15). I compiled the system
with NO_LPR=, so the system print tools are not in /usr/sbin.

Printing from the command line, from other apps like acroread or
ghostview works like a charm. So CUPS is unlikely to be the culprit.

When I want to print a spreadsheet from within ooo with File->Print...
I get a message box saying "No default printer found. Please chose
a printer and try again." Then I am presented with a dialog to chose
a printer, but the list of available printers is empty and there is
now way I know of to enter a printer name.

I've done some investigation, especially looking at the place where ooo
builds the list of available printers with lpc. It looks like this is in
source/printer/printerinfomanager.cxx, around these lines

struct SystemCommandParameters
{
    const char*     pQueueCommand;
    const char*     pPrintCommand;
    const char*     pForeToken;
    const char*     pAftToken;
    unsigned int    nForeTokenCount;
};

static const struct SystemCommandParameters aParms[] =
{
#if defined(LINUX) || defined(NETBSD) || defined(FREEBSD)
    { "/usr/sbin/lpc status", "lpr -P \"(PRINTER)\"", "", ":", 0 },
    { "lpc status", "lpr -P \"(PRINTER)\"", "", ":", 0 },
    { "LANG=C;LC_ALL=C;export LANG LC_ALL;lpstat -s", "lp -d \"(PRINTER)\"", "system for ", ": ", 1 }
    ...
#endif
};

I made /usr/sbin/lpc a symlink to CUPS' /usr/local/sbin/lpc, just in
case not all of these commands would be tested. (I assume that any
parseable output of a single command would be enough). Anyway, the
output of these three commands is

# /usr/sbin/lpc status
LaserJet_2300d:
        printer is on device 'parallel' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present
# lpc status
LaserJet_2300d:
        printer is on device 'parallel' speed -1
        queuing is enabled
        printing is enabled
        no entries
        daemon present
# LANG=C;LC_ALL=C;export LANG LC_ALL;lpstat -s
system default destination: LaserJet_2300d
device for LaserJet_2300d: parallel:/dev/lpt0


With the exception of the last entry, where CUPS prints "device for"
instead of the expected "system for", this should tell ooo that I have
a "LaserJet_2300d".

But it doesn't. I'm stumped. What is the magic incantation to make
ooo print when using CUPS?

Regards,

	Jens
-- 
Jens Schweikhardt http://www.schweikhardt.net/
SIGSIG -- signature too long (core dumped)


More information about the freebsd-openoffice mailing list