Hello Every One,
I am using PdfKit to download as a PDF in my application. I did it in the following way but it didn’t worked for me
-
In gem file
gem ‘pdfkit’
-
In config/application.rb
I add this code
"config.middleware.use “PDFKit::Middleware”, :print_media_type => true
- In show.html.erb
I added this code
<%= link_to “Download Invoice (PDF)”, order_path(@order, :format => “pdf”) %>****
But the problem is
PdfKit gem successfully installed in my machine. Then I run gem install wkhtmltopdf-binary
and output was
Well, then tried to access the pdf version of my page. But it also showed me an error
Runtime Error ControllerName#show
What should I do if I want to correct output.
Thanks in Advance
Hello Every One,
I am using PdfKit to download as a PDF in my application. I did it in the following way but it didn’t worked for me
-
In gem file
gem ‘pdfkit’
-
In config/application.rb
I add this code
"config.middleware.use “PDFKit::Middleware”, :print_media_type => true
- In show.html.erb
I added this code
<%= link_to “Download Invoice (PDF)”, order_path(@order, :format => “pdf”) %>****
But the problem is
PdfKit gem successfully installed in my machine. Then I run gem install wkhtmltopdf-binary
and output was
Well, then tried to access the pdf version of my page. But it also showed me an error
Runtime Error ControllerName#show
What should I do if I want correct output.
Thanks in Advance
Comment out the below line from application.rb file.
"config.middleware.use “PDFKit::Middleware”, :print_media_type => true