# No 'Print to LPR' in Firefox print dialog



## sgunn (May 11, 2018)

At some point after upgrading Firefox I noticed that the print dialog no longer has a 'Print to LPR' option, only 'Print to File'.  If I go back to firefox-esr, the 'Print to LPR' option is present.  I originally noticed this running FreeBSD10.4, then I upgraded to 11.1 and I still see the issue.  I'm using lpd, not cups, if it's relevant.  I've searched but haven't found anything that would explain what I'm seeing.  Anybody have any ideas?


----------



## sgunn (May 11, 2018)

Sorry, posted to wrong forum.  Will repost in the right place


----------



## SirDice (May 11, 2018)

Please don't post things multiple times. If it's in the wrong place a mod will move it. No need to post the same thing multiple times.


----------



## sgunn (May 11, 2018)

Is this really a peripherals issue?


----------



## MarcoB (May 12, 2018)

My guess is that lpr support is removed in GTK3. Firefox-ESR still has GTK2 support and this supports lpr. In GTK3 you need to use CUPS. Same thing with Qt4 > Qt5. I'm not happy with this development either.


----------



## sgunn (May 12, 2018)

Marco, thanks for your reply.  Based on some very old Linux threads that I saw where bugs in GTK caused similar issues, I think you are most likely correct.  I have never had much luck with CUPS.  This basically means that native LPD is kind of useless.  So is the only option to use CUPS?


----------



## sgunn (May 12, 2018)

Hmmm, you are supposed to be able to configure the gtk3.0 printing backends in  ~/.config/gtk-3.0/settings.ini by adding a comma separated list of the backends you want 
	
	



```
gtk-print-backends="file, cups, pdf, lpr"
```
 but if I put anything at all in there, I don't even get print to file.


----------



## sgunn (May 12, 2018)

My guess is that gtk3-_print_-_backends_ is not included.  I don't see it in ports.  This seems like an "installation of ports and packages" issue, not a peripheral hardware issue.


----------



## sgunn (May 12, 2018)

If I run 'strings' on libgtk3.0 and grep, gtk-print-backends does show up.


----------



## sgunn (May 12, 2018)

In usr/local/lib/gtk-3.0/3.0.0/printbackends, there are libprintbackend-cups.so libprintbackend-file.so & libprintbackend-lpr.so

So it looks like it's there, so why can't I configure it?


----------



## shepper (May 12, 2018)

sgunn said:


> So is the only option to use CUPS?


In addition to using firefox-esr, you can print to pdf/postscript file and then use print/gv or the command line to print the file.  Currently, graphics/xpdf will also bring an lpr compliant print dialog.  The latest xpdf version, not yet in FreeBSD, moved from the motif toolkit to Qt5


----------



## BSDAppentic3 (May 12, 2018)

Do yo know the Ocamm's Razor?
https://en.wikipedia.org/wiki/Occam's_razor


----------



## BSDAppentic3 (May 12, 2018)

I'll go to my point: try to do the simplest.
Which version are you using?
Do 
	
	



```
firefox --version
```
And check that you have  Mozilla Firefox 59.0.2 
My next solution, I don't want to post it...because even I don't have idea of how you upgraded the system. Perhaps firefox isn't in its latest version.


----------



## VladiBG (May 12, 2018)

side question: how much memory Firefox consume without any open tabs? Sum all Firefox processes when you start the program without opening any tab.


----------



## PMc (May 12, 2018)

MarcoB said:


> My guess is that lpr support is removed in GTK3. Firefox-ESR still has GTK2 support and this supports lpr. In GTK3 you need to use CUPS. Same thing with Qt4 > Qt5. I'm not happy with this development either.



Thanks for the bad news. :/

I used to have a scheme, to use qt4 for vlc, and -as You say- gtk2 for firefox, because otherwise I cannot avoid having it pulling in the dbus stuff. And I dont want dbus, neither cups, neiter gconf2.
At this year's portbuild, it looked like this is hardly possible anymore. 
Therefore, I am currently reluctant to install the freshly built ports, as there seems to be trouble ahead.

Concerning the topic: I had to cope with cups once on a laptop, and I found it somehow possible to get cups properly feeding jobs to my distributed lpd installation, so that cups becomes what it ought to be: just another superfluous in-between.
Another idea: the firefox used to have lots of printer configuration stuff in it's about:config page. It might be possible that the lpd drivers are still there, only not configured. But thats just an idea, for now.


----------



## MarcoB (May 12, 2018)

Eventually I try to use Qt5 and keep Gnome related stuff out as much as possible, GTK2 and Qt4 are getting really old and will be deprecated soon anyway. Qt5 stuff takes more time to build but doesn't have unnecessary dependencies like GTK/Gnome.

Only thing that I can't get rid of is Dbus, and the only application with GTK3 I use is Firefox. Printing with lpr is something I miss a little bit, but my solution is just to print to file/pdf and send it to my printer with Xpdf3.


----------



## robroy (May 12, 2018)

sgunn, I made the same observation recently but figured I was just losing my mind (well, that could still be true).

The work wblock@ did in the Handbook is so nice, that I completely forgot about CUPS (which always seemed to me like way too much "monkey motion" to sign up for, just to get out of buying a slightly more expensive Postscript printer--though I'll bet that even economically, I've come out way ahead with my LaserJet 1320n relative to any ink-jet, since it's had _zero problems_ _in over ten years_).

Yeah, and it just so happens that Firefox is one of the few programs I sometimes print from.


----------



## sgunn (May 12, 2018)

From everything I read, it does seem like you should be able to modify the gtk3 settings.ini to tell gtk to show lpr, *and* the FreeBSD gtk3 library does seem to include the lpr-backend, *and *Firefox behavior does _change_ when you change the print backend settings for gtk.  It just doesn't work.  This isn't just an issue for Firefox, it's an issue for any application that uses gtk3.0 if you're using lpd.

I'm using Firefox 60.0 if it matters.

Robroy - I hadn't seen the updated lpd page in the handbook, he really did do a nice job.  It contains much of the information that I painfully figured out many moons ago.


----------



## sgunn (May 13, 2018)

I sent email to the port maintainer, and he was kind enough to respond and he looked up that there was an upstream change to Firefox to remove 'Print to LPR'.  He sent me the patches, and when I get a chance, probably tomorrow, I'll try to build Firefox to confirm.


----------



## sgunn (May 15, 2018)

Built Firefox with the patch provided by Jan to revert the change made upstream, and doing so confirms that the upstream change is the issue.  The version I built has 'Print to LPR'

https://bugzilla.mozilla.org/show_bug.cgi?id=1425188
https://bugzilla.mozilla.org/show_bug.cgi?id=1322653

Note that this doesn't provide a solution to the issue, it only proves that an upstream change is responsible.


----------



## Patrick Powell (Aug 25, 2018)

sgunn said:


> I sent email to the port maintainer, and he was kind enough to respond and he looked up that there was an upstream change to Firefox to remove 'Print to LPR'.  He sent me the patches, and when I get a chance, probably tomorrow, I'll try to build Firefox to confirm.



Do you have a set of patches which restores the 'print to lpr' functionality?


----------



## cpm@ (Aug 25, 2018)

Patrick Powell said:


> Do you have a set of patches which restores the 'print to lpr' functionality?



The patch you are looking for is attached to the following message:

https://lists.freebsd.org/pipermail/freebsd-gecko/2018-May/008327.html


----------

