This code doesn't actually print something, it's using the Shell to send a Print command to whichever program the user has installed to handle pdfs. This may or may not be Adobe Acrobat. The process will finish as soon as the verb is sent. It won't even wait until the file is added to a print queue.
Printer management is achieved by using the classes in the System.Printing namespace. The PrintServer class represents an actual printer and PrintQueue represents a print queue on that printer. Calling PrintQueue.GetPrintJobInfoCollection will return all jobs on a printer.
Once you find the relevant PrintSystemJobInfo object (by checking the Name or JobName properties) you can check the job's status with the IsCompleted, IsBlocked etc properties. To detect changes you should call Refresh on the job periodically
You could try to find the job with something like the following method, created by copying from the various documentation samples:
public bool TryFindJob(string searchString,out PrintSystemJobInfo actualJob)
{
var myPrintServer = new PrintServer(@"\\theServer");
actualJob=null;
var myPrintQueues = myPrintServer.GetPrintQueues();
foreach (PrintQueue pq in myPrintQueues)
{
pq.Refresh();
var jobs = pq.GetPrintJobInfoCollection();
foreach (PrintSystemJobInfo job in jobs)
{
if (job.JobName.Contains(searchString) || job.Name.Contains(searchString))
{
actualJob=job;
return true;
}
}
}
return false;
}
Assuming the job's name will contain the file's name, you can find the job :
var name=Path.GetFileNameWithoutExtension(file);
PrintSystemJobInfo job;
if(TryFindJob(name,out job))
{
while(...)
{
job.Refresh();
if (job.IsCompleted)
{
break;
}
else
{
//Sleep and retry
}
}