This is an archived forum post. The information may be outdated. Contact us if you have any questions.
$url = base_url() . "profile/" . $payment->user_id . "/voucher/" . $payment->reward_id; try { // create an API client instance $client = new Pdfcrowd($name, $api_key); // convert a web page and store the generated PDF into a $pdf variable $pdf = $client->convertURI($url); // set HTTP response headers header("Content-Type: application/pdf"); header("Cache-Control: no-cache"); header("Accept-Ranges: none"); header("Content-Disposition: inline; filename=\"voucher.pdf\""); echo $pdf; } catch (PdfcrowdException $why) { echo "Can't create PDF: ".$why."\n"; }