protected override bool OnPreview(PrintOperationPreview preview, PrintContext context, Window parent) { previewSurface = new ImageSurface(Format.ARGB32, previewPageWidth, previewPageHeight); context.SetCairoContext(new Context(previewSurface), previewDpiX, previewDpiY); ErrorHandling.LogError(string.Format("Starting preview with page size: {0}x{1}, Dpi: {2}x{3}, Orientation: {4}", previewPageWidth, previewPageHeight, previewDpiX, previewDpiY, context.PageSetup.Orientation), ErrorSeverity.Information); return(true); }