I made an app in C# in which you drop a PDF file, it its converted to PNG, that PNG is cropped to several parts, and then, OCR is performed on these parts, and write on TXT files is made. So far so good. The issue I'm having is when I try to read those txt-based-on-OCR files: no reading is made. Sometimes it reads all files, sometimes it doesn't (none of the files, actually). Following is the code I made to read those files:
var reader = new StreamReader(StoreTextFilePath2);
string direcc = reader.ReadToEnd().ToString();
var reader3 = new StreamReader(StoreTextFilePath3);
string npoliza = reader3.ReadToEnd().ToString();
var reader4 = new StreamReader(StoreTextFilePath4);
string inixo = reader4.ReadToEnd().ToString().Replace("-", "/").Replace(" ", "");
var reader5 = new StreamReader(StoreTextFilePath5);
string finxo = reader5.ReadToEnd().ToString().Replace("-", "/").Replace(" ", "");
var reader6 = new StreamReader(StoreTextFilePath6);
string seccc = reader6.ReadToEnd().ToString();
var reader7 = new StreamReader(StoreTextFilePath7);
string phono = reader7.ReadToEnd().ToString();
var reader8 = new StreamReader(StoreTextFilePath8);
string nyaaa = reader8.ReadToEnd().ToString();
var reader9 = new StreamReader(StoreTextFilePath9);
string dniii = reader9.ReadToEnd().ToString();
var reader10 = new StreamReader(StoreTextFilePath10);
string antep = reader10.ReadToEnd().ToString();
As you can see, those strings should take those readings of those TXT, but they keep empty, regardless of the TXT content. Am I doing something wrong? Since the PNG and TXT are valid, and actually contain valid text (not invalid characters that could be the result of wrong/improper OCR).
Thank you in advance to anyone who can help me.
PS: the "StoreTextFilePath" specified for StreamReader are different TXT files which obtained first the text of the PNG via OCR.