Ver Mensaje Individual
  #6 (permalink)  
Antiguo 23/12/2010, 16:19
Avatar de masterpuppet
masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 3 meses
Puntos: 845
Respuesta: No se carga imagen con libreria tcpdf con zend framework

Que tal mar_y_sol, esta es la ruta de la carpeta image ? library/tcpdf/image , si no es debería serlo, igual te comento que no estas integrando de una forma muy "limpia" la librería, deberías tener library/Application/TcPdf.php

Código PHP:
Ver original
  1. <?php
  2. require_once 'tcpdf/tcpdf.php';
  3.  
  4. Application_TcPdf extends TCPDF
  5. {
  6.    public function Header()
  7.    {
  8.         // Logo
  9.         $image_file = K_PATH_IMAGES . 'foto.png';
  10.         $this->Image($image_file, 10, 10, 15, '', 'PNG', '', 'T', false,
  11.                     300, '', false, false, 0, false, false, false);
  12.         // Set font
  13.         $this->SetFont('helvetica', 'B', 20);
  14.         // Title
  15.         $this->Cell(0, 15, 'Curriculum Vitae', 0, false, 'C', 0,
  16.                        '', 0, false, 'T', 'M');
  17.     }
  18.  
  19.     // Page footer
  20.     public function Footer()
  21.     {
  22.         // Position at 15 mm from bottom
  23.         $this->SetY(-15);
  24.         // Set font
  25.         $this->SetFont('helvetica', 'I', 8);
  26.         // Page number
  27.         $this->Cell(0, 10, 'Pagina '. $this->getAliasNumPage() . '/' .
  28.                $this->getAliasNbPages(),  0, false, 'R', 0, '', 0, false, 'T', 'M');
  29.     }
}

y luego para utilizarla

Código PHP:
Ver original
  1. //IndexController.php
  2. ...
  3. public function indexAction()
  4. {
  5.      try {
  6.          $pdf = new Application_TcPdf(PDF_PAGE_ORIENTATION, PDF_UNIT,
  7.                                       PDF_PAGE_FORMAT, true, 'UTF-8', false);
  8.          ...
  9.       } catch(Exception $e){...}
  10. }
  11. ...

Saludos.