title: Using knp snappy bundle to generate pdf - symfony2
body: <p>I'm new to symfony2 and very to use external libraries.
  I want to use the <a href="https://github.com/KnpLabs/KnpSnappyBundle" rel="nofollow">KNP Snappy Bundle</a>, my first third party bundle.</p>
  
  <p>I did exactly that is told in the git link.</p>
  
  <pre><code>{
      "require": {
          "knplabs/knp-snappy-bundle": "dev-master"
      }
  }
  </code></pre>
  
  <p>// app/AppKernel.php</p>
  
  <pre><code>public function registerBundles()
  {
      $bundles = array(
          //...
          new Knp\Bundle\SnappyBundle\KnpSnappyBundle(),
  </code></pre>
  
  <p>app/config/config.yml</p>
  
  <pre><code>knp_snappy:
      pdf:
          enabled:    true
          binary:     /usr/local/bin/wkhtmltopdf
          options:    []
      image:
          enabled:    true
          binary:     /usr/local/bin/wkhtmltoimage
          options:    []
  </code></pre>
  
  <p>Then I added following line in <strong>ACME</strong> welcome controller to test</p>
  
  <pre><code>$this-&gt;get('knp_snappy.pdf')-&gt;generate('http://www.google.fr', '/Symfony/file.pdf');
  </code></pre>
  
  <p>It says <strong><code>The exit status code '1' says something went wrong:
  stderr: "The system cannot find the path specified.
  "
  stdout: ""
  command: /usr/local/bin/wkhtmltoimage --format "jpg" "http://www.google.fr" "/Symfony/file.pdf".</code></strong></p>
  
  <p>I tried</p>
  
  <pre><code>$this-&gt;get('knp_snappy.pdf')-&gt;generateFromHtml(
      $this-&gt;renderView(
          'AcmeDemoBundle:Welcome:index.html.twig'),
          '/Symfony/file.pdf'
      );
  </code></pre>
  
  <p>It shows <strong><code>The exit status code '1' says something went wrong:
  stderr: "The system cannot find the path specified.
  "
  stdout: ""
  command: /usr/local/bin/wkhtmltopdf --lowquality "C:\Windows\TEMP\knp_snappy530da4525584b8.92211088.html" "/Symfony/file.pdf".</code></strong></p>
  
  <p>What I'm missing? Do I need to install anything ? Please describe how can I run it and generate a proper pdf????? I searched, I'm guessing I need to install wkhtmltoimage etc. But from where and how?</p>