Ejemplo n.º 1
0
        private void Open_Button_Click(object sender, EventArgs e)
        {
            String Temp;

            using (OpenFileDialog ofd = new OpenFileDialog()
            {
                Filter = "PDF files|*.pdf", ValidateNames = true, Multiselect = false
            })
            {
                if (ofd.ShowDialog() == DialogResult.OK)
                {
                    try
                    {
                        iTextSharp.text.pdf.PdfReader reader = new iTextSharp.text.pdf.PdfReader(ofd.FileName);
                        StringBuilder sb = new StringBuilder();
                        for (int i = 1; i <= reader.NumberOfPages; i++)
                        {
                            sb.Append(PdfTextExtractor.GetTextFromPage(reader, i));
                        }
                        Temp = sb.ToString();
                        ConvertTextToBraille cttb1 = new ConvertTextToBraille();
                        TextBox.Text = cttb1.Display(Temp);
                        reader.Close();
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        // -------- Code to Convert the Text to Braille ---------------
        private void TexttoBraille_Button_MouseClick(object sender, MouseEventArgs e)
        {
            String Text = input_Textbox.Text.ToString();
            ConvertTextToBraille cttb = new ConvertTextToBraille();

            OutputTextBox.Text = cttb.Display(Text);
            // input_Textbox.Text = "";
        }