diff --git a/gtk/gtkprintcontext.c b/gtk/gtkprintcontext.c
index cdf04d7..68073a9 100644
--- a/gtk/gtkprintcontext.c
+++ b/gtk/gtkprintcontext.c
@@ -163,7 +163,6 @@ gtk_print_context_set_cairo_context (GtkPrintContext *context,
 	       context->pixels_per_unit_y);
 }
 
-
 void
 _gtk_print_context_rotate_according_to_orientation (GtkPrintContext *context)
 {
@@ -212,6 +211,36 @@ _gtk_print_context_rotate_according_to_orientation (GtkPrintContext *context)
 }
 
 void
+_gtk_print_context_reverse_according_to_orientation (GtkPrintContext *context)
+{
+  cairo_t *cr = context->cr;
+  cairo_matrix_t matrix;
+  gdouble width, height;
+
+  width = gtk_page_setup_get_paper_width (context->page_setup, GTK_UNIT_INCH);
+  width = width * context->surface_dpi_x / context->pixels_per_unit_x;
+  height = gtk_page_setup_get_paper_height (context->page_setup, GTK_UNIT_INCH);
+  height = height * context->surface_dpi_y / context->pixels_per_unit_y;
+
+  switch (gtk_page_setup_get_orientation (context->page_setup))
+    {
+    default:
+    case GTK_PAGE_ORIENTATION_PORTRAIT:
+    case GTK_PAGE_ORIENTATION_LANDSCAPE:
+      break;
+    case GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT:
+    case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE:
+      cairo_translate (cr, width, height);
+      cairo_matrix_init (&matrix,
+			 -1,  0,
+			  0, -1,
+			  0,  0);
+      cairo_transform (cr, &matrix);
+      break;
+    }
+}
+
+void
 _gtk_print_context_translate_into_margin (GtkPrintContext *context)
 {
   GtkPrintOperationPrivate *priv;
diff --git a/gtk/gtkprintoperation-private.h b/gtk/gtkprintoperation-private.h
index c1f047c..7f2a63d 100644
--- a/gtk/gtkprintoperation-private.h
+++ b/gtk/gtkprintoperation-private.h
@@ -145,7 +145,7 @@ void             _gtk_print_context_set_hard_margins                (GtkPrintCon
 								     gdouble            bottom,
 								     gdouble            left,
 								     gdouble            right);
-
+void             _gtk_print_context_reverse_according_to_orientation (GtkPrintContext *context);
 G_END_DECLS
 
 #endif /* __GTK_PRINT_OPERATION_PRIVATE_H__ */
diff --git a/gtk/gtkprintoperation-unix.c b/gtk/gtkprintoperation-unix.c
index dbf6228..96df380 100644
--- a/gtk/gtkprintoperation-unix.c
+++ b/gtk/gtkprintoperation-unix.c
@@ -108,7 +108,9 @@ unix_start_page (GtkPrintOperation *op,
          }
       else if (type == CAIRO_SURFACE_TYPE_PDF)
         {
-          cairo_pdf_surface_set_size (op_unix->surface, w, h);
+	    w = gtk_page_setup_get_paper_width (page_setup, GTK_UNIT_POINTS);
+	    h = gtk_page_setup_get_paper_height (page_setup, GTK_UNIT_POINTS);
+	    cairo_pdf_surface_set_size (op_unix->surface, w, h);
         }
     }
 }
@@ -846,12 +848,10 @@ _gtk_print_operation_platform_backend_resize_preview_surface (GtkPrintOperation
 							      GtkPageSetup      *page_setup,
 							      cairo_surface_t   *surface)
 {
-  GtkPaperSize *paper_size;
   gdouble w, h;
   
-  paper_size = gtk_page_setup_get_paper_size (page_setup);
-  w = gtk_paper_size_get_width (paper_size, GTK_UNIT_POINTS);
-  h = gtk_paper_size_get_height (paper_size, GTK_UNIT_POINTS);
+  w = gtk_page_setup_get_paper_width (page_setup, GTK_UNIT_POINTS);
+  h = gtk_page_setup_get_paper_height (page_setup, GTK_UNIT_POINTS);
   cairo_pdf_surface_set_size (surface, w, h);
 }
 
diff --git a/gtk/gtkprintoperation.c b/gtk/gtkprintoperation.c
index b6a77b4..89307f5 100644
--- a/gtk/gtkprintoperation.c
+++ b/gtk/gtkprintoperation.c
@@ -1960,14 +1960,11 @@ pdf_start_page (GtkPrintOperation *op,
 		GtkPrintContext   *print_context,
 		GtkPageSetup      *page_setup)
 {
-  GtkPaperSize *paper_size;
   cairo_surface_t *surface = op->priv->platform_data;
   gdouble w, h;
 
-  paper_size = gtk_page_setup_get_paper_size (page_setup);
-
-  w = gtk_paper_size_get_width (paper_size, GTK_UNIT_POINTS);
-  h = gtk_paper_size_get_height (paper_size, GTK_UNIT_POINTS);
+  w = gtk_page_setup_get_paper_width (page_setup, GTK_UNIT_POINTS);
+  h = gtk_page_setup_get_paper_height (page_setup, GTK_UNIT_POINTS);
   
   cairo_pdf_surface_set_size (surface, w, h);
 }
@@ -2056,7 +2053,7 @@ run_pdf (GtkPrintOperation  *op,
   priv->manual_reverse = FALSE;
   priv->manual_page_set = GTK_PAGE_SET_ALL;
   priv->manual_scale = 1.0;
-  priv->manual_orientation = TRUE;
+  priv->manual_orientation = FALSE;
   priv->manual_number_up = 1;
   priv->manual_number_up_layout = GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM;
   
@@ -2400,6 +2397,8 @@ common_render_page (GtkPrintOperation *op,
   
   if (priv->manual_orientation)
     _gtk_print_context_rotate_according_to_orientation (print_context);
+  else
+    _gtk_print_context_reverse_according_to_orientation (print_context);
 
   if (priv->manual_number_up > 1)
     {
@@ -2938,7 +2937,7 @@ print_pages (GtkPrintOperation       *op,
       priv->manual_reverse = gtk_print_settings_get_reverse (priv->print_settings);
       priv->manual_page_set = gtk_print_settings_get_page_set (priv->print_settings);
       priv->manual_scale = gtk_print_settings_get_scale (priv->print_settings) / 100.0;
-      priv->manual_orientation = TRUE;
+      priv->manual_orientation = FALSE;
       priv->manual_number_up = gtk_print_settings_get_number_up (priv->print_settings);
       priv->manual_number_up_layout = gtk_print_settings_get_number_up_layout (priv->print_settings);
     }
diff --git a/modules/printbackends/file/gtkprintbackendfile.c b/modules/printbackends/file/gtkprintbackendfile.c
index 2d86bd5..05f0660 100644
--- a/modules/printbackends/file/gtkprintbackendfile.c
+++ b/modules/printbackends/file/gtkprintbackendfile.c
@@ -1,4 +1,4 @@
-/* GTK - The GIMP Toolkit
+﻿/* GTK - The GIMP Toolkit
  * gtkprintbackendfile.c: Default implementation of GtkPrintBackend 
  * for printing to a file
  * Copyright (C) 2003, Red Hat, Inc.
@@ -698,6 +698,7 @@ file_printer_prepare_for_print (GtkPrinter       *printer,
 				GtkPageSetup     *page_setup)
 {
   gdouble scale;
+  OutputFormat format;
 
   print_job->print_pages = gtk_print_settings_get_print_pages (settings);
   print_job->page_ranges = NULL;
@@ -719,7 +720,18 @@ file_printer_prepare_for_print (GtkPrinter       *printer,
     print_job->scale = scale/100.0;
 
   print_job->page_set = gtk_print_settings_get_page_set (settings);
-  print_job->rotate_to_orientation = TRUE;
+
+  format = format_from_settings (settings);
+  switch (format)
+    {
+      case FORMAT_PDF:
+        print_job->rotate_to_orientation = FALSE;
+        break;
+      case FORMAT_PS:
+      case FORMAT_SVG:
+        print_job->rotate_to_orientation = TRUE;
+        break;
+    }
 }
 
 static GList *
