Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libgnomeprint/ChangeLog,v
retrieving revision 1.531
diff -p -u -r1.531 ChangeLog
--- ChangeLog	1 Apr 2005 08:37:35 -0000	1.531
+++ ChangeLog	7 May 2005 23:47:40 -0000
@@ -1,3 +1,9 @@
+2005-05-08  Juerg Billeter <j@bitron.ch>
+
+	* libgnomeprint/modules/cups/gnome-print-cups-transport.c:
+	(gp_transport_cups_print_file): When using input file, add options
+	normally processed while generating postscript file.
+
 2005-04-01  Adi Attar  <aattar@cvs.gnome.org>
 
 	* configure.in: Added "xh" to ALL_LINGUAS.
Index: libgnomeprint/modules/cups/gnome-print-cups-transport.c
===================================================================
RCS file: /cvs/gnome/libgnomeprint/libgnomeprint/modules/cups/gnome-print-cups-transport.c,v
retrieving revision 1.12
diff -p -u -r1.12 gnome-print-cups-transport.c
--- libgnomeprint/modules/cups/gnome-print-cups-transport.c	3 Dec 2004 15:37:33 -0000	1.12
+++ libgnomeprint/modules/cups/gnome-print-cups-transport.c	7 May 2005 23:47:41 -0000
@@ -292,14 +292,51 @@ gp_transport_cups_print_file (GnomePrint
 	GPTransportCups *transport;
 	cups_option_t *options;
 	gint num_options;
-	char *title;
+	gboolean duplex, tumble;
+	char *title, *value, *nup = NULL;
 
 	transport = GP_TRANSPORT_CUPS (gp_transport);
 
 	title = gnome_print_config_get (gp_transport->config, 
 					GNOME_PRINT_KEY_DOCUMENT_NAME);
 	num_options = get_job_options (gp_transport->config, &options);
+
+
+	/* add options normally processed while generating postscript file */
+
+	/* number of copies */
+	value = gnome_print_config_get (gp_transport->config, 
+					GNOME_PRINT_KEY_NUM_COPIES);
+	num_options = cupsAddOption ("copies", value, num_options, &options);
+	g_free (value);
+
+	/* duplex and tumble */
+	gnome_print_config_get_boolean (gp_transport->config, 
+					GNOME_PRINT_KEY_DUPLEX, &duplex);
+	gnome_print_config_get_boolean (gp_transport->config, 
+					GNOME_PRINT_KEY_TUMBLE, &tumble);
+	if (!duplex)
+		value = "one-sided";
+	else if (!tumble)
+		value = "two-sided-long-edge";
+	else
+		value = "two-sided-short-edge";
+	num_options = cupsAddOption ("sides", value, num_options, &options);
+
+	/* 2 pages to 1 and 4 pages to 1 */
+	value = gnome_print_config_get (gp_transport->config, 
+					GNOME_PRINT_KEY_LAYOUT);
+	if (strcmp (value, "2_1") == 0)
+		nup = "2";
+	else if (strcmp (value, "4_1") == 0)
+		nup = "4";
+	g_free (value);
+	if (nup != NULL) {
+		num_options = cupsAddOption ("number-up", nup, num_options,
+					     &options);
+	}
 	
+
 	cupsPrintFile (transport->printer, 
 		       filename, title, 
 		       num_options, options);
