Exemple #1
0
}
// Crear el documento
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, "UTF-8", false);
//Font
$pdf->SetFont('times', '', 11);
//Linea header and footer
$pdf->SetHeaderData('', '', 'ÍNDICE', '', array(0, 64, 255), array(0, 64, 128));
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetPrintFooter(false);
//Margin
$pdf->SetLeftMargin(30);
$pdf->SetRightMargin(30);
// Anadir pagina
$pdf->AddPage();
//Obtemos el html
$html = retornaHtml($result, $resultEntrevista);
// output the HTML content
$pdf->writeHTML($html);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// reset pointer to the last page
$pdf->lastPage();
// ---------------------------------------------------------
//PERMISOS RUTA: chmod -R 0777 /yourdirectory
//Close and output PDF document
$pdf->Output($rutaDestino . '/indice.pdf', 'F');
//$pdf->Output('indice.pdf', 'I');
//-----------------------------------------------------------------------------------
function retornaHtml($result, $resultEntrevista)
{
    $html = "<div>";
    $entrevista = "";
    exit;
}
// Crear el documento
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, "UTF-8", false);
//Font
$pdf->SetFont('times', '', 11);
//Linea header and footer
$pdf->SetPrintHeader(false);
$pdf->SetPrintFooter(false);
//Margin
$pdf->SetLeftMargin(20);
$pdf->SetRightMargin(20);
// Anadir pagina
$pdf->AddPage();
//Obtemos el html
$html = retornaHtml($conn, $resultEditores, $resultMaquetadores);
// output the HTML content
$pdf->writeHTML($html);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// reset pointer to the last page
$pdf->lastPage();
// ---------------------------------------------------------
//PERMISOS RUTA: chmod -R 0777 /yourdirectory
//Close and output PDF document
$pdf->Output($rutaDestino . '/participantes.pdf', 'F');
print "OK";
function retornaHtml($conn, $resultEditores, $resultMaquetadores)
{
    //Aplicamos operaciones de modificacion
    $html = "";
    //Portada