Ver Mensaje Individual
  #19 (permalink)  
Antiguo 19/12/2009, 15:49
Avatar de yoyoyo82
yoyoyo82
 
Fecha de Ingreso: julio-2009
Ubicación: Springfield
Mensajes: 159
Antigüedad: 14 años, 10 meses
Puntos: 1
Respuesta: Previsualizar imagen antes de subirla

Excelente ejemplo de las postales no cabe duda que es todo un master señor caricatos ,
no logro entender el metodo que debo de utilizar para recuperar la imagen del form y que me la muestre
este es el codigo de mi pdf
<?
header("Content-type: image/jpeg" );
$_SESSION['cont'];

require_once('eng.php');
require_once('tcpdf.php');

class MYPDF extends TCPDF {
//Page header
public function Header() {
// Logo
$this->Image(K_PATH_IMAGES.'invi.jpg', 145, 7, 25);
// Logo
$this->Image(K_PATH_IMAGES.'Dibujo.jpg', 10, 7, 37);
// Logo
$this->Image(K_PATH_IMAGES.'letr.jpg', 55, 7, 87);
// Set font
$this->SetFont('helvetica', 'B', 7);
// Move to the right
$this->Cell(63);
// Title
$this->Cell(40, 70, '', 100, 30, 8);

//$this->Cell(0, -100, 'Secretaria de Desarrollo Urbano y Vivienda', 135, 5, 10);
// Line break
$this->Ln(20);
}

// Page footer
public function Footer() {
// Position at 1.5 cm from bottom
$this->SetY(-15);
// Set font
$this->SetFont('helvetica', 'I', 8);
// Page number
$this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, 0, 'C');
}
}

// create new PDF document
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information

$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Nicola Asuni');
$pdf->SetTitle('TCPDF Example 003');
$pdf->SetSubject('TCPDF Tutorial');
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');

// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);

// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));

// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

//set margins


//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

//set some language-dependent strings
$pdf->setLanguageArray($l);

// ---------------------------------------------------------

// set font
$pdf->SetFont('times', 'BI',10);

// add a page

$pdf->AddPage();


$pdf->SetY(20.2);
$pdf->SetX(75);


$pdf->Cell(50, 1, 'REPORTE FOTOGRAFICO', 0, 0, 'C');

//$pdf->Cell(100, 100, 'Example 002',1 , 20, 10);
$pdf->SetFont('Helvetica', '', 6);
$pdf->SetY(1);
$pdf->SetX(2);
$pdf->Cell(180,190,' ',1,1,'L');
$pdf->SetY(1.1);
$pdf->SetX(2.1);
$pdf->Cell(180,190,' ',1,1,'L');
$pdf->SetY(1.2);
$pdf->SetX(2.2);
$pdf->Cell(180,190,' ',1,1,'L');
$pdf->SetY(1.3);
$pdf->SetX(2.3);
$pdf->Cell(180,190,' ',1,1,'L');
$pdf->SetY(3);
$pdf->SetX(5);
$pdf->Cell(174,187,' ',1,1,'L');




$pdf->SetY(25);
$pdf->SetX(10);
$pdf->Cell(20,4,'Numero de folio: ',1,0,'L');
$pdf->SetY(25);
$pdf->SetX(30);
$pdf->Cell(55,4,' ',1,0,'L');
$pdf->SetY(25);
$pdf->SetX(85);
$pdf->Cell(90,4,'Domicilio: ',1,0,'L');
$pdf->SetY(25);
$pdf->SetX(30);
//Noveno Campo
$pdf->SetFont('Helvetica', '', 6);
$pdf->SetY(29);
$pdf->SetX(10);
$pdf->Cell(165,7,'',1,0,'L');
$pdf->SetY(32);
$pdf->SetX(10);
$pdf->Cell(62,4,'Nombre:',0,0,'L');
$pdf->SetY(32);
$pdf->SetX(110);
$pdf->Cell(62,4,'COL.',0,0,'L');
$pdf->SetY(38);
$pdf->SetX(10);
$pdf->Cell(108,4,'Estado Original del Inmueble: ',1,0,'L');
$pdf->SetY(38);
$pdf->SetX(118);
$pdf->Cell(20,4,'Fecha:',1,0,'C');
$pdf->SetY(38);
$pdf->SetX(138);
$pdf->Cell(37,4,'',1,0,'C');
$pdf->SetY(44);
$pdf->SetX(12);
$pdf->Cell(163,48,'',1,0,'C');
$pdf->SetY(94);
$pdf->SetX(10);
$pdf->Cell(108,4,'Estado Original del Inmueble: ',1,0,'L');
$pdf->SetY(94);
$pdf->SetX(118);
$pdf->Cell(20,4,'Fecha:',1,0,'C');
$pdf->SetY(94);
$pdf->SetX(138);
$pdf->Cell(37,4,'',1,0,'C');
$pdf->SetY(100);
$pdf->SetX(12);

$pdf->Cell(163,48,'',1,0,'C');
$pdf->SetY(100);
$pdf->SetX(12);

$datos_imagen=$_SESSION["cont"] ;
$pdf->Image($datos_imagen,50,37.5);

$pdf->SetY(49);
$pdf->SetX(30);
$pdf->Cell(40,4,'',0,0,'C');
//Primer campo