Example #1
0
        private void btnGetPDF_Click(object sender, EventArgs e)
        {
            // ConcreteBuilder
            PDFConverter converter = new PDFConverter();

            // Director
            RTFReader reader = new RTFReader(converter);

            reader.ParserRTF(File.ReadAllText(FileLocation));
            PDFText text = converter.GetPDFText();

            text.WriteToFile("PDFtest.pdf");
            MessageBox.Show("File has been saved as PDFtest.pdf");
        }
Example #2
0
        private void btnGetASCII_Click(object sender, EventArgs e)
        {
            // ConcreteBuilder
            ASCIIConverter converter = new ASCIIConverter();

            // Director
            RTFReader reader = new RTFReader(converter);

            reader.ParserRTF(File.ReadAllText(FileLocation));
            ASCIIText text = converter.GetASCIIText();

            text.WriteToFile("ASCIItest.txt");

            MessageBox.Show("File has been saved as ASCIItest.txt");
        }
Example #3
0
        private void btnGetWidget_Click(object sender, EventArgs e)
        {
            // ConcreteBuilder
            TextWidgetConverter converter = new TextWidgetConverter();

            // Director
            RTFReader reader = new RTFReader(converter);

            reader.ParserRTF(File.ReadAllText(FileLocation));
            TextWidget textWidget = converter.GetTextWidget();

            textWidget.Dock = DockStyle.Fill;
            Form frm = new Form();

            frm.Controls.Add(textWidget);
            frm.WindowState = FormWindowState.Normal;
            frm.ShowDialog();
        }