Example #1
0
        private void buttonprinttest_Click(object sender, RoutedEventArgs e)
        {
            bool vu = false;

            try
            {
                vugraph = NowyTrening();
                vu      = true;
            }
            catch
            {
                MessageBox.Show("cos zle z plikiem z vugraphu");
            }
//
            if (vu)
            {
                PrinterVu print    = new PrinterVu(vugraph);
                Document  document = print.CreateTreningDOC();

                Microsoft.Win32.SaveFileDialog dialog = new Microsoft.Win32.SaveFileDialog();
                dialog.FileName = vugraph.tytul;
                dialog.Filter   = "doc|.doc";
                dialog.ShowDialog();


                string nazwa_pliku = dialog.FileName;


                RtfDocumentRenderer renderer = new RtfDocumentRenderer();
                renderer.Render(document, nazwa_pliku, null);
                Process.Start(nazwa_pliku);
            }
        }
Example #2
0
        void PrintTrening()
        {
            PrinterVu print = new PrinterVu(vugraph);

            print.CreateTreningDOC();
        }