{"id":1536,"date":"2022-08-30T15:17:21","date_gmt":"2022-08-30T15:17:21","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/27\/wickedpdf-stoped-working-on-my-local-system-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:17:21","modified_gmt":"2022-08-30T15:17:21","slug":"wickedpdf-stoped-working-on-my-local-system-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/wickedpdf-stoped-working-on-my-local-system-collection-of-common-programming-errors\/","title":{"rendered":"WickedPdf stoped working on my local system-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;m getting this error while generating pdf using wkhtmltopdf<\/p>\n<pre><code>undefined method `pdf_from_string' for #\n<\/code><\/pre>\n<p>my wicked_pdf.rb<\/p>\n<pre><code>WickedPdf.config = {\n\n:wkhtmltopdf =&gt; '\/usr\/local\/bin\/wkhtmltopdf',\n:layout =&gt; \"pdf.html\",\n:margin =&gt; {    :top=&gt; 40,\n                :bottom =&gt; 20,\n                :left=&gt; 30,\n                :right =&gt; 30},\n:header =&gt; {:html =&gt; { :template=&gt; 'layouts\/pdf_header.html'}},\n:footer =&gt; {:html =&gt; { :template=&gt; 'layouts\/pdf_footer.html'}}\n# :exe_path =&gt; '\/usr\/bin\/wkhtmltopdf'}\n<\/code><\/pre>\n<p>on command line<\/p>\n<pre><code>wkhtmltopdf google.com google.pdf \n<\/code><\/pre>\n<p>is working fine.<\/p>\n<p>Can anyone please suggest what should I do to solve this error?<\/p>\n<ol>\n<li>\n<p>&#8220;pdf_from_string&#8221; means, that it makes pdf from STRING. So to make this method work it should recieve string.<\/p>\n<pre><code>  -  it is an object. \n<\/code><\/pre>\n<p>It should look like this:<\/p>\n<pre><code>pdf_from_string(\"<br \/>some html code<br \/><br \/>\")\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-27 05:07:39. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m getting this error while generating pdf using wkhtmltopdf undefined method `pdf_from_string&#8217; for # my wicked_pdf.rb WickedPdf.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; [&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-1536","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1536","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=1536"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1536\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}