OCR SCAN PART PDF DOCUMENT AND WRITE VALUE IN TEXTBOX C#

  • 312 Views
  • Last Post 22 July 2019
Stylus STYLUS posted this 02 July 2019

Some help?   Some recommendation?   I try this but this is for all page  

private void Button1_Click(object sender, EventArgs e)
        {
            using (OpenFileDialog ofd = new OpenFileDialog() { Filter = "PDF Files|*.pdf", ValidateNames = true })

            {
                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++)
                        for (int i = 1; i <= reader.NumberOfPages; i++)

                        {

                                sb.Append(PdfTextExtractor.GetTextFromPage(reader,i));

                        }
                        textBox1.Text = sb.ToString();
                        reader.Close();

                    }

                    catch (Exception ex)

                    {
                        MessageBox.Show(ex.Message,"Message",MessageBoxButtons.OK,MessageBoxIcon.Error);
                    }
                }
            }
        }
Order By: Standard | Newest | Votes
Stylus STYLUS posted this 06 July 2019

 

... need same this BUT for pdf

 

 

Stylus STYLUS posted this 22 July 2019

No help?

Close