To diagnose the problem, it would help if you could run
$client = new Pdfcrowd("***", "***");
$pdf = $client->convertURI("http://pdfcrowd.com/ping/");
header("Content-Type: application/pdf");
header("Cache-Control: no-cache");
header("Accept-Ranges: none");
header("Content-Disposition: attachment; filename=\"$filename.pdf\"");
echo $pdf;
and then
$client = new Pdfcrowd("***", "***");
$pdf = $client->convertURI("http://pdfcrowd.com/ping/");
$out_file = fopen("/path/to/dir/ping.pdf", "wb");
$written = fwrite($out_file, $pdf);
fclose($out_file);
$pdf_length = strlen($pdf);
echo "$pdf_length, $written\n";
The first script sends PDF to the browser, the second saves it to "/path/to/dir/ping.pdf" (replace this with a real path). Please send us both PDF files and also the echoed output of the second script.