Hola otra alternativa y que para mi fue mucho mas facil y aparte tiene mas opcions html y css es http://www.mpdf1.com/mpdf/index.php
El día 19 de septiembre de 2012 16:47, sgb004 <[email protected]> escribió: > Puedes tratar con TCPDF es más fácil de usar y este tutorial de CakePHP me > funciono > http://bakery.cakephp.org/articles/kalileo/2010/06/08/creating-pdf-files-with-cakephp-and-tcpdf > , la documentación de TCPDF también esta sencilla, > http://www.tcpdf.org/doc/functions.html#index_0x24 , aquí unos ejemplos > http://www.tcpdf.org/examples.php > > Suerte! > > El miércoles, 19 de septiembre de 2012 12:59:44 UTC-5, Samara Santiago > escribió: >> >> hola espero ke me puedan ayudar pues bueno mi problema es el siguiente >> >> estoy utilizando Html2ps/Html2pdf para crear archivos pdf segui los pasos >> de este tuto >> http://bakery.cakephp.org/articles/view/4cb11e62-f280-480f-9e19-4845d13e7814/lang:spa >> y todo iba bien solo ke bueno empece hacer las modificaciones ke necesito >> para mi proyecto >> >> este es le codigo del controlador >> function view($id = null) { >> $this->Apartado->User->recursive = -1; >> $al = $this->Apartado->User->find('all', array('conditions'=> >> array('User.id'=> $this->_usersId()))); >> $this->set('al', $al); >> $datos = $this->Apartado->find('all', array('order' => >> array('Apartado.id' => 'asc'), 'conditions'=> array('Apartado.user_id'=> >> $this->_usersId()))); >> $this->set(compact('datos')); >> } >> >> function download($id = null) { >> // Include Component >> App::import('Component', 'Pdf'); >> // Make instance >> $Pdf = new PdfComponent(); >> // Invoice name (output name) >> $Pdf->filename = 'Reporte'; // Without .pdf >> // You can use download or browser here >> $Pdf->output = 'download'; >> $Pdf->init(); >> // Render the view >> $Pdf->process(Router::url('/', true) . 'reportes/view/'. $id); >> $this->render(false); >> } >> >> y este es el de mi vista >> >> <table> >> <tr> >> <th>Numero de Apartado</th> >> <th>TECAAL</th> >> <th>Sala</th> >> <th>Fecha</th> >> <th>Hora</th> >> <th>Estado</th> >> <th>Accion</th> >> </tr> >> <?php foreach ($datos as $dato): ?> >> <tr> >> <td><?php echo $dato['Apartado']['id']; ?></td> >> <td><?php echo $dato['Tecal']['nombre_tecal']; ?></td> >> <td><?php echo $dato['Sala']['nombre_sal']; ?></td> >> <td><?php echo $dato['Apartado']['fecha']; ?></td> >> <td><?php echo $dato['Apartado']['hora_i']; ?></td> >> <td><?php echo $dato['Apartado']['estado']; ?></td> >> <td class="actions"> >> <?php >> if ($dato['Apartado']['estado'] == 'Apartado'){ >> //echo $this->Html->link('Cancelar', array('controller' => >> 'apartados', 'action' => 'cancelar', $dato['Apartado']['id'])); >> } >> ?> >> <!--?php echo $this->Html->link('Borrar', array('controller' >> => 'users', 'action' => 'delete', $dato['User']['id']), array(), 'Esta >> seguro de querer borrar?'); ?--> >> </td> >> </tr> >> <?php >> endforeach; >> ?> >> </table> >> >> <?php >> echo $this->Html->link('Menu Inicio', array('controller'=> 'users', >> 'action'=> 'menu')); >> echo '<br>'; >> echo $this->Html->link('Descargar', array('controller' => 'reportes', >> 'action' => 'download')); >> >> y a la hora de generar mi documento me dice ke no se puede mostrar el >> documento ... ojala me puedan ayudar de antemano muchas gracias!!!! aaahh!!! >> se me olvidaba por ke luego me regañan utilizo la version cakephp 2.x >> > -- > Has recibido este mensaje porque estás suscrito al grupo "CakePHP-es" de > Grupos de Google. > Para ver este debate en la Web, visita > https://groups.google.com/d/msg/cakephp-es/-/UZEeWbtNWtQJ. > > Para publicar una entrada en este grupo, envía un correo electrónico a > [email protected]. > Para anular tu suscripción a este grupo, envía un correo electrónico a > [email protected] > Para tener acceso a más opciones, visita el grupo en > http://groups.google.com/group/cakephp-es?hl=es. -- Has recibido este mensaje porque estás suscrito al grupo "CakePHP-es" de Grupos de Google. Para publicar una entrada en este grupo, envía un correo electrónico a [email protected]. Para anular tu suscripción a este grupo, envía un correo electrónico a [email protected] Para tener acceso a más opciones, visita el grupo en http://groups.google.com/group/cakephp-es?hl=es.
