If your document takes a long time to process, use the HangDetector sample as a model. This sample converts one specified document. If a document does not convert within three seconds, then this sample halts the conversion and prints a timeout message.

Timeout speed can be adjusted to log in a way that works work best for you.