akohan
asked on
calling a process (external) in a loop
Hello group,
I've started writing a code in C# and there is a step that I have to read a directory full of PDF and convert them to Text (using an open source). In fact, I am calling a process within a loop.
I'm worry that would cause issue sometimes or ... any idea or advice will be appreciated.
Regards,
I've started writing a code in C# and there is a step that I have to read a directory full of PDF and convert them to Text (using an open source). In fact, I am calling a process within a loop.
I'm worry that would cause issue sometimes or ... any idea or advice will be appreciated.
Regards,
in the loop:
{
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "C:\\test\\pdftotext.exe";
p.StartInfo.Arguments = strPDFIn + " " + strTestOut;
p.Start();
}
What kind of "advice" do you need? What kind of problems do you foresee? Do you need to wait for the process to complete before moving on to the next process? Does each process work on its own .pdf file and output?
ASKER
Yes, I need to know how I can make it wait to process 1 gets complete.
Regards,
ak
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks.