79 lines
2.2 KiB
PHP
79 lines
2.2 KiB
PHP
<?php
|
|
App::import('Vendor','tcpdf/xtcpdf');
|
|
$cvinhalt = $this->element('user_worker_cv',array('toPDF'=>true,'profil'=>$WORKER));
|
|
$cvinhalt .= '<style>span{font-style:italic;font-size:10px;}h1,h2,h3,h4,h5{
|
|
border-bottom:2px solid grey;
|
|
width:100%;
|
|
}</style>';
|
|
ob_end_clean();
|
|
|
|
|
|
$dev = 0;
|
|
$tcpdf = new XTCPDF();
|
|
$tcpdf->SetMargins(25,25,20,25);
|
|
$tcpdf->SetAuthor("Miconware");
|
|
$tcpdf->SetAutoPageBreak( false );
|
|
|
|
$tcpdf->mail=$WORKER['User']['mail'];
|
|
|
|
$tcpdf->AddPage();
|
|
|
|
// Deckblatt
|
|
$tcpdf->SetY(35);
|
|
$tcpdf->SetTextColor(0, 0, 0);
|
|
$tcpdf->SetFont($tcpdf->font);
|
|
$tcpdf->Image(WWW_ROOT.DS.'uploads'.DS.$WORKER['AppUser']['avatar'],0,35,0,140,'','','','',300,'L');
|
|
$tcpdf->SetY(180);
|
|
$tcpdf->SetFont($tcpdf->font,'B',$tcpdf->fontsize);
|
|
$tcpdf->Cell(0,0, __('dreamjob.application.mappe'), 0,1,'L');
|
|
$tcpdf->SetFont($tcpdf->font);
|
|
|
|
$tcpdf->SetY(255);
|
|
$tcpdf->Cell(0,0, $WORKER['Mannerofaddress']['name'].' '.$WORKER['AppUser']['first_name'].' '.$WORKER['AppUser']['last_name'], 0,1,'R');
|
|
$tcpdf->Cell(0,0, $WORKER['DreamjobUser']['street'], 0,1,'R');
|
|
$tcpdf->Cell(0,0, $WORKER['DreamjobUser']['postcode'].' '.$WORKER['DreamjobListCity']['name'], 0,1,'R');
|
|
|
|
//Lebenslauf
|
|
$tcpdf->title=__('dreamjob.cv');
|
|
$tcpdf->AddPage();
|
|
$tcpdf->SetY(35);
|
|
$tcpdf->SetTextColor(0, 0, 0);
|
|
$tcpdf->SetFont($tcpdf->font);
|
|
|
|
//$tcpdf->writeHTML(0,235,10,35, $cvinhalt, $dev,0,false,true,'L');
|
|
$tcpdf->writeHTML($cvinhalt);
|
|
$tcpdf->SetAutoPageBreak( false );
|
|
|
|
//Anhang
|
|
foreach($WORKER['DreamjobPageInh'] as $page){
|
|
$tcpdf->title=$page['title'];
|
|
$tcpdf->AddPage();
|
|
$tcpdf->SetY(35);
|
|
$tcpdf->SetTextColor(0, 0, 0);
|
|
$tcpdf->SetFont($tcpdf->font);
|
|
|
|
$pageType = null;
|
|
foreach($pageImage as $pg){
|
|
if($page['id'] == $pg['DreamjobPageInh']['id'])
|
|
$pageType=$pg;
|
|
}
|
|
if($pageType==null){
|
|
foreach($pageText as $pg){
|
|
if($page['id'] == $pg['DreamjobPageInh']['id'])
|
|
$pageType=$pg;
|
|
}
|
|
$tcpdf->writeHTMLCell(0,235,10,35, $pageType['DreamjobPageText']['text'], $dev,0,false,true,'L');
|
|
}else{
|
|
$tcpdf->Image(WWW_ROOT.DS.'uploads'.DS.$pageType['DreamjobPageImage']['image'],0,35,0,235,'','','','',300,'C');
|
|
}
|
|
}
|
|
// ...
|
|
// etc.
|
|
// see the TCPDF examples
|
|
|
|
echo $tcpdf->Output('filename.pdf');
|
|
// TO Download
|
|
//echo $tcpdf->Output('filename.pdf','D');
|
|
|
|
?>
|