Index: gtk.symbols
===================================================================
--- gtk.symbols	(revision 21070)
+++ gtk.symbols	(working copy)
@@ -2734,6 +2734,7 @@
 gtk_print_context_get_height
 gtk_print_context_get_dpi_x
 gtk_print_context_get_dpi_y
+gtk_print_context_get_hard_margins
 gtk_print_context_get_pango_fontmap
 gtk_print_context_create_pango_context
 gtk_print_context_create_pango_layout
Index: gtkprintcontext.c
===================================================================
--- gtkprintcontext.c	(revision 21070)
+++ gtkprintcontext.c	(working copy)
@@ -44,6 +44,13 @@
   
   gdouble pixels_per_unit_x;
   gdouble pixels_per_unit_y;
+
+  gboolean has_hard_margins;
+  gdouble hard_margin_top;
+  gdouble hard_margin_bottom;
+  gdouble hard_margin_left;
+  gdouble hard_margin_right;
+
 };
 
 struct _GtkPrintContextClass
@@ -90,6 +97,7 @@
 
   context->op = op;
   context->cr = NULL;
+  context->has_hard_margins = FALSE;
   
   return context;
 }
@@ -374,6 +382,53 @@
 }
 
 /**
+ * gtk_print_context_get_hard_margins:
+ * @context: a #GtkPrintContext
+ * @top: top hardware printer margin
+ * @bottom: bottom hardware printer margin
+ * @left: left hardware printer margin
+ * @right: right hardware printer margin
+ *
+ * Obtains the hardware printer margins of the #GtkPrintContext, in units.
+ *
+ * Return value : %TRUE if the hard margins were retrieved
+ *
+ * Since: 2.14
+ */
+gboolean
+gtk_print_context_get_hard_margins (GtkPrintContext *context,gdouble* top,gdouble* bottom,gdouble* left,gdouble* right)
+{
+  if(context->has_hard_margins)
+  {
+    *top    = context->hard_margin_top / context->pixels_per_unit_y;
+    *bottom = context->hard_margin_bottom / context->pixels_per_unit_y;
+    *left   = context->hard_margin_left / context->pixels_per_unit_x;
+    *right  = context->hard_margin_right / context->pixels_per_unit_x;
+  }
+  return context->has_hard_margins;
+}
+
+/**
+ * gtk_print_context_set_hard_margins:
+ * @context: a #GtkPrintContext
+ * @top: top hardware printer margin
+ * @bottom: bottom hardware printer margin
+ * @left: left hardware printer margin
+ * @right: right hardware printer margin
+ *
+ * set the hard margins in pixel coordinates
+ */
+void
+_gtk_print_context_set_hard_margins (GtkPrintContext *context,gdouble top,gdouble bottom,gdouble left,gdouble right)
+{
+  context->hard_margin_top    = top;
+  context->hard_margin_bottom = bottom;
+  context->hard_margin_left   = left;
+  context->hard_margin_right  = right;
+  context->has_hard_margins   = TRUE;
+}
+
+/**
  * gtk_print_context_get_pango_fontmap:
  * @context: a #GtkPrintContext
  *
Index: gtkprintcontext.h
===================================================================
--- gtkprintcontext.h	(revision 21070)
+++ gtkprintcontext.h	(working copy)
@@ -48,6 +48,8 @@
 gdouble       gtk_print_context_get_height           (GtkPrintContext *context);
 gdouble       gtk_print_context_get_dpi_x            (GtkPrintContext *context);
 gdouble       gtk_print_context_get_dpi_y            (GtkPrintContext *context);
+gboolean      gtk_print_context_get_hard_margins     (GtkPrintContext *context,
+			         gdouble* top,gdouble* bottom,gdouble* left,gdouble* right);
 
 /* Fonts */
 PangoFontMap *gtk_print_context_get_pango_fontmap    (GtkPrintContext *context);
Index: gtkprintoperation-private.h
===================================================================
--- gtkprintoperation-private.h	(revision 21070)
+++ gtkprintoperation-private.h	(working copy)
@@ -122,6 +122,8 @@
 								     GtkPageSetup      *page_setup);
 void             _gtk_print_context_translate_into_margin           (GtkPrintContext   *context);
 void             _gtk_print_context_rotate_according_to_orientation (GtkPrintContext   *context);
+void             _gtk_print_context_set_hard_margins                (GtkPrintContext *context,
+							              gdouble top,gdouble bottom,gdouble left,gdouble right);
 
 G_END_DECLS
 
Index: gtkprintoperation-win32.c
===================================================================
--- gtkprintoperation-win32.c	(revision 21070)
+++ gtkprintoperation-win32.c	(working copy)
@@ -1487,6 +1487,7 @@
   HDC hDC = NULL;
   const char *printer = NULL;
   double dpi_x, dpi_y;
+  double hard_top, hard_bottom, hard_left, hard_right;
   int job_id;
   cairo_t *cr;
   DEVNAMES *pdn;
@@ -1555,6 +1556,11 @@
   op_win32->surface = cairo_win32_printing_surface_create (hDC);
   dpi_x = (double) GetDeviceCaps (hDC, LOGPIXELSX);
   dpi_y = (double) GetDeviceCaps (hDC, LOGPIXELSY);
+  hard_top    = (double)::GetDeviceCaps(hDC,PHYSICALOFFSETY);
+  hard_bottom = (double)::GetDeviceCaps(hDC,PHYSICALHEIGHT)-hard_top*2.0;
+  hard_left   = (double)::GetDeviceCaps(hDC,PHYSICALOFFSETX);
+  hard_right  = (double)::GetDeviceCaps(hDC,PHYSICALWIDTH)-hard_left*2.0;
+  _gtk_print_context_set_hard_margins(priv->print_context,hard_top,hard_bottom,hard_left,hard_right);
 
   cr = cairo_create (op_win32->surface);
   gtk_print_context_set_cairo_context (priv->print_context, cr, dpi_x, dpi_y);
@@ -1764,6 +1770,7 @@
       DOCINFOW docinfo;
       int job_id;
       double dpi_x, dpi_y;
+      double hard_top, hard_bottom, hard_left, hard_right;
       cairo_t *cr;
       GtkPageSetup *page_setup;
 
@@ -1776,8 +1783,13 @@
 
       op_win32->surface = cairo_win32_printing_surface_create (printdlgex->hDC);
 
-      dpi_x = (double)GetDeviceCaps (printdlgex->hDC, LOGPIXELSX);
-      dpi_y = (double)GetDeviceCaps (printdlgex->hDC, LOGPIXELSY);
+      dpi_x       = (double)GetDeviceCaps (printdlgex->hDC, LOGPIXELSX);
+      dpi_y       = (double)GetDeviceCaps (printdlgex->hDC, LOGPIXELSY);
+      hard_top    = (double)::GetDeviceCaps(printdlgex->hDC,PHYSICALOFFSETY);
+      hard_bottom = (double)::GetDeviceCaps(printdlgex->hDC,PHYSICALHEIGHT)-hard_top*2.0;
+      hard_left   = (double)::GetDeviceCaps(printdlgex->hDC,PHYSICALOFFSETX);
+      hard_right  = (double)::GetDeviceCaps(printdlgex->hDC,PHYSICALWIDTH)-hard_left*2.0;
+      _gtk_print_context_set_hard_margins(priv->print_context,hard_top,hard_bottom,hard_left,hard_right);
 
       cr = cairo_create (op_win32->surface);
       gtk_print_context_set_cairo_context (priv->print_context, cr, dpi_x, dpi_y);
