After running into difficulty with Prawn I have decided to use PDFKit. In doing so I followed the following link:
Rails 3 + PDFKit: How to convert a view to PDF?
The problem is that my ruby on rails application is quite unusual in that it doesnt seem to follow the usual structure. In the link it says to place the following in the initializer:
require 'pdfkit'
middleware.use PDFKit::Middleware
PDFKit.configure do |config|
config.wkhtmltopdf = 'windows_path_to_wkhtmltopdf'
end
Where would i place this? I have an app.rb file which i tried to place this in but got the following error:
undefined method `use' for [[Sass::Plugin::Rack, [], nil]]:Array
The stacktrace points to the line:
middleware.use PDFKit::Middleware