function GeradorPDF($participante, $textoPrincipal, $conteudo, $equipe, $tamanhoTexto, $tamanhoConteudo, $tamanhoEquipe, $ordemImpressao)
{
    require 'fpdf/WriteTag.php';
    //Verifica se os tamanhos das fontes passados por parâmetro são numéricos, caso contrário se dá o valor padrão 14
    if (!is_numeric($tamanhoConteudo)) {
        $tamanhoConteudo = '14';
    }
    if (!is_numeric($tamanhoEquipe)) {
        $tamanhoEquipe = '14';
    }
    if (!is_numeric($tamanhoTexto)) {
        $tamanhoTexto = '14';
    }
    $pdf = new PDF_WriteTag('L', 'mm');
    //Inicializa o PDF
    $pdf->SetAutoPageBreak(0);
    //Cria os styles normal, negrito e negrito-italico
    $pdf->SetStyle("p", "arial", "N", 13, "0,0,0", 60);
    $pdf->SetStyle("b", "arial", "B", 13, "0,0,0");
    $pdf->SetStyle("bi", "arial", "BI", 13, "0,0,0");
    if ($ordemImpressao == '1') {
        paginaFrente($pdf, $participante, $textoPrincipal, $tamanhoTexto);
        paginaTras($pdf, $conteudo, $equipe, $tamanhoEquipe, $tamanhoConteudo);
    } else {
        paginaTras($pdf, $conteudo, $equipe, $tamanhoEquipe, $tamanhoConteudo);
        paginaFrente($pdf, $participante, $textoPrincipal, $tamanhoTexto);
    }
    $pdf->Output("Certificado.pdf", "I");
    //Gera a pagina PDF
}
Exemple #2
0
 //        $flsAr = $_POST['fls'];
 //        $sobnumAr = $_POST['sobnum'];
 $numAr = "";
 $flsAr = "";
 $sobnumAr = "";
 $periodoAr = $_POST['periodo'];
 $cargaAr = $_POST['carga'];
 $funcaoAr = $_POST['funcao'];
 $participanteAr = refinaArray($_POST['participantes']);
 $ContProgAr = refinaArray($_POST['contprogramatico']);
 $equipeAr = refinaArray($_POST['equipe']);
 $textoPrincipal = $_POST['texto'];
 //Substitui as tags {evento} e {promovente} do texto principal pelos valores previamente preenchidos, adicionando tags para style negrito
 //ao texto do evento
 $textoPrincipal = str_replace(array("{evento}", "{promovente}"), array("<b>" . $_POST['evento'] . "</b>", $_POST['promovente']), $textoPrincipal);
 $pdf = new PDF_WriteTag('L', 'mm');
 //Inicializa o PDF
 $pdf->SetAutoPageBreak(0);
 $ordem = $_POST['ordem'];
 //Variavel contendo a ordem de impressao - 1=normal / 2=inverso
 //Cria os styles normal, negrito e negrito-italico
 $pdf->SetStyle("p", "arial", "N", 13, "0,0,0", 60);
 $pdf->SetStyle("b", "arial", "B", 13, "0,0,0");
 $pdf->SetStyle("bi", "arial", "BI", 13, "0,0,0");
 $n = 1;
 //Variavel contendo o numero participante, de 1 a n
 foreach ($participanteAr as $participante) {
     if ($ordem == '1') {
         paginaFrente($pdf, $participante, $periodoAr, $cargaAr, $textoPrincipal, $funcaoAr, $n);
         paginaTras($pdf, $sizeconteudo, $equipeAr, $sizeequipe, $sobnumAr, $numAr, $flsAr, $n);
     } else {
Exemple #3
0
<?php

require 'WriteTag.php';
$pdf = new PDF_WriteTag();
$pdf->SetMargins(30, 15, 25);
$pdf->SetFont('courier', '', 12);
$pdf->AddPage();
// Stylesheet
$pdf->SetStyle("p", "courier", "N", 12, "10,100,250", 15);
$pdf->SetStyle("h1", "times", "N", 18, "102,0,102", 0);
$pdf->SetStyle("a", "times", "BU", 9, "0,0,255");
$pdf->SetStyle("pers", "times", "I", 0, "255,0,0");
$pdf->SetStyle("place", "arial", "U", 0, "153,0,0");
$pdf->SetStyle("vb", "times", "B", 0, "102,153,153");
// Title
$txt = "<h1>Le petit chaperon rouge</h1>";
$pdf->SetLineWidth(0.5);
$pdf->SetFillColor(255, 255, 204);
$pdf->SetDrawColor(102, 0, 102);
$pdf->WriteTag(0, 10, $txt, 1, "C", 1, 5);
$pdf->Ln(15);
// Text
$txt = " \r\n<p>Il <vb>était</vb> une fois <pers>une petite fille</pers> de <place>village</place>, \r\nla plus jolie qu'on <vb>eût su voir</vb>: <pers>sa mère</pers> en <vb>était</vb> \r\nfolle, et <pers>sa mère grand</pers> plus folle encore. Cette <pers>bonne femme</pers> \r\nlui <vb>fit faire</vb> un petit chaperon rouge, qui lui <vb>seyait</vb> si bien \r\nque par tout on <vb>l'appelait</vb> <pers>le petit Chaperon rouge</pers>.</p> \r\n\r\n<p>Un jour <pers>sa mère</pers> <vb>ayant cuit</vb> et <vb>fait</vb> des galettes, \r\n<vb>lui dit</vb>: « <vb>Va voir</vb> comment <vb>se porte</vb> <pers>la mère-grand</pers>; \r\ncar on <vb>m'a dit</vb> qu'elle <vb>était</vb> malade: <vb>porte-lui</vb> une \r\ngalette et ce petit pot de beurre. »</p>\r\n \r\n<p><pers>Le petit Chaperon rouge</pers> <vb>partit</vb> aussitôt pour <vb>aller</vb> \r\nchez <pers>sa mère-grand</pers>, qui <vb>demeurait</vb> dans <place>un autre village</place>. \r\nEn passant dans <place>un bois</place>, elle <vb>rencontra</vb> compère <pers>le \r\nLoup</pers>, qui <vb>eut bien envie</vb> de <vb>la manger</vb>; mais il <vb>n'osa</vb> \r\nà cause de quelques <pers>bûcherons</pers> qui <vb>étaient</vb> dans \r\n<place>la forêt</place>.</p>\r\n";
$pdf->SetLineWidth(0.1);
$pdf->SetFillColor(255, 255, 204);
$pdf->SetDrawColor(102, 0, 102);
$pdf->WriteTag(0, 10, $txt, 1, "J", 0, 7);
$pdf->Ln(5);
// Signature
$txt = "<a href='http://www.pascal-morin.net'>Done by Pascal MORIN</a>";
$pdf->WriteTag(0, 10, $txt, 0, "R");
 */
 $sizeconteudo = '14';
 $sizeequipe = '14';
 //        $numAr = $_POST['num'];
 //        $flsAr = $_POST['fls'];
 //        $sobnumAr = $_POST['sobnum'];
 $numAr = "";
 $flsAr = "";
 $sobnumAr = "";
 //$certif = $xml->getElementsByTagName('certificado')->item(0);
 $participante = $xml->getElementsByTagName('participante')->item(0)->nodeValue;
 $conteudo = $xml->getElementsByTagName('conteudo')->item(0)->nodeValue;
 $equipe = $xml->getElementsByTagName('equipe')->item(0)->nodeValue;
 $textoPrincipal = $xml->getElementsByTagName('texto')->item(0)->nodeValue;
 $dataEvento = $xml->getElementsByTagName('dataEvento')->item(0)->nodeValue;
 $pdf = new PDF_WriteTag('L', 'mm');
 //Inicializa o PDF
 $pdf->SetAutoPageBreak(0);
 //$ordem = $_POST['ordem'];//Variavel contendo a ordem de impressao - 1=normal / 2=inverso
 $ordem = 1;
 //Cria os styles normal, negrito e negrito-italico
 $pdf->SetStyle("p", "arial", "N", 13, "0,0,0", 60);
 $pdf->SetStyle("b", "arial", "B", 13, "0,0,0");
 $pdf->SetStyle("bi", "arial", "BI", 13, "0,0,0");
 if ($ordem == '1') {
     paginaFrente($pdf, $participante, $textoPrincipal, $dataEvento);
     paginaTras($pdf, $sizeconteudo, $conteudo, $equipe, $sizeequipe, $sobnumAr, $numAr, $flsAr);
 } else {
     paginaTras($pdf, $sizeconteudo, $conteudo, $equipe, $sizeequipe, $sobnumAr, $numAr, $flsAr);
     paginaFrente($pdf, $participante, $textoPrincipal, $dataEvento);
 }
Exemple #5
0
        paginaFrente($pdf, $participante, $textoPrincipal, $tamanhoTexto);
        paginaTras($pdf, $conteudo, $equipe, $tamanhoEquipe, $tamanhoConteudo);
    } else {
        paginaTras($pdf, $conteudo, $equipe, $tamanhoEquipe, $tamanhoConteudo);
        paginaFrente($pdf, $participante, $textoPrincipal, $tamanhoTexto);
    }
    $pdf->Output("Certificado" . $i . ".pdf", "F");
    //Gera a pagina PDF
}
$zipname = './CertificadosPDF.zip';
$zip = new ZipArchive();
$zip->open($zipname, ZipArchive::CREATE);
$participantesArray = refinaArray($_POST['participantes']);
$i = 1;
foreach ($participantesArray as $p) {
    $pdf = new PDF_WriteTag('L', 'mm');
    //Inicializa o PDF
    $pdf->SetAutoPageBreak(0);
    //Cria os styles normal, negrito e negrito-italico
    $pdf->SetStyle("p", "arial", "N", 13, "0,0,0", 60);
    $pdf->SetStyle("b", "arial", "B", 13, "0,0,0");
    $pdf->SetStyle("bi", "arial", "BI", 13, "0,0,0");
    GeradorPDF($pdf, $p, trim($_POST['texto' . $i]), trim($_POST['conteudo' . $i]), trim($_POST['equipe']), '14', '14', '14', '1', $i);
    $zip->addFile("Certificado" . $i . ".pdf");
    $i++;
}
$zip->close();
//GERAR DOWNLOAD
header('Content-Type: application/zip');
header('Content-disposition: attachment; filename="certificados.zip"');
header('Content-Length: ' . filesize($zipname));