summaryrefslogtreecommitdiff
path: root/gtk/gtkprintoperation-unix.c
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2009-11-21 21:10:36 +1030
committerCarlos Garcia Campos <carlosgc@gnome.org>2009-12-05 13:50:34 +0100
commit7c5e1cb7037fc9e824c044547d2a664fb800bb1f (patch)
tree03fc33ac79d3812287695014d604413fbe260c58 /gtk/gtkprintoperation-unix.c
parent05bb47cc3edea993d99eff5e03fb17efd4f11508 (diff)
downloadgtk+-7c5e1cb7037fc9e824c044547d2a664fb800bb1f.tar.gz
Set hard margins to 0 when printing n-up on unix printers
Diffstat (limited to 'gtk/gtkprintoperation-unix.c')
-rw-r--r--gtk/gtkprintoperation-unix.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gtk/gtkprintoperation-unix.c b/gtk/gtkprintoperation-unix.c
index 5940600b76..fb3b51adc0 100644
--- a/gtk/gtkprintoperation-unix.c
+++ b/gtk/gtkprintoperation-unix.c
@@ -545,8 +545,19 @@ finish_print (PrintResponseData *rdata,
gtk_print_operation_set_print_settings (op, settings);
priv->print_context = _gtk_print_context_new (op);
- if (gtk_printer_get_hard_margins (printer, &top, &bottom, &left, &right))
- _gtk_print_context_set_hard_margins (priv->print_context, top, bottom, left, right);
+ if (gtk_print_settings_get_number_up (settings) < 2)
+ {
+ if (gtk_printer_get_hard_margins (printer, &top, &bottom, &left, &right))
+ _gtk_print_context_set_hard_margins (priv->print_context, top, bottom, left, right);
+ }
+ else
+ {
+ /* Pages do not have any unprintable area when printing n-up as each page on the
+ * sheet has been scaled down and translated to a position within the printable
+ * area of the sheet.
+ */
+ _gtk_print_context_set_hard_margins (priv->print_context, 0, 0, 0, 0);
+ }
if (page_setup != NULL &&
(gtk_print_operation_get_default_page_setup (op) == NULL ||