Index: src/extension/internal/cairo-render-context.cpp =================================================================== --- src/extension/internal/cairo-render-context.cpp (revision 21206) +++ src/extension/internal/cairo-render-context.cpp (working copy) @@ -780,20 +780,20 @@ } bool -CairoRenderContext::setSurfaceTarget(cairo_surface_t *surface, bool is_vector) +CairoRenderContext::setSurfaceTarget(cairo_surface_t *surface, bool is_vector, cairo_matrix_t *ctm) { if (_is_valid || !surface) return false; _vector_based_target = is_vector; - bool ret = _finishSurfaceSetup (surface); + bool ret = _finishSurfaceSetup (surface, ctm); if (ret) cairo_surface_reference (surface); return ret; } bool -CairoRenderContext::_finishSurfaceSetup(cairo_surface_t *surface) +CairoRenderContext::_finishSurfaceSetup(cairo_surface_t *surface, cairo_matrix_t *ctm) { if(surface == NULL) { return FALSE; @@ -803,6 +803,8 @@ } _cr = cairo_create(surface); + if (ctm) + cairo_set_matrix(_cr, ctm); _surface = surface; if (_vector_based_target) { Index: src/extension/internal/cairo-render-context.h =================================================================== --- src/extension/internal/cairo-render-context.h (revision 21206) +++ src/extension/internal/cairo-render-context.h (working copy) @@ -85,7 +85,7 @@ bool setPdfTarget(gchar const *utf8_fn); bool setPsTarget(gchar const *utf8_fn); /** Set the cairo_surface_t from an external source */ - bool setSurfaceTarget(cairo_surface_t *surface, bool is_vector); + bool setSurfaceTarget(cairo_surface_t *surface, bool is_vector, cairo_matrix_t *ctm=NULL); void setPSLevel(unsigned int level); void setEPS(bool eps); @@ -187,7 +187,7 @@ unsigned int _showGlyphs(cairo_t *cr, PangoFont *font, std::vector const &glyphtext, bool is_stroke); - bool _finishSurfaceSetup(cairo_surface_t *surface); + bool _finishSurfaceSetup(cairo_surface_t *surface, cairo_matrix_t *ctm = NULL); void _setFillStyle(SPStyle const *style, NRRect const *pbox); void _setStrokeStyle(SPStyle const *style, NRRect const *pbox); Index: src/ui/dialog/print.cpp =================================================================== --- src/ui/dialog/print.cpp (revision 21206) +++ src/ui/dialog/print.cpp (working copy) @@ -167,7 +167,10 @@ } #endif - bool ret = ctx->setSurfaceTarget (surface, true); if (ret) { + cairo_matrix_t ctm; + cairo_get_matrix(cr, &ctm); + bool ret = ctx->setSurfaceTarget (surface, true, &ctm); + if (ret) { ret = renderer.setupDocument (ctx, junk->_doc, TRUE, NULL); if (ret) { renderer.renderItem(ctx, junk->_base);