KnpSnappyBundle PDF generation exceeds maximum execution time
<p>I'm trying to generate a PDF with <a href="https://github.com/KnpLabs/KnpSnappyBundle" rel="nofollow noreferrer">KnpSnappyBundle</a> in Symfony, but whenever I attempt to run the action to do so, it exceeds the maximum 60 second execution time in PHP.</p>

<p>Here is the action:</p>

<pre><code>/**
* @Route("/download-agreement", name="download_agreement")
*/
public function downloadAgreementAction()
{
    $session = new Session();
    $html = $this-&gt;renderView('client-representation.html.twig', array(
        'clientAgreementData'  =&gt; $session-&gt;get("sessionClientAgreementData"),
        "pdfStatus" =&gt; true
        ));

    return new Response(
        $this-&gt;get('knp_snappy.pdf')-&gt;getOutputFromHtml($html),
        200,
        array(
            'Content-Type'          =&gt; 'application/pdf',
            'Content-Disposition'   =&gt; 'attachment; filename="error.pdf"'
            )
        );
}
</code></pre>

<p>It also only seems to exceed the execution time when I use absolute urls for assets in the twig template, like <code>absolute_url(asset('css/agreement.css'))</code>. If I use relative urls, then the css will just get ignored and the PDF will generate, but of course I need the styling.</p>

<p>Any ideas?</p>

<p>EDIT: For anyone who has this problem, using absolute urls SHOULD work on a production server; on localhost however, you may get the problem I had. Thank you to <a href="https://stackoverflow.com/a/34755410/3597216">chalasr</a>.</p>