0
I am using PHP 5.4.43 in a Symfony 2.3.36 application and my PDF is coming blank. Solicitacaopdf.html.Twig
Test 1
Solicitacaocontroller.php
/**
 * @Route("/solicitacaopdf")
 */
public function solicitacaopdfAction()
{
    // CONFIGURANDO O DomPDF
    // Configure o Dompdf de acordo com suas necessidades
    $pdfOptions = new Options();
    $pdfOptions->set('defaultFont', 'Arial');
    // GERANDO O PDF DO HTML
    $dompdf = new Dompdf($pdfOptions);
    // ISSO VAI SUBIR, ENTRAR NO LUGAR DO HTML POSTERIORMENTE
    // Recupere o HTML gerado em nosso arquivo twig
    $html = $this->renderView("LabBundle::Solicitacao/solicitacaopdf.html.twig", array(
        'title' => "e-SUS Laboratório"
    ));
    $dompdf->loadHtml($html);
    // (Optional) Setup the paper size and orientation
   // $dompdf->setPaper('A4', 'landscape');
    // Renderizar o HTML como PDF
    $saidaPdf = $dompdf->output();
    // ENVIANDO O PDF. POSSA SER QUE PRECISE MUDAR ALGUMAS COISAS PARA FAZER DOWNLOAD. MAS O BÁSICO É ISSO AQUI
    $response = new Response($saidaPdf);
    $response->headers->set('Content-Type', 'application/pdf');
    return $response;
}
I’m not sure how to fix it. Thank you.
