Why does this output a 0 byte file?
<?php
$jsonurl = "http://do.convertapi.com/Web2Pdf/json/?curl=http://stackoverflow.com/";
$json = file_get_contents($jsonurl,0,null,null);
$json_output = json_decode($json);
file_put_contents('converted.pdf', $json_output);
?>
I guess you need to do following:
What you actually did is that you retrieved JSON data and decoded it to PHP object. You need to retrieve contents of the “File” property from that object and put it into the file.