<?php
require('fpdf/fpdf.php');

class Document extends FPDF
{

var $fut1,$fut2;

 function __construct($h="",$f1="",$f2="") {
 $this->fut1=$f1;
 $this->fut2=$f2;
  parent::__construct();
  // Dodaj Arial CE font za podršku hrvatskih znakova (Windows-1250)
  $this->AddFont('ArialCE', '', 'arial_ce.php');
  $this->AddFont('ArialCE', 'B', 'arial_ce.php'); // Koristi isti font za bold (FPDF će simulirati)
  $this->AddFont('ArialCE', 'I', 'arial_ce.php'); // Koristi isti font za italic
  $this->AddFont('ArialCE', 'BI', 'arial_ce.php'); // Koristi isti font za bold italic
 }

// Page header
function Header()
{
    // Logo
    //$this->Image('logo.png',10,6,30);
    $this->SetFont('ArialCE','B',12);
	
    // Move to the right
    // $this->Cell(80);
    // Title
    // $this->Cell(30,10,'Title',1,0,'C');
    // Line break
	// $this->SetFont('Times','B',16);  // za naslov
    // $this->Ln(20);
}

// Page footer
function Footer()
{
    // Position at 1.5 cm from bottom
    $this->SetY(-20);
	$this->SetFont('ArialCE','',8);
	
	if($this->CurOrientation == 'P'){
		$this->Cell(190,0,'','T');
	}else{
		$this->Cell(280,0,'','T');
	}
	
	$this->Ln();
	
	$this->SetY(-20);
	$this->SetX(-200);
	if($this->CurOrientation == 'P'){
		$this->Cell(190,4,'Stranica: '.$this->PageNo().'/{nb}',0,0,'R');
	}else{
		$this->Cell(195,4,'Stranica: '.$this->PageNo().'/{nb}',0,0,'R');
	}
	
	$this->SetX(10);
	$fr1 = explode ("\n",$this->fut1);
	foreach($fr1 as $r) {
		$this->Cell(0,4,$r,0,0);
		$this->Ln();
	}
	
	// $this->SetY(-20);
	// $this->SetX(100);
	// $fr2 = explode ("\n",$this->fut2);
	// foreach($fr2 as $r) {
		// $this->Cell(0,5,$r,0,0);
		// $this->Ln();
	// }
	
	$this->Cell(0,5,$this->fut2,0,0,'L');
	
}

function output() {

$this->AliasNbPages();
// $this->AddPage();
$this->SetFont('Times','',12);
// for($i=1;$i<=40;$i++)    $this->Cell(0,10,'Printing line number '.$i,0,1);

parent::output();

}

}
?>