[gtk: 1/2] Allow LPR backend to print PDF and PS file formats




commit 99dfdfcd5e125f5c5ff501a8dc23353ecf90831e
Author: Sean Farley <sean+dev farley org>
Date:   Sat Nov 17 13:04:35 2018 -0500

    Allow LPR backend to print PDF and PS file formats
    
    At least from GTK v3.22.30, the code disallows attempts to print PDF and
    PS files using the LPR backend. Although it is not easy or possible for
    GTK to determine if the printer can print these formats by querying lpr,
    the print backend should allow lpr to try.
    
    There are two uses cases:
    - A filter is being used by lpr, specified in the printcap file, to process the
      files prior to printing them.
    - The printer can print PDF and PS files directly. There are many printers that
      can print these formats, so GTK should allow for the possibility.

 modules/printbackends/gtkprintbackendlpr.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/modules/printbackends/gtkprintbackendlpr.c b/modules/printbackends/gtkprintbackendlpr.c
index aefa921515..af1e101124 100644
--- a/modules/printbackends/gtkprintbackendlpr.c
+++ b/modules/printbackends/gtkprintbackendlpr.c
@@ -375,9 +375,13 @@ gtk_print_backend_lpr_init (GtkPrintBackendLpr *backend)
 {
   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", FALSE,
+                         "accepts-pdf", TRUE,
+                         "accepts-ps", TRUE,
+                         NULL);
   gtk_printer_set_has_details (printer, TRUE);
   gtk_printer_set_icon_name (printer, "printer");
   gtk_printer_set_is_active (printer, TRUE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]