Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- App::import('Vendor','xtcpdf');
- ob_end_clean();
- $tcpdf = new XTCPDF();
- $textfont = 'freesans';
- $tcpdf->SetAuthor("AcuaSotf");
- $tcpdf->SetAutoPageBreak( true );
- $tcpdf->setHeaderFont(array($textfont,'',10));
- $tcpdf->xheadercolor = array(255,255,255);
- $tcpdf->xheadertext = 'Reportes de la Clinica Santa Sofia';
- // Ahora imprimimos el contenido de la pagina en una posición determinada
- // estos datos son un ejemplo, y en mi ejemplo hay un pequeño texto y una imagen.
- $tcpdf->AddPage();
- $table='<table class="results tablesorter">
- <thead>
- <tr>
- <th>NIT</th>
- <th>Nombre</th>
- <th>Teléfono</th>
- <th>Correo Electrónico</th>
- <th class="action-list"></th>
- </tr>
- </thead>
- <!-- Here is where we loop through our $posts array, printing out post info -->
- <tbody>
- <?php foreach ($companies as $record): ?>
- <tr class="<?php $record['ContractingCompany']['deleted_at'] ? 'deactivated' : ''; ?>">
- <td><?php $record['ContractingCompany']['nit']; ?></td>
- <td><?php $record['ContractingCompany']['name']; ?></td>
- <td><?php $record['ContractingCompany']['phone']; ?></td>
- <td><?php $record['ContractingCompany']['email']; ?></td>
- <td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>'
- $tcpdf->xfootertext = 'Copyright © %d Clinica Santa Sofia. Todos los derechos reservados.';
- $tcpdf->SetTextColor(0, 0, 0);
- $tcpdf->SetFont($textfont,'B',10);
- //$tcpdf->Cell(10,20,'Nombre:', 0, 0);
- // configuramos la calidad de JPEG
- //$tcpdf->setJPEGQuality(100);
- //$tcpdf->Image($imagen, 0, 50, 200, 200, '', '', '', false, 150);
- // se pueden asignar mas datos, ver la documentación de TCPDF
- echo $tcpdf->Output('empresas_contratantes.pdf', 'D'); //el pdf se muestra en el navegador
- //echo $tcpdf->Output('empresas_contratantes', 'I'); //el pdf se descarga
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement