javascript - javascript_delay throwing error in wicked_pdf - Stack Overflow

Environment:-Ruby - 1.9.3 ,Rails - 4.0.0I am generating pdf using wicked_pdf gem.For this, I used bel

Environment:- Ruby - 1.9.3 , Rails - 4.0.0

I am generating pdf using wicked_pdf gem.

For this, I used below code in my controller:-

respond_to do |format|
    format.html
    format.pdf do
        render :pdf => 'contractors_data',
               :javascript_delay => 5000,
               :disposition => 'attachment',
               :template => 'tiles/templates/pdf/contractors.pdf.erb',
               :header => { :right => 'Page [page] of [topage]' }

end

In this pdf, I am generating a graph using $.plot method of javascript/jquery. So I want to wait pdf generator to wait till $.plot not respond and not plot graph over pdf.

I am sure and confirmed that javascript and jquery are working on this page as I used using wicked_pdf_javascript_link_tag for this.

Now I used :javascript_delay => 5000 in respond_to format option. But it is throwing error in generating while :redirect_delay => 5000 are working properly.

I tries this in cmd prompt also. I am getting error on cmd similar to GUI working.

Please answer with good solution. If possible, please provide code also for reference.

Environment:- Ruby - 1.9.3 , Rails - 4.0.0

I am generating pdf using wicked_pdf gem.

For this, I used below code in my controller:-

respond_to do |format|
    format.html
    format.pdf do
        render :pdf => 'contractors_data',
               :javascript_delay => 5000,
               :disposition => 'attachment',
               :template => 'tiles/templates/pdf/contractors.pdf.erb',
               :header => { :right => 'Page [page] of [topage]' }

end

In this pdf, I am generating a graph using $.plot method of javascript/jquery. So I want to wait pdf generator to wait till $.plot not respond and not plot graph over pdf.

I am sure and confirmed that javascript and jquery are working on this page as I used using wicked_pdf_javascript_link_tag for this.

Now I used :javascript_delay => 5000 in respond_to format option. But it is throwing error in generating while :redirect_delay => 5000 are working properly.

I tries this in cmd prompt also. I am getting error on cmd similar to GUI working.

Please answer with good solution. If possible, please provide code also for reference.

Share Improve this question edited Oct 17, 2013 at 11:31 RohitPorwal asked Oct 17, 2013 at 11:25 RohitPorwalRohitPorwal 1,0651 gold badge15 silver badges23 bronze badges 3
  • @Mark : This is the error:- "Failed to execute: "C:\Program Files\wkhtmltopdf\wkhtmltopdf.exe" --header-right "Page [page] of [topage]" --javascript-delay 500 "file:///C:/Users/Admin/AppData/Local/Temp/wicked_pdf20131018-4048-iz9tz4.html" "C:/Users/Admin/AppData/Local/Temp/wicked_pdf_generated_file20131018-4048-12zmugm.pdf" Error: PDF could not be generated! Command Error: Unknown long argument --javascript-delay Name: wkhtmltopdf 0.9.9 Synopsis: wkhtmltopdf [OPTIONS]" – RohitPorwal Commented Oct 18, 2013 at 11:12
  • maybe related: stackoverflow./questions/15837932/… – Raidri Commented Oct 18, 2013 at 12:06
  • 1 wicked-pdf is just a thin wrapper for wkhtmltopdf. That error means that your version of wkthmtltopdf does not have the javascript-delay option. Check it's version, it's probably out of date. – Mark Commented Oct 18, 2013 at 12:45
Add a ment  | 

1 Answer 1

Reset to default 8

As I said in my ment, your version of wkhtmltopdf is outdated. The javascript-delay option was introduced in version 0.10.0. Here's the manual for 0.9.9, you'll see no such option.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744311390a4567964.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信