+ (guchar *)GNOME_PRINT_KEY_DUPLEX, &job->fc.duplex);
+
+ page_cache = ev_page_cache_get (job->document);
+
+ /* get the printing ranges */
+ switch (gnome_print_dialog_get_range (dialog)) {
+ case GNOME_PRINT_RANGE_ALL:
+ first_page = 0;
+ last_page = ev_page_cache_get_n_pages (page_cache) - 1;
+ break;
+ case GNOME_PRINT_RANGE_RANGE:
+ gnome_print_dialog_get_range_page (dialog, &first_page, &last_page);
+ /* convert 1-based user interface to 0-based internal numbers */
+ first_page--;
+ last_page--;
+ break;
+ default:
+ g_assert_not_reached ();
+ }
+
+ job->fc.first_page = MIN (first_page, last_page);
+ job->fc.last_page = MAX (first_page, last_page);
+