private void Button_Click(object sender, RoutedEventArgs e) { var blockFormatterFactory = new BlockFormattersFactory(); var pm = new PrintManager(); var formatter = new SimpleFlowDocumentDataFormatter(); formatter.AppendBlocks(blockFormatterFactory.Header("Simple text sample")); formatter.AppendBlocks(blockFormatterFactory.Text(textBox.Text)); var doc = new SimpleDocument(formatter); pm.PrintPreview(doc); }