I am trying to extract thumbnail from a indd file using c#.
I can execute the following command from commandline, which works fine
exiftool -r -b -PageImage sample.indd > sample.jpg
but when I tried it from my c# project its not producing the output file
My sample code
string c_arguments = string.Format("-r -b -PageImage {0} > {1}", _DirectoryPath + "\\" + fileName,
_DirectoryPath + "\\output.jpg");
var psi = new ProcessStartInfo("exiftool.exe", c_arguments);
psi.UseShellExecute = false;
psi.CreateNoWindow = true;
psi.RedirectStandardInput = true;
psi.RedirectStandardOutput = true;
try
{
using (Process exeProcess = Process.Start(psi))
{
exeProcess.Start();
Console.WriteLine("Executed successfully");
}
}
catch (Exception ex)
{
Console.WriteLine("Error occured, ErrorMsg: " + ex.Message);
}
after exeProcess.Start(), is executed the program waits forever no output is produced.
What am I missing here.