Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2009-06-05 16:56:29 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2009-06-05 16:56:29 (GMT)
commit873b9c54bc7a5c7d8f000dca29a751d632726f5b (patch)
tree8078885da5f4a3bd4dad3438ccdf1a175ba8d8e5 /shell
parentd72a2c802a149f327c65bfcc30e47dae7eb11a3c (diff)
[printing] Scale according to paper size before rendering for printing
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-print-operation.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/shell/ev-print-operation.c b/shell/ev-print-operation.c
index 9f34fd7..e737d29 100644
--- a/shell/ev-print-operation.c
+++ b/shell/ev-print-operation.c
@@ -1546,6 +1546,8 @@ ev_print_operation_print_draw_page (EvPrintOperationPrint *print,
{
EvPrintOperation *op = EV_PRINT_OPERATION (print);
cairo_t *cr;
+ gdouble cr_width, cr_height;
+ gint width, height;
gtk_print_operation_set_defer_drawing (print->op);
@@ -1562,8 +1564,14 @@ ev_print_operation_print_draw_page (EvPrintOperationPrint *print,
ev_job_print_set_page (EV_JOB_PRINT (print->job_print), page);
cr = gtk_print_context_get_cairo_context (context);
- ev_job_print_set_cairo (EV_JOB_PRINT (print->job_print), cr);
+ cr_width = gtk_print_context_get_width (context);
+ cr_height = gtk_print_context_get_height (context);
+ ev_page_cache_get_size (ev_page_cache_get (op->document),
+ page, 0, 1.0,
+ &width, &height);
+ cairo_scale (cr, cr_width / (gdouble)width, cr_height / (gdouble)height);
+ ev_job_print_set_cairo (EV_JOB_PRINT (print->job_print), cr);
ev_job_scheduler_push_job (print->job_print, EV_JOB_PRIORITY_NONE);
}