
<?php
require 'pdfcrowd.php';
include 'includes/header.php';
require_once("lib/helper.php");
$sub_id=$_COOKIE["company_detail_id"];
// create an API client instance
$client = new Pdfcrowd("username", "apikey");
 $sub_id=$_COOKIE["company_detail_id"];
           $detail=$obj->select( "*","gbca_company_detail_master as gbca RIGHT JOIN gbca_company_master as mas ON gbca.company_detail_name=mas.company_id RIGHT JOIN gbca_section_master as sec ON gbca.section_id=sec.section_id ","company_detail_id= $sub_id ");
           
           $section=$detail[0]["section_name"];
           $company=$detail[0]["company_name"];
           $preparation=date("d F Y");
           $maker=$detail[0]["company_detail_maker_name"];
           $checker=$detail[0]["company_detail_checker_name"];
             $date=$detail[0]["company_detail_cutoff_date"];
             $today_date=date('d F Y');
           $time=time(); 

           $filename =$company.'_'.$time.'.pdf';
           
           
 
 
           
           
// convert a web page and store the generated PDF into a variable
//$pdf = $client->convertURI('http://www.google.com/');
$pdf = $client->convertHtml("report.html");
// 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;
?>