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.
This commit is contained in:
Sean Farley 2018-11-17 13:04:35 -05:00
parent 55faaf1aa1
commit 99dfdfcd5e

View File

@ -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);