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 8377995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:49:04+00:00 2026-06-09T15:49:04+00:00

I’m generating pdf with gem pdfkit (successfully) only issue that I have is that

  • 0

I’m generating pdf with gem pdfkit (successfully) only issue that I have is that my pdf links are pure text (with color doh) but I cannot click on them

Generated pdf file:
http://bit.ly/MZBdmL

the HTML

<h2>links</h2>
<p>
<a href="http://google.com" title="">google.com</a>
</p>
<p>
<a href="http://github.com">github</a>
</p>
<p>
<br>
</p>
<p>
<a href="http://google.sk" title="">http://google.com</a>
<br>
</p>

Am I missing some option in pdfkit or wkhtmltopdf ?

wkhtmltopdf version 0.9.9
pdfkit gem version  0.5.2

the way I’m generating pdf:

class DocumentController < ApplicationController

  def download
    @document = Document.last  #just example
    #...
    kit = PDFKit.new(@document.content.html_safe, :page_size => 'Letter')
    kit.stylesheets << "#{Rails.root}/app/assets/stylesheets/pdf.css"
    send_data kit.to_pdf, :filename => "#{@document.title}.pdf", :type => 'application/pdf'
  end
end

—————————————————————————–

Solution:

As @Nenotlep sugested in answer below, the solution was in reinstalling wkhtmltopdf. The version that I had before was from Ubuntu sources (lazy Synaptic instalation).

So I downloaded wkhtmltopdf-0.11.0_rc1-static-amd64.tar.bz2 (i386 if you’re not on 64bit platform) from official site http://code.google.com/p/wkhtmltopdf/downloads/list and extract it to

 ~/.rvm/gems/ruby-1.9.3-p194@my_project_gemset/bin 

so you’ll get executable

 ~/.rvm/gems/ruby-1.9.3-p194@my_project_gemset/bin/wkhtmltopdf

restart server & done

note 1
The wkhtmltopdf manual suggest to place wkhtmltopdf static file anywhere my $PATH is pointing to. I was trying to put it in /usr/locale/bin however that doesn’t work. As you see I use RVM. The file must be in specific gemset bin folder

note 2

on the download page are also files for wkhtmltoimage. Don’t be dumb enough like me to install that and wonder why it’s not working 🙂

  • 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-06-09T15:49:05+00:00Added an answer on June 9, 2026 at 3:49 pm

    Right off the bat I would recommend trying to install wkhtmltopdf by hand like it says in the Install part of the pdfkit homepage. That way you would get the latest version of wkhtmltopdf (0.11.0 rc2), which might fix many problems. (The changelog doesn’t seem to have this issue listed though, so it might not fix whatever is the problem here.)

    And as always with wkhtmltopdf issues one step that really helps in figuring out issues is doing the conversion by hand in the command line, that way you can make sure that the problem is with wkhtmltopdf and not the wrapper and also you get nicer feedback for what you are doing.

    Sorry this isn’t answering your question directly.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I have a reasonable size flat file database of text documents mostly saved in
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.