Advertisement
Guest User

Untitled

a guest
Jul 12th, 2011
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. <?php
  2. App::import('Vendor','xtcpdf');
  3. ob_end_clean();
  4. $tcpdf = new XTCPDF();
  5.  
  6. $textfont = 'freesans';
  7. $tcpdf->SetAuthor("AcuaSotf");
  8. $tcpdf->SetAutoPageBreak( true );
  9. $tcpdf->setHeaderFont(array($textfont,'',10));
  10. $tcpdf->xheadercolor = array(255,255,255);
  11. $tcpdf->xheadertext = 'Reportes de la Clinica Santa Sofia';
  12.  
  13. // Ahora imprimimos el contenido de la pagina en una posición determinada
  14. // estos datos son un ejemplo, y en mi ejemplo hay un pequeño texto y una imagen.
  15. $tcpdf->AddPage();
  16. $table='<table class="results tablesorter">
  17. <thead>
  18. <tr>
  19. <th>NIT</th>
  20. <th>Nombre</th>
  21. <th>Tel&eacute;fono</th>
  22. <th>Correo Electr&oacute;nico</th>
  23. <th class="action-list"></th>
  24. </tr>
  25. </thead>
  26. <!-- Here is where we loop through our $posts array, printing out post info -->
  27. <tbody>
  28. <?php foreach ($companies as $record): ?>
  29. <tr class="<?php $record['ContractingCompany']['deleted_at'] ? 'deactivated' : ''; ?>">
  30. <td><?php $record['ContractingCompany']['nit']; ?></td>
  31. <td><?php $record['ContractingCompany']['name']; ?></td>
  32. <td><?php $record['ContractingCompany']['phone']; ?></td>
  33. <td><?php $record['ContractingCompany']['email']; ?></td>
  34. <td>
  35. </tr>
  36. <?php endforeach; ?>
  37. </tbody>
  38. </table>'
  39. $tcpdf->xfootertext = 'Copyright © %d Clinica Santa Sofia. Todos los derechos reservados.';
  40. $tcpdf->SetTextColor(0, 0, 0);
  41. $tcpdf->SetFont($textfont,'B',10);
  42. //$tcpdf->Cell(10,20,'Nombre:', 0, 0);
  43.  
  44. // configuramos la calidad de JPEG
  45. //$tcpdf->setJPEGQuality(100);
  46. //$tcpdf->Image($imagen, 0, 50, 200, 200, '', '', '', false, 150);
  47.  
  48. // se pueden asignar mas datos, ver la documentación de TCPDF
  49.  
  50. echo $tcpdf->Output('empresas_contratantes.pdf', 'D'); //el pdf se muestra en el navegador
  51. //echo $tcpdf->Output('empresas_contratantes', 'I'); //el pdf se descarga
  52.  
  53. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement