You are 95% of the way with the code you sent:
try
{
doc.OCR(language, false, false);
}
catch
{
}
It would be wise to catch the type of exception that occurs when the document is empty and then has a different exception handler for any other errors that may occur.
try
{
doc.OCR(language, false, false);
}
catch (DocumentEmptyException dex)
{
}
catch
{
}
DocumentEmptyException, I believe, did not select the type of exception - if you look at the documents for the OCR method (or through debug), you can determine what type of exception to catch
EDIT ( )
, doc.OCR(...)? catch, ?
, catch:
MODI.Image image = (MODI.Image)doc.Images[0];
, ( catch ), ?