Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3444622
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:56:19+00:00 2026-05-18T08:56:19+00:00

I want to generate PDF from a html doc in a rails app. So

  • 0

I want to generate PDF from a html doc in a rails app. So I decided to use wicked_pdf. But its not working. I tried to integrate it in an app, but it did not work. So I thought of trying to see if it works in the rails console then i will integrate it in the app.

Here’s what I came across in the console

wp = WickedPdf.new
=> #<WickedPdf:0x4e7eea0 @exe_path="C:\\wkhtmltopdf\\wkhtmltopdf.exe">
HTML_DOCUMENT = "<html><body>Hello World</body></html>"
=> "<html><body>Hello World</body></html>"
pdf = wp.pdf_from_string HTML_DOCUMENT
"***************C:\\wkhtmltopdf\\wkhtmltopdf.exe  - - ***************"
NotImplementedError: fork() function is unimplemented on this machine
    from C:/Ruby/lib/ruby/1.8/open3.rb:57:in `fork'
    from C:/Ruby/lib/ruby/1.8/open3.rb:57:in `popen3'
    from C:/Users/raw/Desktop/html/scheduler/vendor/plugins/wicked_pdf/lib/wicked_pdf.rb:22:in `pdf_from_string'
    from (irb):3

UPDATE: I am using Windows7

I am not able to figure out where I am going wrong.

Please help.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:56:20+00:00Added an answer on May 18, 2026 at 8:56 am

    Install the gem win32-open3

    gem install win32-open3
    

    And now Change line:6 in lib/wicked_pdf.rb

    require ‘open3’

    to

    require 'win32/open3'
    

    and line:20 in the same file

    command_for_stdin_stdout = "#{@exe_path} #{options} - - -q" 
    

    to

    command_for_stdin_stdout = "#{@exe_path} #{options} - -" 
    

    and now in console I get

    wp = WickedPdf.new
    => #<WickedPdf:0x4e65f70 @exe_path="C:\\wkhtmltopdf\\wkhtmltopdf.exe">
    
    ?> HTML_DOCUMENT = "<html><body>Hello World</body></html>"
    => "<html><body>Hello World</body></html>"
    
    ?> pdf = wp.pdf_from_string HTML_DOCUMENT
    "***************C:\\wkhtmltopdf\\wkhtmltopdf.exe  - - ***************"
    => "%PDF-1.4\n1 0 obj\n<<\n/Title (\376\377)\n/Producer (wkhtmltopdf)\n/CreationDate (D:20101127124137)\n>>\nendobj\n4 0 obj\n<<\n/Type /ExtGState\n/SA true\n/SM 0.02\n/ca 1.0\n/CA 1.0\n/AIS false\n/SMask /None>>\nendobj\n5 0 obj\n[/Pattern /DeviceRGB]\nendobj\n8 0 obj\n<<\n/Type /Catalog\n/Pages 2 0 R\n>>\nendobj\n6 0 obj\n<<\n/Type /Page\n/Parent 2 0 R\n/Contents 9 0 R\n/Resources 11 0 R\n/Annots 12 0 R\n/MediaBox [0 0 595 842]\n>>\nendobj\n11 0 obj\n<<\n/ColorSpace <<\n/PCSp 5 0 R\n/CSp /DeviceRGB\n/CSpg /DeviceGray\n>>\n/ExtGState <<\n/GSa 4 0 R\n>>\n/Pattern <<\n>>\n/Font <<\n/F7 7 0 R\n>>\n/XObject <<\n>>\n>>\nendobj\n12 0 obj\n[ ]\nendobj\n9 0 obj\n<<\n/Length 10 0 R\n/Filter /FlateDecode\n>>\nstream\nx\234\245\222QKÄ0\f\200ßó+ò,\×6ëÖ‚øàPÁa\254àƒø ;O9\274Ãy\017\376}ÓtÇ�\003\213`ÖåKÒ\264ɪ\273áß\016XuÃ'\216\263îÐJ\273\220\027j\226ÕX\257Èê\264ÐRM+tÜÁ\204\023ôÐó;é Ž\273j\221ø\207*×›\243\022Ý�\017\r)ÞÁ\023\233\037K\223È©`\264v\236\271>7Sð;<^à¾Xêè1\"KÏA\271ÐÖ\244\255\225\2643\223o$\224j$\207_\257\260IçþKÚï\247Édèøë-Þó\263ŧg\206ëâ5\256#T\267-\032\217qÃ÷\220\241d\025\271\205\270\2625Æ5^òPÌÆ-\230䜉\025\022N\200\004P\001Ôç)N@}\002M.ã
    9\255\000W(ãÜDil\376qLî¢ùo3Ó ÊØÃ\0177Ч\201endstream\nendobj\n10 0 obj\n271\nendobj\n13 0 obj\n<< /Type /FontDescriptor\n/FontName /QNAAAA+ArialRegular\n/Flags 4 \n/FontBBox [-594.726562 -290.527343 1790.03906 900.390625 ]\n/ItalicAngle 0 \n/Ascent 651.367187 \n/Descent -188.476562 \n/CapHeight 0 \n/StemV 65.4296875 \n/FontFile2 14 0 R\n>> endobj\n14 0 obj\n<<\n/Length1 3840 \n/Length 17 0 R\n/Filter /FlateDecode\n>>\nstream\nx\234\245W]l\024×>wgg×C0ÆkW\204p\rÄ?\024l\263Æ»ÆÄ8ÈD\245\030cc\e\0220\224\214wf\275cvgV\263\263^\257\241\205\2406BQ#\245\205\246\025êC‰\2226I[~ÒÚ”\246\250M\245<\264\225ÒH\225\252\242ÊM\213\232\206(U\037\"\265Ä?=÷ÜYgL(RÕ]Í�ïœ{î9ßùæÞY\030\000\224ÁiP\000ú‡Z¢+\242Gsèù*^O\216\245\213Ék\237Áø
    

    Take a look at this blog post for understanding it.
    Thanks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to generate PDF from a PHP file that includes HTML controls like
I want to be able to generate PDF output from my (native) C++ Windows
I'm currently using FOP to generate PDF from an XML file. But I am
I need to allow my clients to generate documents (DOC, PDF, etc) from a
I want to save a screenshot or generate a pdf from UIWebView text content.
I want to remove a blank page from a PDF generated using the iText
I want to generate a PDF file on server side, and then in response
I want to generate some formatted output of data retrieved from an MS-Access database
I have to generate a PDF with TCPDF, my information come from my database,
I want to generate a technical report from lisp (AllegroCL in my case) and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.