<?php

require_once 'includes/inicio.php';
// require_once('fpdf/fpdf.php');
require_once('fpdf/rotation.php');


class PDF extends PDF_Rotate
{
function RotatedText($x,$y,$txt,$angle)
{
	//Text rotated around its origin
	$this->Rotate($angle,$x,$y);
	$this->Text($x,$y,$txt);
	$this->Rotate(0);
}

function RotatedImage($file,$x,$y,$w,$h,$angle)
{
	//Image rotated around its upper-left corner
	$this->Rotate($angle,$x,$y);
	$this->Image($file,$x,$y,$w,$h);
	$this->Rotate(0);
}
}


$obj = Participante::buscar(@$_GET['id']);
$image = Util::baseUrl().'tmp/'.$obj->imagem; 
$extensao = explode(".", $image);

$pdf=new PDF('L','mm',array(148,210)); // P = Portrait, em milimetros, e A4 (210x297)
$pdf->AddPage();
$pdf->SetFont('Arial','',20);
$pdf->RotatedImage($image,82,95,50,40,90);
// $pdf->RotatedText(100,60,'Hello!',45);
$pdf->Output();


/*
if ($_GET['id'] != '') { 

    $obj = Participante::buscar(@$_GET['id']);
    $image = Util::baseUrl().'tmp/'.$obj->imagem; 
    $extensao = explode(".", $image);

    $pdf = new FPDF('L','mm',array(148,210)); // P = Portrait, em milimetros, e A4 (210x297)
    $pdf->AddPage();
    $pdf->SetFont('Arial','',11);
    $pdf->Image($image,50,50,50,40,'JPEG');
    $pdf->Ln();

    $arquivo = date("his").'.pdf';

    $pdf->Output('I',"externos/fotos/".$arquivo);
}
*/
?>

