A
A
aeaeae12020-12-16 23:55:28
C++ / C#
aeaeae1, 2020-12-16 23:55:28

Output string specific from C# PDF file?

Good day! Please help. How to display the value of the required line in the listBox from a PDF file in C #?
5fda731eb3c02990124386.png
Here are code examples:

private void button5_Click(object sender, EventArgs e)
        {
            StreamReader File = new StreamReader(@"D:\BUH);
            string s;
            string x = "Основные средства";
 
            while ((s = File.ReadLine()) != x)
            {
                          
                listBox1.Items.Add(s);
            }
         }
ДРУГОЙ
 var path = @"D:\rs.pdf";

            var data = File.ReadAllLines(path);
            var st = "Основные средства";
            
            var flagR = false;

            foreach (var it in data)
            {
                if (it == st) { flagR = true; }
                

                if (flagR) { listBox1.Items.Add(it); }
            }

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
freeExec, 2020-12-17
@freeExec

It doesn't work that way with PDF. You find a plugin that can read it, study it. But in essence, all the work there is reduced to

ДайМнеСимволыИзПрямоугольникаСКоординатами(100, 50, 140, 30);

Those. works great with documents where only the numbers in the columns change and you just calculate its position once. If every time you need to look for a string that you don’t understand where it can appear, then everything is not so rosy.

R
Roman, 2020-12-17
@yarosroman

https://stackoverflow.com/questions/83152/reading-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question