Link to home
Start Free TrialLog in
Avatar of akohan
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,

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();
 
  }

Open in new window

Avatar of Bob Learned
Bob Learned
Flag of United States of America image

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?
Avatar of akohan
akohan

ASKER



Yes, I need to know how I can make it wait to process 1 gets complete.

Regards,
ak
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of akohan

ASKER



Thanks.