creo que el problema esta en tu funcion viewPdf en la parte de:

$property = $this->__view($id);

esta llamando a una funcion dentro de tu controller que parece no estar,
deja tu funcion de esta manera y prueba de nuevo:

*function viewPdf($id = null) **
**    { **
**        if (!$id) **
**        { **
**            $this->Session->setFlash('Sorry, there was no property ID
submitted.'); **
**            $this->redirect(array('action'=>'index'), null, true); **
**        } **
**        Configure::write('debug',0); // Otherwise we cannot use this
method while developing **
**        $id = intval($id); **
**        $this->layout = 'pdf'; //this will use the pdf.ctp layout **
**        $this->render(); **
**    }*

si te corre el problema estaba en esa parte, ya que estaba tratando de
llenar la variable $property desde otra funcion llamada _view que se supone
esta en tu controller.

Saludos,


*Aland Laines Calonge*
Twitter: @lainessolutions
http://about.me/aland.laines



El 12 de marzo de 2013 09:18, Marcelo Gracia <[email protected]>escribió:

>  El 12/03/2013 11:13 a.m., Aland Laines escribió:
>
> mas que la accion, necesitamos ver tu vista, hay es donde esta el error a
> mi parecer, saludos!
>
>  *Aland Laines Calonge*
> Twitter: @lainessolutions
>  http://about.me/aland.laines
>
>
>
> El 12 de marzo de 2013 05:00, MGracia <[email protected]> escribió:
>
>>  Amigos, me he bajado la clase TCPDF .
>> Siguiendo este link
>> http://bakery.cakephp.org/articles/kalileo/2010/06/08/creating-pdf-files-with-cakephp-and-tcpdf
>> he tratado de configurar mi aplicacion.
>> Vengo trabajando el el Blog Tutorial de cake.
>>
>> Si mal no he hecho las cosas, deberia ver el pdf en
>> ...cakeblog/posts/viewPdf/2
>>
>> pero al ejecutar esa petición me tira un error
>>  An Internal Error Has Occurred.
>>
>> *Error: *An Internal Error Has Occurred.
>> Ahora si paso el enlace asi: cakeblog/posts/viewPdf
>> me tira este error
>>  Sorry, there was no property ID submitted.
>>  Lo cual esta bien porque no le estoy pasando el ID del post que quiero
>> visualizar como pdf.
>>
>> Que estoy configurando o haciendo mal???
>> Alguna pista.
>>
>> Tengo creado estos archivos
>> ...View/Posts/viewPdf.ctp
>> ...View/Layouts/pdf.ctp
>>
>> en el postController tengo el metodo viewPdf según el ejemplo.
>> *function viewPdf($id = null) **
>> **    { **
>> **        if (!$id) **
>> **        { **
>> **            $this->Session->setFlash('Sorry, there was no property ID
>> submitted.'); **
>> **            $this->redirect(array('action'=>'index'), null, true); **
>> **        } **
>> **        Configure::write('debug',0); // Otherwise we cannot use this
>> method while developing **
>> **        $id = intval($id); **
>> **        $property = $this->__view($id); // here the data is pulled
>> from the database and set for the view **
>> **        if (empty($property)) **
>> **        { **
>> **            $this->Session->setFlash('Sorry, there is no property with
>> the submitted ID.'); **
>> **            $this->redirect(array('action'=>'index'), null, true); **
>> **        } **
>> **        $this->layout = 'pdf'; //this will use the pdf.ctp layout **
>> **        $this->render(); **
>> **    } *
>>
>> Ayuda please!
>> SLDS. marcelo.
>>   --
>> Has recibido este mensaje porque estás suscrito al grupo "CakePHP-es" de
>> Grupos de Google.
>> Para anular la suscripción a este grupo y dejar de recibir sus correos
>> electrónicos, envía un correo electrónico a
>> [email protected].
>> Para publicar una entrada en este grupo, envía un correo electrónico a
>> [email protected].
>> Visita este grupo en http://groups.google.com/group/cakephp-es?hl=es.
>> Para obtener más opciones, visita
>> https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> Has recibido este mensaje porque estás suscrito al grupo "CakePHP-es" de
> Grupos de Google.
> Para anular la suscripción a este grupo y dejar de recibir sus correos
> electrónicos, envía un correo electrónico a
> [email protected].
> Para publicar una entrada en este grupo, envía un correo electrónico a
> [email protected].
> Visita este grupo en http://groups.google.com/group/cakephp-es?hl=es.
> Para obtener más opciones, visita https://groups.google.com/groups/opt_out
> .
>
>
>
> ok.. ahi adjunto la vista.
> <?php
> App::import('Vendor','xtcpdf');
> $tcpdf = new XTCPDF();
> $textfont = 'freesans'; // looks better, finer, and more condensed than
> 'dejavusans'
> $tcpdf->SetAuthor("KBS Homes & Properties at http://kbs-properties.com";);
> $tcpdf->SetAutoPageBreak( false );
> $tcpdf->setHeaderFont(array($textfont,'',40));
> $tcpdf->xheadercolor = array(150,0,0);
> $tcpdf->xheadertext = 'KBS Homes & Properties';
> $tcpdf->xfootertext = 'Copyright © %d KBS Homes & Properties. All rights
> reserved.';
> // add a page (required with recent versions of tcpdf)
> $tcpdf->AddPage();
> // Now you position and print your page content
> // example:
> $tcpdf->SetTextColor(0, 0, 0);
> $tcpdf->SetFont($textfont,'B',20);
> $tcpdf->Cell(0,14, "Hello World", 0,1,'L');
> // ...
> // etc.
> // see the TCPDF examples
> echo $tcpdf->Output('filename.pdf', 'D');
> ?>
>
> El código de la vista es el que trae el ejemplo de TCPDF.
> Gracias. SLDS.
>
> --
> Has recibido este mensaje porque estás suscrito al grupo "CakePHP-es" de
> Grupos de Google.
> Para anular la suscripción a este grupo y dejar de recibir sus correos
> electrónicos, envía un correo electrónico a
> [email protected].
> Para publicar una entrada en este grupo, envía un correo electrónico a
> [email protected].
> Visita este grupo en http://groups.google.com/group/cakephp-es?hl=es.
> Para obtener más opciones, visita https://groups.google.com/groups/opt_out
> .
>
>
>

-- 
Has recibido este mensaje porque estás suscrito al grupo "CakePHP-es" de Grupos 
de Google.
Para anular la suscripción a este grupo y dejar de recibir sus correos 
electrónicos, envía un correo electrónico a 
[email protected].
Para publicar una entrada en este grupo, envía un correo electrónico a 
[email protected].
Visita este grupo en http://groups.google.com/group/cakephp-es?hl=es.
Para obtener más opciones, visita https://groups.google.com/groups/opt_out.


Responder a