Conversions can be terminated on arbitrary conditions like timeouts. For this, you have to implement a ProgressEventListener and set it on the PDFreactor configuration. With the ProgressEvent, which is passed as an argument to the listener's only method, you can terminate the conversion by calling the event's method terminateConversion().

Since a timeout is one of the most common conditions for terminating a conversion, PDFreactor includes an implementation of a ProgressEventListener that does exactly that. This implementing class is TimeoutListener and its constructor takes the timeout in seconds as single argument.


Setting a Timeout of 15 Seconds

Configuration config = new Configuration();
// Conversions will terminate after 15 seconds
config.addProgressEventListener(new TimeoutListener(15));

This functionality is only available in the Java API of the PDFreactor library. When using the Web Service, you can use the parameter conversionTimeout to set a timeout for all conversions.