setPrintHeader(false); $pdf->setPrintFooter(false); // Adiciona página $pdf->AddPage(); // ============================================================ // IMAGEM DE FUNDO (base.png) // ============================================================ // Caminho da imagem de fundo (ajuste se necessário) $fundo_img = 'base.png'; // Verifica se a imagem existe if (file_exists($fundo_img)) { // Obtém as dimensões da página $page_width = $pdf->getPageWidth(); $page_height = $pdf->getPageHeight(); // Adiciona a imagem como fundo (ocupando toda a página) $pdf->Image($fundo_img, 0, 0, $page_width, $page_height, '', '', '', false, 300, '', false, false, 0); } else { // Se não encontrar a imagem, usa fundo branco $pdf->SetFillColor(255, 255, 255); $pdf->Rect(0, 0, $pdf->getPageWidth(), $pdf->getPageHeight(), 'F'); } // ============================================================ // CONFIGURAÇÕES DE TEXTO // ============================================================ // Margens do conteúdo (ajuste conforme sua imagem) $margin_left = 45; // 45pt $margin_top = 260; // 260pt - ajuste conforme sua imagem $margin_right = 45; $content_width = $pdf->getPageWidth() - $margin_left - $margin_right; // Define a fonte padrão $pdf->SetFont('helvetica', '', 9.5); // ============================================================ // PARÁGRAFO 1 (com tags HTML) // ============================================================ // Posiciona o cursor $pdf->setY($margin_top); // Escreve o primeiro parágrafo com HTML $html_paragrafo1 = '

' . $paragrafo1 . '

'; $pdf->writeHTML($html_paragrafo1, true, false, true, false, ''); // ============================================================ // PARÁGRAFO 2 // ============================================================ $html_paragrafo2 = '

' . $paragrafo2 . '

'; $pdf->writeHTML($html_paragrafo2, true, false, true, false, ''); // ============================================================ // TABELA DE PARTICIPANTES // ============================================================ $html_tabela = ' '; // Adiciona as linhas da tabela foreach ($participantes as $p) { $nome = htmlspecialchars($p['nome']); $cpf = htmlspecialchars($p['cpf']); $html_tabela .= ' '; } $html_tabela .= '
Nome CPF
' . $nome . ' ' . $cpf . '
'; // Escreve a tabela $pdf->writeHTML($html_tabela, true, false, true, false, ''); // ============================================================ // FINALIZA E GERA O PDF // ============================================================ // Fecha e gera o PDF $pdf->Output('atestado_brigada_incendio.pdf', 'D'); exit; ?>