<?php
require 'pdfcrowd.php';

try
{
    // create an API client instance
    $client = new Pdfcrowd("unisoul", "b9e4023c08b9d232a6ef914dbafc4156");

    // convert a web page and store the generated PDF into a $pdf variable
    //$pdf = $client->convertURI('http://www.google.com/');

    $pdf = $client->convertHtml(file_get_contents('/home/sabulli1/public_html/templates/investing/investment-pdf.php'));

    // set HTTP response headers
    header("Content-Type: application/pdf");
    header("Cache-Control: max-age=0");
    header("Accept-Ranges: none");
    header("Content-Disposition: attachment; filename=\"google_com.pdf\"");

    // send the generated PDF
    echo $pdf;
}
catch(PdfcrowdException $why)
{
    echo "Pdfcrowd Error: " . $why;
}
?>
