# okular: cups and lpd mismatch?



## uzsolt (Sep 11, 2016)

Hi all!

I'm using the standard lpd() to print.
While the print/cups-client combined into print/cups can't use the standard `lpd` only from commandline.
When I want to print from graphics/okular it prints into stdout (or stderr):

```
lpr-cups: Bad file descriptor
```

I think it calls `/usr/local/bin/lpr` and it causes an error because the `cupsd` not running. My `PATH` is: 
	
	



```
/sbin/:/usr/sbin/:/usr/bin:/bin:/usr/local/libexec/ccache:/home/zsolt/bin:/usr/local/bin:/sbin/:/usr/sbin/:/home/zsolt/bin:/usr/local/bin
```
Note that the /usr/local/bin (directory of cups's `lpr`) is the last.

How can I print from okular?


----------



## uzsolt (Sep 11, 2016)

vigole You misunderstood me. I don't use `cupsd`, I'm using LPD.


----------



## shepper (Sep 11, 2016)

I don't know about Qt based applications but gtk3 removed LPD support in the print dialogs.  My work around is to print to a file (*ps vs *pdf).  If you have a pdf you can convert to postscript `pdf2ps`, print/ghostscript9-base, or `pdftops`, graphics/poppler-utils  The latter command renders better for me.  Another option is to open the pdf in something like graphics/xpdf and use that print dialog.


----------



## wblock@ (Sep 11, 2016)

Most current PostScript printers actually understand PDF natively.  In theory, anyway.

Does okular offer any configuration of the command it uses to print, like graphics/xpdf does?


----------



## uzsolt (Sep 12, 2016)

wblock@  I think you can't set command in Okular, see core/fileprinter.cpp.

*Edit:* I've opened an Okular-bug report about it.


----------



## uzsolt (Sep 12, 2016)

shepper said:


> I don't know about Qt based applications but gtk3 removed LPD support in the print dialogs.  My work around is to print to a file (*ps vs *pdf).  If you have a pdf you can convert to postscript `pdf2ps`, print/ghostscript9-base, or `pdftops`, graphics/poppler-utils  The latter command renders better for me.  Another option is to open the pdf in something like graphics/xpdf and use that print dialog.


And do you print from command line (using `/usr/bin/lpr generated.ps`)? I don't want this because my girlfriend uses graphics/okular and she doesn't like CLI


----------



## shepper (Sep 12, 2016)

Yes, I print from the command line or non-gtk3 applications (Firefox-esr).  The lack of direct printing to LPD is an upsteam decision for gtk3 that I found on a Redhat/Fedora mailing list.
The grandfather of okular/evince is print/gv,  it will open pdfs/postscript files and has a "print" button.
I did a quick web search and found this.  Not sure if the workaround is still an option.  If not then you may have to use cups to keep peace.


----------



## uzsolt (Sep 12, 2016)

shepper said:


> I did a quick web search and found this.


It seems it's the time when added the lpr-checking what I linked above. 



shepper said:


> Not sure if the workaround is still an option.  If not then you may have to use cups to keep peace.


I think I've two choices as you wrote: an ugly workaround (re-link /usr/local/bin/lpr-cups to /usr/bin/lpr) or use print/cups on my girlfriend's machine.


----------

