Esempio n. 1
0
 private function printPdfHeader($title)
 {
     $this->pdf->SetCreator(formatLogin($_SESSION['s_login']));
     $this->pdf->SetAuthor(formatLogin($_SESSION['s_login']));
     $this->pdf->SetTitle($title);
     //$this->pdf->SetSubject($title);
     //$this->pdf->SetKeywords('pdf, '._EMPLOYEEFORM);
     $this->pdf->setPrintHeader(false);
     $this->pdf->setPrintFooter(false);
     $this->pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     $this->pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     $this->pdf->setFontSubsetting(false);
     $this->pdf->AddPage();
     $logoFile = EfrontSystem::getSystemLogo();
     $imgDetails = getimagesize($logoFile['path']);
     if ($imgDetails[0] > 170) {
         $resized_file = $logoFile['directory'] . '/resized-logo.png';
         $this->smartResizeImage($logoFile['path'], null, '170', '52', true, $resized_file, false, false, 100);
         $resized = true;
     }
     if (extension_loaded('gd')) {
         if ($resized) {
             $this->pdf->Image($resized_file, '', '', 0, 0, '', '', 'T');
         } else {
             $this->pdf->Image($logoFile['path'], '', '', 0, 0, '', '', 'T');
         }
     }
     $this->pdf->SetFont($this->defaultSettings['default_font']);
     $this->printLargeTitle($GLOBALS['configuration']['site_name']);
     $this->printSmallTitle($GLOBALS['configuration']['site_motto']);
     $this->printSeparatorHeader($title);
 }
 public function showLogo($pdf)
 {
     $logo = $this->active_certificate->logo;
     if ($logo) {
         $start = substr($logo['file'], 0, 7);
         if ($start == 'http://') {
             $logoUrl = $logo['file'];
         } else {
             /*try{
             			try{
             				$configuration = EfrontConfiguration::getValues();
             				$logoFile = new EfrontFile($configuration['logo']);
             				$logoUrl = G_SERVERNAME.'themes/default/images/logo/'.$logoFile['physical_name'];
             			}
             			catch(EfrontFileException $e){
             				$currentTheme = new themes(G_CURRENTTHEME);
             				$logoFile = new EfrontFile($currentTheme->options['logo']);
             				$logoUrl = G_SERVERNAME.'themes/default/images/'.$logoFile['physical_name'];
             			}
             		}
             		catch(EfrontFileException $e){
             			$logoUrl = G_SERVERNAME.'themes/default/images/logo.png';
             		}*/
             $logoFile = EfrontSystem::getSystemLogo();
             $logoUrl = $logoFile['path'];
         }
         $this->showImage($pdf, $logoUrl, $logo['x'], $logo['y']);
     }
 }
Esempio n. 3
0
 private function printPdfHeader($title)
 {
     $this->pdf->SetCreator(formatLogin($_SESSION['s_login']));
     $this->pdf->SetAuthor(formatLogin($_SESSION['s_login']));
     $this->pdf->SetTitle($title);
     //$this->pdf->SetSubject($title);
     //$this->pdf->SetKeywords('pdf, '._EMPLOYEEFORM);
     $this->pdf->setPrintHeader(false);
     $this->pdf->setPrintFooter(false);
     $this->pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     $this->pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     $this->pdf->setFontSubsetting(false);
     $this->pdf->AddPage();
     $logoFile = EfrontSystem::getSystemLogo();
     if (extension_loaded('gd')) {
         $this->pdf->Image($logoFile['path'], '', '', 0, 0, '', '', 'T');
     }
     $this->pdf->SetFont($this->defaultSettings['default_font']);
     $this->printLargeTitle($GLOBALS['configuration']['site_name']);
     $this->printSmallTitle($GLOBALS['configuration']['site_motto']);
     $this->printSeparatorHeader($title);
 }