#140 new
Steve Alex

thin and PDFkit

Reported by Steve Alex | November 24th, 2010 @ 06:27 AM

Not sure if this is a PDFkit or thin problem, but thin will not serve pdfs generated with PDFKit and it seems to hang up the thin serer.

This is what I posted on the PDFkit site issues, but I may have to go look for another tool since this one seems to gone into a "I don't care anymore state" (no updates in months or anyone looking at issues).


I did find a post somewhere on the web that they could not get PDFkit to work with the Thin server. I searched the issues and saw no reference to thin - so I'll post an issue. It does not work, it just hangs up thin.

Trying various approaches and got a line in the thin.log

The switch --disable-smart-shrinking, is not support using unpatched qt, and will be ignored.The switch --print-media-type, is not support using unpatched qt, and will be ignored.

Than seems like more of a warning, but It just hangs the thin server and you have to kill it.

Don't know if this is an PDFKit issue or Thin issue

Comments and changes to this ticket

  • Marc-André Cournoyer

    Marc-André Cournoyer November 24th, 2010 @ 02:35 PM

    Hey Steve, try w/ another webserver like webrick or mongrel to see if you can reproduce. If you can, issue is in PDFKit. Although, the warning message you got in the log leads me to think it's a PDFKit issue, maybe you can look at http://prawn.majesticseacreature.com/ ?

  • Steve Alex

    Steve Alex November 26th, 2010 @ 08:53 AM

    I guess I should have read more carefully the other post where I found pdfkit was having problem with thin.


    The main comment:

    We use PDFKit to generate PDF exports, and PDFKit doesn't work with Thin for some reason. Requests for PDF versions of a page seem to hang indefinitely. On our development machines, running Mac OS X, it seems to work if we start Thin in threaded mode, but on Ubuntu this makes things unpredictable and often extremely slow to the extent where it is beyond unusable.

    It seems to work with the --threaded switch.

    It does work with webrick, have not tried mongrel. In looking at the code (and I in no way a ruby guru), there is not much there, it just sets up calls to wkhtmltopdf using middleware to allow a .pdf respond_to. It is really a neat concept. I've used prawn and it is great, but this is so much easier for simple things.

    Guess you can close this and if someone else has a problem, just refer to threaded.


  • Julien Guimont

    Julien Guimont January 5th, 2011 @ 09:47 PM

    I have the same problem. I change the server to mongrel and it works, back to thin and it hangs.

    Code is straight forward on pdfkit side https://github.com/jdpace/PDFKit/blob/master/lib/pdfkit/middleware....

    I know thin is try to send data back to the client as soon as it can. Can this be the issue? Pdfkit is pipping the html to a wkhtmltopdf and I think that partial data can screw this up.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »