[PATCH] CUPS PostScript multipage support



Hi

After not being able to print multiple pages per sheet with gpdf (and
now evince) for a long time, I've written a little patch for
libgnomeprint to implement this - at least when using the CUPS backend.
Don't know whether that's good enough for upstream but anyway, patch is
attached.

Regards,

Jürg

-- 
Jürg Billeter <j bitron ch>
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libgnomeprint/ChangeLog,v
retrieving revision 1.497
diff -p -u -r1.497 ChangeLog
--- ChangeLog	18 Feb 2005 17:43:06 -0000	1.497
+++ ChangeLog	27 Feb 2005 16:33:12 -0000
@@ -1,3 +1,8 @@
+2005-02-27  Juerg Billeter <j bitron ch>
+
+	* libgnomeprint/modules/cups/gnome-print-cups-transport.c: support
+          multipage when printing postscript files with cups
+
 2005-02-18  Jody Goldberg <jody gnome org>
 
 	http://bugzilla.gnome.org/attachment.cgi?id=36988&action=edit
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	27 Feb 2005 16:33:13 -0000
@@ -293,12 +293,24 @@ gp_transport_cups_print_file (GnomePrint
 	cups_option_t *options;
 	gint num_options;
 	char *title;
+	char *layout;
+	char *nup = NULL;
 
 	transport = GP_TRANSPORT_CUPS (gp_transport);
 
 	title = gnome_print_config_get (gp_transport->config, 
 					GNOME_PRINT_KEY_DOCUMENT_NAME);
+	layout = gnome_print_config_get (gp_transport->config, 
+					GNOME_PRINT_KEY_LAYOUT);
 	num_options = get_job_options (gp_transport->config, &options);
+	if (strcmp (layout, "2_1") == 0)
+		nup = "2";
+	else if (strcmp (layout, "4_1") == 0)
+		nup = "4";
+	if (nup != NULL) {
+		num_options = cupsAddOption ("number-up", nup, num_options,
+					     &options);
+	}
 	
 	cupsPrintFile (transport->printer, 
 		       filename, title, 
@@ -306,6 +318,7 @@ gp_transport_cups_print_file (GnomePrint
 	cupsFreeOptions (num_options, options);
 
 	g_free (title);
+	g_free (layout);
 	
 	return GNOME_PRINT_OK;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]