Hi Guido,
thanks for the feedback and suggestions.
If you want to avoid the 503 error it is perfectly ok to sleep() for a few seconds and then resend the failed request again:
$tries = 0;
$success = false;
while (!$success) {
$tries += 1;
try {
$pdf = $client->convertURI("http://yourdomain.com");
// ..
$success = true;
} catch(PdfcrowdException $why) {
if ($why->getCode() != 503 || $tries == 5) {
// log error and re-throw the exception
throw $why;
} else {
sleep(2);
}
}
}