KnpLabs / KnpSnappyBundle

Easily create PDF and images in Symfony by converting html using webkit
http://knplabs.com
MIT License
1.24k stars 143 forks source link

Corrupted file generated #220

Closed qeude closed 3 years ago

qeude commented 6 years ago

Hello, I'm trying to use KnpSnappyBundle in my Symfony4 project. I'm actually able to translate my twig in pdf by using the command line with wkhtmltopdf but when I use KnpSnappy, the generated file is corrupted ... Here is my call in my controller :

     $html = $this->renderView('metier/fiche/fiche.html.twig', [
        'metier' => $this->getFirstApiResult($metierCall),
        'softskills' => $this->getSecondApiResult($skillsCall)->skills,
    ]);

    return new PdfResponse(
        $this->get('knp_snappy.pdf')->getOutputFromHtml($html),
        'file.pdf'
    );

Ask if you need more details. Thanks. :)

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.