<?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);
//210,148
// $pdf=new PDF('P','mm',array(105,148)); // P = Portrait, em milimetros, e A4 (210x297)
$pdf=new PDF('P','mm',array(100,150)); // P = Portrait, em milimetros, e A4 (210x297)
$pdf->AddPage();
$pdf->SetFont('Arial','',20);
// $pdf->RotatedImage($image,82,95,50,40,90);
$pdf->RotatedImage($image,30,100,50,40,90); //Funcionando
// $pdf->RotatedImage($image,33,50,50,40,0); 

$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);
}
*/
?>

