Your IP : 216.73.216.48
<?php
require('fpdf.php');
class PDF extends FPDF
{
// Page header
function Header()
{
// Logo
$this->Image('logo.png',20,10,180);
$this->Ln(30);
$this->AddFont('Calibri','','calibri.php');
$this->SetFont('Calibri','',14);
$this->SetFillColor(255,255,255);
// Move to the right
// Title
// $title='Средно училище "Васил Левски" - Троян';
// $title=iconv('UTF-8', 'windows-1251', $title);
// $this->MultiCell(190,8,$title,0,'R',1);
}
// Page footer
function Footer()
{
// Position at 1.5 cm from bottom
$this->SetY(-15);
// Arial italic 8
$this->AddFont('Calibri','','calibri.php');
$this->SetFont('Calibri','',14);
$page='Стр. ';
$page=iconv('UTF-8', 'windows-1251', $page);
$pages=' от общо ';
$pages=iconv('UTF-8', 'windows-1251', $pages);
// Page number
$this->MultiCell(190,8,''.$page.''.$this->PageNo().''.$pages.'{nb}',0,'R',1);
}
function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
{
$k=$this->k;
if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())
{
$x=$this->x;
$ws=$this->ws;
if($ws>0)
{
$this->ws=0;
$this->_out('0 Tw');
}
$this->AddPage($this->CurOrientation);
$this->x=$x;
if($ws>0)
{
$this->ws=$ws;
$this->_out(sprintf('%.3F Tw',$ws*$k));
}
}
if($w==0)
$w=$this->w-$this->rMargin-$this->x;
$s='';
if($fill || $border==1)
{
if($fill)
$op=($border==1) ? 'B' : 'f';
else
$op='S';
$s=sprintf('%.2F %.2F %.2F %.2F re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);
}
if(is_string($border))
{
$x=$this->x;
$y=$this->y;
if(is_int(strpos($border,'L')))
$s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
if(is_int(strpos($border,'T')))
$s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
if(is_int(strpos($border,'R')))
$s.=sprintf('%.2F %.2F m %.2F %.2F l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
if(is_int(strpos($border,'B')))
$s.=sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
}
if($txt!='')
{
if($align=='R')
$dx=$w-$this->cMargin-$this->GetStringWidth($txt);
elseif($align=='C')
$dx=($w-$this->GetStringWidth($txt))/2;
elseif($align=='FJ')
{
//Set word spacing
$wmax=($w-2*$this->cMargin);
$this->ws=($wmax-$this->GetStringWidth($txt))/substr_count($txt,' ');
$this->_out(sprintf('%.3F Tw',$this->ws*$this->k));
$dx=$this->cMargin;
}
else
$dx=$this->cMargin;
$txt=str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));
if($this->ColorFlag)
$s.='q '.$this->TextColor.' ';
$s.=sprintf('BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt);
if($this->underline)
$s.=' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
if($this->ColorFlag)
$s.=' Q';
if($link)
{
if($align=='FJ')
$wlink=$wmax;
else
$wlink=$this->GetStringWidth($txt);
$this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$wlink,$this->FontSize,$link);
}
}
if($s)
$this->_out($s);
if($align=='FJ')
{
//Remove word spacing
$this->_out('0 Tw');
$this->ws=0;
}
$this->lasth=$h;
if($ln>0)
{
$this->y+=$h;
if($ln==1)
$this->x=$this->lMargin;
}
else
$this->x+=$w;
}
}
?>