title: Rails 4 , Heroku, PDF Generation, PDFkit
body: <p>I am trying to make a flyer creator app and am having a hard time getting the page to save as a pdf.</p>
  
  <p>After doing a bit of googling I found a couple options and landed on pdfkit. The rails casts video made it look very simple, then like always, being on a windows machine, I found it didn't exactly apply. I have tried a ton of tutorials but am still unable to get my local environment working.</p>
  
  <p>I eventually would like to deploy this solution to heroku and that seams to also require some extra steps.</p>
  
  <p>My gems include,</p>
  
  <pre><code>gem "pdfkit"
  </code></pre>
  
  <p>my application.rb includes </p>
  
  <pre><code>config.middleware.use "PDFKit::Middleware", :print_media_type =&gt; true
  </code></pre>
  
  <p>I have in my /config/initializers I have pdfkit.rb that contains </p>
  
  <pre><code>PDFKit.configure do |config|
    config.wkhtmltopdf = 'C:/wkhtmltopdf/bin/wkhtmltopdf.exe'
    config.default_options = {
      :page_size =&gt; 'Legal',
      :print_media_type =&gt; true
    }
  end
  </code></pre>
  
  <p>Is there anything else needed I may have missed?</p>
  
  <p>I have seen the gem "wkhtmltopdf-binary" referenced in some tutorials, do I need this gem? what is it doing?</p>
  
  <p>I have installed the wkhtmltopdf application all over my computer at this point, I saw one tutorial that placed the install in the actual root of the app, in the root of my C: drive and elsewhere. Even when I think I got this part right at best I got the message </p>
  
  <pre><code>"Exit with code 1 due to network error: ContentNotFoundError"
  </code></pre>
  
  <p>I would really like some help getting PDFKit to work on my local environment, and then deploy that solution to heroku. Can anyone help?</p>
  
  <p>I can show any code snippets needed I am just unsure what would be helpful. </p>
  
  <p>In case it helps anyone here is a link to my work in progress site / an example page that I would like turned into a pdf.</p>
  
  <p><a href="http://www.easyflyerceator.com/carpet_cleaning_flyers/1/carpet_cleaning1s/4" rel="nofollow">http://www.easyflyerceator.com/carpet_cleaning_flyers/1/carpet_cleaning1s/4</a></p>