]> www.fi.muni.cz Git - evince.git/commitdiff
Send print job to printer with some settings set to default values, since
authorCarlos Garcia Campos <carlosgc@gnome.org>
Tue, 9 Jan 2007 18:51:06 +0000 (18:51 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Tue, 9 Jan 2007 18:51:06 +0000 (18:51 +0000)
2007-01-09  Carlos Garcia Campos  <carlosgc@gnome.org>
* shell/ev-window.c: (ev_window_print_send):
Send print job to printer with some settings set to default values,
since we have already exported to a file according to such settings
and they could be taken twice by some printers.

svn path=/trunk/; revision=2204

ChangeLog
shell/ev-window.c

index ecd6086dd56adfa2f9a3ce026a9df22215d60efc..68699b211102d2e200adcbbe29d122b137364344 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-01-09  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-window.c: (ev_window_print_send):
+
+       Send print job to printer with some settings set to default values,
+       since we have already exported to a file according to such settings
+       and they could be taken twice by some printers. 
+
 2007-01-09  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * shell/ev-jobs.c: (ev_job_xfer_run):
index 0bba71dea002a2017c866235da55634c3d96ea57..ffbc1f0c9c6d38509333ad81ca7b1fd1a527460f 100644 (file)
@@ -1710,15 +1710,33 @@ ev_window_print_send (EvWindow    *window,
                      const gchar *filename)
 {
        GtkPrintJob *job;
+       GtkPrintSettings *settings;
        GError      *error = NULL;
        
        if (window->priv->gtk_print_job)
                g_object_unref (window->priv->gtk_print_job);
+
+       /* Some printers take into account some print settings,
+        * and others don't. However we have exported the document
+        * to a ps or pdf file according to such print settings. So,
+        * we want to send the exported file to printer with those
+        * settings set to default values. 
+        */
+       settings = gtk_print_settings_copy (window->priv->print_settings);
+       gtk_print_settings_set_n_copies (settings, 1);
+       gtk_print_settings_set_page_ranges (settings, NULL, 0);
+       gtk_print_settings_set_page_set (settings, GTK_PAGE_SET_ALL);
+       gtk_print_settings_set_print_pages (settings, GTK_PRINT_PAGES_ALL);
+       gtk_print_settings_set_scale (settings, 1.0);
+       gtk_print_settings_set_collate (settings, FALSE);
+       gtk_print_settings_set_reverse (settings, FALSE);
        
        job = gtk_print_job_new ("evince-print",
                                 window->priv->printer,
-                                window->priv->print_settings,
+                                settings,
                                 window->priv->print_page_setup);
+
+       g_object_unref (settings);
        
        window->priv->gtk_print_job = job;