public function indexAction() {
$this->noViewRender();
try
{
//$url = "http://" . $_SERVER["SERVER_NAME"] . '/training/ecourse/certificate/demo.html';
//echo $url;
//die();
// create an API client instance
$client = new PdfCrowd("***", "***");
// convert a web page and store the generated PDF into a $pdf variable
$pdf = $client->convertURI('http://my.solidworks.com');
header('Content-Type: application/pdf');
//header("Cache-Control: max-age=0");
//header("Accept-Ranges: none");
header('Content-Disposition: attachment; filename="created.pdf"');
readfile('created.pdf');
//echo $pdf;
$this->_helper->viewRenderer->setNoRender ( true );
$this->_helper->layout->disableLayout ();
// send the generated PDF
}
catch(Exception $why)
{
echo "Pdfcrowd Error: " . $why;
}
I am not able to create PDF using the above code. Is there anything wrong. I have tried 100 times so far.