title: Install wkhtmltopdf on heroku using a java application
body: <p>I manged to get my spring boot website online on Heroku. But I also use wkhtmltopdf to create a pdf. This works locally but now I have some problems.</p>
  
  <p>Offline it works as follow :</p>
  
  <pre><code>        ProcessBuilder pb = new ProcessBuilder
                  ("cmd.exe",
                          "/c",
                          " cd C:\\Program Files\\wkhtmltopdf\\bin &amp;&amp; wkhtmltopdf.exe "
                  + "http://google.com C:\\MainWebApps\\TestApp\\src\\main\\resources\\userstorage\\Google2.pdf");
  </code></pre>
  
  <p>But how do I install this on Heroku?</p>
  
  <p>Where do I store the temporarily html page so I can create a pdf from it ?</p>
  
  <p>And where is wkhtmltopdf installed on Heroku ?</p>
  
  <p>Can I call the wkhtmltopdf with a processbuilder on heroku?</p>
  
  <p><strong>EDIT</strong> </p>
  
  <p>So after the comment of ceejayoz I googled a bit more and did find some interesting stuff.</p>
  
  <p>So for Compile the binaries on Heroku I used this:</p>
  
  <pre><code>heroku run /bin/bash
  </code></pre>
  
  <p>Then I did a curl of wkhtmltopdf like this:</p>
  
  <pre><code>curl -O http://download.gna.org/wkhtmltopdf/0.12/0.12.0/wkhtmltox-linux-amd64_0.12.0-03c001d.tar.xz 
  </code></pre>
  
  <p>Then I tried to extract it on the server but without success: </p>
  
  <pre><code> $ tar -xjvf wkhtmltox-linux-amd64_0.12.0-03c001d.tar.xz
  tar (child): wkhtmltox-linux-amd64_0.12.0-03c001d.tar.xz: Cannot open: No such file or directory
  tar (child): Error is not recoverable: exiting now
  tar: Child returned status 2
  
  tar: Error is not recoverable: exiting now
  </code></pre>
  
  <p><strong>EDIT2</strong></p>
  
  <p>I also found this <a href="https://github.com/dscout/wkhtmltopdf-buildpack" rel="nofollow noreferrer">https://github.com/dscout/wkhtmltopdf-buildpack</a> on github.</p>
  
  <p>So I did following :</p>
  
  <pre><code> heroku buildpacks:set 'https://github.com/heroku/heroku-buildpack-multi.git'
   echo 'https://github.com/dscout/wkhtmltopdf-buildpack.git' &gt;&gt; .buildpacks
  </code></pre>
  
  <p>This created a file named .buildpacks but how do I proceed from there on ?</p>
  
  <p>I also found this post but vulcan is deprecated and uses ruby
  <a href="https://stackoverflow.com/questions/15118273/using-wkhtmltopdf-with-nodejs-on-heroku">Using Wkhtmltopdf with Nodejs on Heroku</a></p>
  
  <p>Can somebody provide me with good information because I am completely stuck with this?</p>