예제 #1
0
 private void button2_Click_1(object sender, EventArgs e)
 {
     try
     {
         PDFFuctions functions = new PDFFuctions();
         Tempadress.Address = Tempadress.Address.Trim();
         var items = listView1.SelectedItems;
         if (items.Count <= 0)
         {
             MessageBox.Show("You must select one item");
         }
         foreach (ListViewItem x in items)
         {
             string text = functions.getParagraphByCoOrdinate(textBox1.Text, (int)numericUpDown1.Value, (int)numericUpDown4.Value, (int)numericUpDown5.Value, (int)numericUpDown2.Value, (int)numericUpDown3.Value, true);
             MessageBox.Show("Retreived Value is " + text);
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Kindly Find the adress in PDF first");
     }
 }
예제 #2
0
        private void SearchUsingTemplate(string text)
        {
            foreach (SinglePdfLine Tempadressobj in Tempadress.AdressLines)
            {
                float       LLX = 0f, LLY = 0f, URX = 0f, URY = 0f;
                PDFFuctions fuctions = new PDFFuctions();
                if (Tempadressobj.LLX != 0f)
                {
                    LLX = Tempadressobj.LLX;
                }
                if (Tempadressobj.LLY != 0f)
                {
                    LLY = Tempadressobj.LLY;
                }
                if (Tempadressobj.URX != 0f)
                {
                    URX = Tempadressobj.URX;
                }
                if (Tempadressobj.URX != 0f)
                {
                    URY = Tempadressobj.URY;
                }

                string Document = fuctions.getParagraphByCoOrdinate(text, Tempadressobj.PageNo, (int)LLX, (int)LLY, (int)URX, (int)URY, true);

                richTextBox1.Text += Document + "\n";
                FindFont(Document, text);
                foreach (var x in CompareAddresses)
                {
                    //    richTextBox1.Text += x.LLX+"\n";
                    if (x.Address.Equals(Document) && x.FontSize == Tempadressobj.FontSize && x.FontFamily.Equals(Tempadressobj.FontFamily) == true)
                    {
                        richTextBox1.Text += "Adress Found  =" + x.Address + "   " + Tempadressobj.URX + "    " + x.URX + "  " + Tempadressobj.URY + "\n";
                    }
                }
            }
        }