require_once('tcpdf_include.php');
include("../../conn-web/cf.php");
session_start();
$sql="select *from post_job where id='$_REQUEST[jid]'";
$qryj=mysql_query($sql);
$resultj=mysql_fetch_array($qryj);
// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
// set margins
/*$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);*/
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
// set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
// set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
// set some language-dependent strings (optional)
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
require_once(dirname(__FILE__).'/lang/eng.php');
$pdf->setLanguageArray($l);
}
// ---------------------------------------------------------
// set font
//$pdf->SetFont('times', '', 12);
$pdf->SetFont('pdfatimes', '', 12, '', 'false');
// add a page
$pdf->AddPage();
// writeHTML($html, $ln=true, $fill=false, $reseth=false, $cell=false, $align='')
// writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=0, $reseth=true, $align='', $autopadding=true)
// create some HTML content
$message ="";
$message .= '
'.$resultj[job_title].'
for '.$resultj[employer].'
Job Location :
'.$resultj[jlocation].'
Salary :
'.$resultj[msalary].' - '.$resultj[maxsalary].' Lakh Per Annum
|
| Industry: '.$resultj[industry].' |
| Job Type : '.$resultj[job_type].' |
|
Experience:
'.$resultj[y_exp].' Posted on: '.date('d M',strtotime($resultj[j_date])).'
|
| Job Description |
| |
| '.$resultj[job_desc].' |
| |
| Keywords: '.$resultj[kewrds].' |
|
| |
| Desired Candidate Profile |
| |
| |
| Education: |
'.$resultj[education].' |
| Experience: |
'.$resultj[y_exp].' |
|
|
';
//end
$pdf->writeHTML($message, true, false, true, false, '');
$pdf->lastPage();
//$pdf->Output('example_006.pdf', 'I');
$pdf->Output(''.$resultj[job_title].'.pdf', 'I');
$content = $pdf->Output('images/'.$resultj[job_title].'.pdf','F');
$filename = 'images/'.$resultj[job_title].'.pdf';
$fileinfo = pathinfo($filename);
$sendname = $fileinfo['filename'] . '.' . strtoupper($fileinfo['extension']);
header('Content-Type: application/pdf');
header("Content-Disposition: attachment; filename=\"$sendname\"");
header('Content-Length: ' . filesize($filename));
readfile($filename);
exit;
?>