title: Symfony 2 KnpSnappy Bundle Error
body: <p>I m trying to implement Knp SNappy Bundle to display an html page as a pdf from my controller.
  I'm stuck with this error : </p>
  
  <pre><code>The exit status code '1' says something went wrong:
  stderr: "Loading pages (1/6)
  [&gt; ] 0%
  [======&gt; ] 10%
  [==========&gt; ] 18%
  Warning: Failed to load file:///slick/slick.css (ignore)
  Warning: Failed to load file:///slick/slick-theme.css (ignore)
  Warning: Failed to load file:///clovis-app/style.css (ignore)
  Warning: Failed to load file:///clovis-app/estimate.css (ignore)
  Warning: Failed to load file:///clovis-app/res/clovis.png (ignore)
  Warning: Failed to load file:///js/collection.js (ignore)
  Warning: Failed to load file:///clovis-app/script.js (ignore)
  Warning: Failed to load file:///clovis-app/estimate.js (ignore)
  [============================================================] 100%
  Counting pages (2/6)
  [============================================================] Object 1 of 1
  Resolving links (4/6)
  [============================================================] Object 1 of 1
  Loading headers and footers (5/6)
  Printing pages (6/6)
  [&gt; ] Preparing
  [===================&gt; ] Page 1 of 3
  [=======================================&gt; ] Page 2 of 3
  [============================================================] Page 3 of 3
  Done
  Exit with code 1 due to network error: ContentOperationNotPermittedError"    
  stdout: ""
  
  command: "C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe" --lowquality "C:\Users\Razgort\AppData\Local\Temp\knp_snappy55ae6cc4ad0353.17775155.html" "C:\Users\Razgort\AppData\Local\Temp\knp_snappy55ae6cc4ad41d0.64896673.pdf". 
  </code></pre>
  
  <p>Here is my configuration file : </p>
  
  <pre><code>knp_snappy:
  pdf:
      enabled:    true
      binary:     "\"C:\\Program Files\\wkhtmltopdf\\bin\\wkhtmltopdf.exe\""
      options:    []
  image:
      enabled:    true
      binary:     "\"C:\\Program Files\\wkhtmltopdf\\bin\\wkhtmltoimage.exe\""
      options:    []
  </code></pre>
  
  <p>and here is how i render the view : </p>
  
  <pre><code>        $html =  $this-&gt;renderView('CompanyBundle:Estimate:edit.html.twig', array(
          'estimate' =&gt; $estimate,
          'estimateForm'   =&gt; $estimateForm-&gt;createView(),
          'articleForm' =&gt; $articleForm-&gt;createView(),
          'articleSelectForm' =&gt; $articleSelectForm-&gt;createView(),
          'manpowerForm' =&gt; $manpowerForm-&gt;createView(),
          'manpowerSelectForm' =&gt; $manpowerSelectForm-&gt;createView(),
          'workSelectForm' =&gt; $workSelectForm-&gt;createView(),
          'workForm' =&gt; $workForm-&gt;createView(),
          'bundleForm' =&gt; $bundleForm-&gt;createView(),
          'bundleSelectForm' =&gt; $bundleSelectForm-&gt;createView(),
      ));
      return new Response(
          $this-&gt;get('knp_snappy.pdf')-&gt;getOutputFromHtml($html),
          200,
          array(
              'Content-Type'          =&gt; 'application/pdf',
              'Content-Disposition'   =&gt; 'attachment; filename="file.pdf"'
          )
      );
  </code></pre>
  
  <p>I eard there is problems on MAMP, i use wamp, didn't see any issue with it.
  I'll really appreciate some help on this =)</p>
  
  <p>Edit : </p>
  
  <p>I modified some things in order to generate a pdf first. And i did. But the pdf only contents my login page. Then i added the access to my session and it worked. But when i try to send it as a response like that :</p>
  
  <pre><code>        $session = $this-&gt;get('session');
      $session-&gt;save();
      session_write_close();
  
      $pageUrl = $this-&gt;generateUrl('estimate_preview', array('id' =&gt; $id), true);
      return new Response(
          $this-&gt;get('knp_snappy.pdf')-&gt;getOutput($pageUrl, array('cookie' =&gt; array($session-&gt;getName() =&gt; $session-&gt;getId()))),
          200,
          array(
              'Content-Type'          =&gt; 'application/pdf',
              'Content-Disposition'   =&gt; 'attachment; filename="file.pdf"'
          )
      );
  </code></pre>
  
  <p>it doesn't seem to work either... Does someone have an idea why ?</p>