]> www.fi.muni.cz Git - evince.git/commitdiff
[printing] Make evince output pdf on supported printers
authorJohan Brannlund <gnome-bugs@nullinfinity.org>
Thu, 25 Jun 2009 12:41:00 +0000 (14:41 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Thu, 25 Jun 2009 12:41:00 +0000 (14:41 +0200)
Fixes bgo#585442.

shell/ev-print-operation.c

index 1821d4f96a94a2343a363ceb6b441748ce9c1e8e..b1158871c855c313f5f4f8c5df88684b802adca2 100644 (file)
@@ -1187,8 +1187,13 @@ ev_print_operation_export_print_dialog_response_cb (GtkDialog              *dial
 
        get_first_and_last_page (export, &first_page, &last_page);
 
-       export->fc.format = file_format && g_ascii_strcasecmp (file_format, "pdf") == 0 ?
-               EV_FILE_FORMAT_PDF : EV_FILE_FORMAT_PS;
+       if (file_format) {
+               export->fc.format = g_ascii_strcasecmp (file_format, "pdf") == 0 ?
+                       EV_FILE_FORMAT_PDF : EV_FILE_FORMAT_PS;
+       } else {
+               export->fc.format = gtk_printer_accepts_pdf (printer) ?
+                       EV_FILE_FORMAT_PDF : EV_FILE_FORMAT_PS;
+       }
        export->fc.filename = export->temp_file;
        export->fc.first_page = MIN (first_page, last_page);
        export->fc.last_page = MAX (first_page, last_page);