From 8dd1b52c6b151c1c805714d67fb9aa8aa4185619 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sat, 22 Mar 2008 15:22:04 +0000 Subject: [PATCH] Fix printing in documents with rotated pages. Patch by Eugen Dedu. Fixes 2008-03-22 Carlos Garcia Campos * backend/pdf/ev-poppler.cc: (pdf_document_file_exporter_do_page): Fix printing in documents with rotated pages. Patch by Eugen Dedu. Fixes bug #512648. svn path=/trunk/; revision=2975 --- ChangeLog | 7 +++++++ backend/pdf/ev-poppler.cc | 6 ++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d5d1a13b..57a15de3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-03-22 Carlos Garcia Campos + + * backend/pdf/ev-poppler.cc: (pdf_document_file_exporter_do_page): + + Fix printing in documents with rotated pages. Patch by Eugen + Dedu. Fixes bug #512648. + 2008-03-19 Carlos Garcia Campos * backend/pdf/ev-poppler.cc: (ev_link_dest_from_dest), diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc index 72c54c24..c11d2120 100644 --- a/backend/pdf/ev-poppler.cc +++ b/backend/pdf/ev-poppler.cc @@ -1713,7 +1713,7 @@ pdf_document_file_exporter_do_page (EvFileExporter *exporter, #ifdef HAVE_CAIRO_PRINT gdouble page_width, page_height; gint x, y; - gboolean rotate, landscape; + gboolean rotate; gdouble width, height; gdouble pwidth, pheight; gdouble xscale, yscale; @@ -1734,8 +1734,6 @@ pdf_document_file_exporter_do_page (EvFileExporter *exporter, rotate = FALSE; } - landscape = (ctx->paper_width > ctx->paper_height); - /* Use always portrait mode and rotate when necessary */ if (ctx->paper_width > ctx->paper_height) { width = ctx->paper_height; @@ -1787,7 +1785,7 @@ pdf_document_file_exporter_do_page (EvFileExporter *exporter, if (rotate) { cairo_matrix_t matrix; - cairo_translate (ctx->cr, width, 0); + cairo_translate (ctx->cr, (2 * y + 1) * pwidth, 0); cairo_matrix_init (&matrix, 0, 1, -1, 0, -- 2.43.5