{"id":1557,"date":"2022-08-30T15:17:31","date_gmt":"2022-08-30T15:17:31","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/27\/problem-about-wicked-pdf-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:17:31","modified_gmt":"2022-08-30T15:17:31","slug":"problem-about-wicked-pdf-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/problem-about-wicked-pdf-collection-of-common-programming-errors\/","title":{"rendered":"problem about wicked-pdf-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b5e935da7b67c03dd56f385b031f485c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nUnixmonkey<br \/>\njquery ruby-on-rails-3 pdf-generation wicked-pdf<br \/>\nI&#8217;m using Highcharts in my application to render charts. Everything works fine, except when I want to convert a page that has charts to PDF. I&#8217;m using wicked_pdf. Here is the show method my controller:format.pdf dorender :pdf =&gt; &#8220;report&#8221;,:template =&gt; &#8220;\/quarters\/report.pdf.erb&#8221;,endMy \/quarters\/report.pdf.erb file looks like it does in my show.html.erb for highcharts:&lt;div id=&#8221;testcollections&#8221; style=&#8221;width: 600px;&#8221;&gt;&lt;\/div&gt;&lt;!&#8211; jQuery for testing collections charts &#8211;&gt; &lt;scr<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b5e935da7b67c03dd56f385b031f485c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nUnixmonkey<br \/>\nruby-on-rails ruby pdf-generation wicked-pdf<br \/>\nI&#8217;m using WickedPDF in my Rails app to generate PDF files. It&#8217;s working great on my local machine. In production I&#8217;m seeing the following error in my log:Started GET &#8220;\/financieel\/facturen\/2.pdf&#8221; for 81.205.74.167 at 2012-09-19 14:58:37 +0200Processing by InvoicesController#show as PDFParameters: {&#8220;id&#8221;=&gt;&#8221;2&#8221;} ***************WICKED*************** Rendered invoices\/show.pdf.haml (6.9ms) Completed 500 Internal Server Error in 38msNoMethodError (undefined method `chomp&#8217; for nil:NilClass):app\/contro<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/815ee86e14bbedd4f353cad0680c7be5?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMat<br \/>\nruby pdf-generation wkhtmltopdf wicked-pdf<br \/>\nI&#8217;m getting this error while generating pdf using wkhtmltopdfundefined method `pdf_from_string&#8217; for #&lt;WickedPdf:0x7f4b82a369c8&gt;my wicked_pdf.rbWickedPdf.config = {:wkhtmltopdf =&gt; &#8216;\/usr\/local\/bin\/wkhtmltopdf&#8217;, :layout =&gt; &#8220;pdf.html&#8221;, :margin =&gt; { :top=&gt; 40,:bottom =&gt; 20,:left=&gt; 30,:right =&gt; 30}, :header =&gt; {:html =&gt; { :template=&gt; &#8216;layouts\/pdf_header.html&#8217;}}, :footer =&gt; {:html =&gt; { :template=&gt; &#8216;layouts\/pdf_footer.html&#8217;}} # :exe_path =&gt; &#8216;\/usr\/bin\/wk<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f8a33fa45e5082d77a2e5f9d84019ebc?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nnbucciarelli<br \/>\nruby-on-rails ruby-on-rails-3 wicked-pdf<br \/>\nI&#8217;m having an issue with wicked_pdf. It&#8217;s not taking into account any of my javascript. The report is being generated and the text that is rendered is &#8220;Page undefined of undefined&#8221;. Any help on linking up javascript into wicked_pdf would be greatly appreciated!Markup:&lt;html&gt;&lt;head&gt;&lt;script&gt;function number_pages() {console.log(&#8216;hi&#8217;);var vars={};var x=document.location.search.substring(1).split(&#8216;&amp;&#8217;);for(var i in x) {var z=x[i].split(&#8216;=&#8217;,2);vars[z[0]] = unescape(z[1]);}var x=[&#8216;fr<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/07123541fba3343f9ddb5876595b99a7?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAlex<br \/>\nruby-on-rails-3 pdf wicked-pdf<br \/>\nOur platform has been online for a while and working just fine. Our customers are able to download their invoices in PDF format just fine.We&#8217;ve been working on a upgrades for a few month, and just today we noticed that &#8220;suddenly&#8221; non of our PDF generation with wicked_pdf and wkhtmltopdf no longer worked&#8230;I have absolutely no idea why, I checked everything I could think of: &#8211; routes &#8211; initializers &#8211; gems &#8211; etc.Everything seems to be fine, same as the actual only version.We have not changed Rails<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/23eb68bbf88d89a4631ce98a0673fffd?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser532339<br \/>\nruby-on-rails ruby-on-rails-3 wicked-pdf<br \/>\nI am trying to attach my PDF to an email. However when I click the link I am given the following error undefiined method &#8216;user&#8217; I have the following setup: Controllerdef index@hospital_bookings = HospitalBooking.scopedhospital_booking = @hospital_bookings@user = User.allif params[:format] == &#8220;pdf&#8221;@hospital_bookings = @hospital_bookings.where(:day =&gt; Date.today.beginning_of_month..Date.today.end_of_month)endrespond_to do |format|format.htmlformat.pdf dorender :pdf =&gt; &#8220;#{Date.today.strftime(<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ed8f887a17c59818aaa250ed68cc4632?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\njoelmaranhao<br \/>\nruby-on-rails heroku wicked-pdf<br \/>\nI am trying to generate PDF reports with wicked_pdf gem. THe PDF generation works fine on my development environment, but it fails once it&#8217;s deployed on HerokuThis is the error I am getting:Failed to execute:\/app\/.bundle\/gems\/ruby\/1.9.1\/bin\/wkhtmltopdf &#8211;header-font-name &#8216;Century Gothic&#8217; &#8211;header-left &#8216;My Test &#8211; Neuffen, Germany&#8217; &#8211;header-right &#8216;2012-02-05 15:50:57 -0800&#8217; &#8211;header-font-size 14 &#8211;header-line &#8211;footer-center &#8216;Generated by Biowatts &#8211; http:\/\/biowatts.org&#8217; &#8211;footer-font-name &#8216;Centur<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/33fb8e02a6e6e253a9a35254fb152a5a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKashiftufail<br \/>\nruby-on-rails wicked-pdf<br \/>\nHi i am using wicked_pdf for generating images after i save image when i generate pdf and used this tag for display image like this&lt;%= wicked_pdf_image_tag(@image.snap.url(:original)) unless @image.blank? %&gt;it give me this unknown errorActionView::Template::Error (undefined method `pathname&#8217; for nil:NilClass):while puts @image.inspect give me right path below&#8221;\/system\/snaps\/7\/original\/flake.jpg&#8221;Can any one helpThanks&#8230;.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/29b28b6350cb857f69694c419bf13260?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndbaruah<br \/>\nruby-on-rails ruby centos wkhtmltopdf wicked-pdf<br \/>\nI am using Ubuntu 11.04 to develop an app in Ruby on Rails. In the app I need to generate pdf documents. So I am using the wicked_pdf and wkhtmltopdf-binary gems.In the development environment in my system everything is working fine. But once I deployed the app in production on CentOS 5.6 using Phusion Passenger, when I try to generate pdfs on the fly its giving me the following error:RuntimeError (Location of wkhtmltopdf unknown)I am using Ruby1.9.2.p136Rails 3.1.1Any help will be much appreci<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2013-11-27 05:11:23. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Unixmonkey jquery ruby-on-rails-3 pdf-generation wicked-pdf I&#8217;m using Highcharts in my application to render charts. Everything works fine, except when I want to convert a page that has charts to PDF. I&#8217;m using wicked_pdf. Here is the show method my controller:format.pdf dorender :pdf =&gt; &#8220;report&#8221;,:template =&gt; &#8220;\/quarters\/report.pdf.erb&#8221;,endMy \/quarters\/report.pdf.erb file looks like it does in my show.html.erb [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1557","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1557","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1557"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1557\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}