Ruby On Rails : PdfKit Runtime Error

68 views
Skip to first unread message

BalaRaju Vankala

unread,
Jan 16, 2013, 7:43:07 AM1/16/13
to rubyonra...@googlegroups.com
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

1. In gem file
     gem 'pdfkit'
2.  In config/application.rb
     I add this code
     "config.middleware.use "PDFKit::Middleware", :print_media_type => true
3. In show.html.erb
 I added this code
<p id="pdf_link"><%= link_to "Download Invoice (PDF)", order_path(@order, :format => "pdf") %></p>

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



Inline image 1


What should I do if  I want to correct output.
Thanks in Advance


----------------------------------------------------------------------------------------------------
Thank You.

Best Wishes,
 
BalaRaju Vankala,



Screenshot from 2013-01-16 17:59:01.png
Screenshot from 2013-01-16 17:48:39.png

BalaRaju Vankala

unread,
Jan 16, 2013, 7:44:54 AM1/16/13
to rubyonra...@googlegroups.com
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

1. In gem file
     gem 'pdfkit'
2.  In config/application.rb
     I add this code
     "config.middleware.use "PDFKit::Middleware", :print_media_type => true
3. In show.html.erb
 I added this code
<p id="pdf_link"><%= link_to "Download Invoice (PDF)", order_path(@order, :format => "pdf") %></p>

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



Inline image 1


What should I do if  I want  correct output.
Screenshot from 2013-01-16 17:59:01.png
Screenshot from 2013-01-16 17:48:39.png

amit gupta

unread,
Jun 18, 2013, 8:26:07 AM6/18/13
to rubyonra...@googlegroups.com


On Tue, Jun 18, 2013 at 8:22 AM, amit gupta <amit...@gmail.com> wrote:
Comment out the below line from application.rb file.
     "config.middleware.use "PDFKit::Middleware", :print_media_type => true

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


Screenshot from 2013-01-16 17:59:01.png
Screenshot from 2013-01-16 17:48:39.png

amit gupta

unread,
Jun 18, 2013, 8:22:42 AM6/18/13
to rubyonra...@googlegroups.com
Comment out the below line from application.rb file.
     "config.middleware.use "PDFKit::Middleware", :print_media_type => true
On Wed, Jan 16, 2013 at 7:44 AM, BalaRaju Vankala <foreve...@gmail.com> wrote:
Screenshot from 2013-01-16 17:48:39.png
Screenshot from 2013-01-16 17:59:01.png
Reply all
Reply to author
Forward
0 new messages