On Thu, 26 Sep 2019 at 17:58:42 +0200, Sebastien Marie wrote:
> On Thu, Sep 26, 2019 at 04:36:08PM +0200, Jan Stary wrote:
> > This is current/amd64 with firefox-68.0.2
> > 
> > Firefox does not offer any prtinters in the printing dialogue
> > except (Print to file").
> > 
> > lpd/lpr itself works fine. This is my /etc/printcap:
> > lp:lp=:rm=147.32.232.36:rp=lp:sd=/var/spool/output/lpd:lf=/var/log/lpd-errs:
> > Each of "date | lpr" and "lpr file.pdf" works.
> > 
> > I removed the entire ~/.mozilla directory fo make sure
> > it is not some of my firefox settings.
> > 
> > Is this known?
> > Is a fix known?
> > 
> >     Jan
> > 
> 
> It is a bit complex to explain, but in short: you can't use lpr with firefox.
> 
> If I recall correctly, the problem is firefox removed the support of 
> Postscript
> option, and the side effect was "Print using lpr" was removed too (it is
> declared as "postscript")
> 
> https://bugzilla.mozilla.org/show_bug.cgi?id=1322756
> https://bugzilla.mozilla.org/show_bug.cgi?id=1425188
> 
> I don't recall if it is something that should be corrected in GTK ("lpr" needs
> to be declared as accepting pdf) or in firefox.

Yeah, this makes the "Print to LPR" option show up in Firefox's 
print dialog but this seems like something that should be addressed 
upstream with Gtk if this is to be properly fixed.


Index: modules/printbackends/lpr/gtkprintbackendlpr.c
--- modules/printbackends/lpr/gtkprintbackendlpr.c.orig
+++ modules/printbackends/lpr/gtkprintbackendlpr.c
@@ -390,9 +390,12 @@ gtk_print_backend_lpr_init (GtkPrintBackendLpr *backen
 {
   GtkPrinter *printer;
 
-  printer = gtk_printer_new (_("Print to LPR"),
-                            GTK_PRINT_BACKEND (backend),
-                            TRUE); 
+  printer = g_object_new (GTK_TYPE_PRINTER,
+                          "name", _("Print to LPR"),
+                          "backend", backend,
+                          "is-virtual", TRUE,
+                          "accepts-pdf", TRUE,
+                          NULL);
   gtk_printer_set_has_details (printer, TRUE);
   gtk_printer_set_icon_name (printer, "printer");
   gtk_printer_set_is_active (printer, TRUE);

Reply via email to