Converting Twitter bootstrap page into PDF with wkhtmltopdf : span issue

Here is solution for Bootstrap3: Use .col-xs-n always. The reason is wkhtmltopdf didnt support css in @media block. In bootstrap3, only col-xs-n rule outside @media block. I’ve checked the bootstrap2.3.2 css, seems spanN rules always be inside @media block. So an ugly solution would be copied out all spanN rules into top level to another … Read more

Why does PDFKit/wkhtmltopdf hang but renders PDF as expected when Rails app is killed?

The problem is with wkhtmltopdf itself, specifically, any version after 0.9.9. wkhtmltopdf hangs when run directly from the command-line. Steps to correct: brew uninstall wkhtmltopdf cd /usr/local/Library/Formula/ git checkout 6e2d550 /usr/local/Library/Formula/wkhtmltopdf.rb brew install wkhtmltopdf Then verify the correct version is installed wkhtmltopdf –version which should yield wkhtmltopdf 0.9.9 Citations: https://github.com/mileszs/wicked_pdf/issues/110 http://wearepandr.com/blog/article/homebrew-and-installing-old-package-versions#blog_nav

use custom fonts with wkhtmltopdf

Since it is a Google Web font you need not to write @font-face in you style sheet just use following link tag in your source code: <link href=”http://fonts.googleapis.com/css?family=Jolly+Lodger” rel=”stylesheet” type=”text/css”> and <style type = “text/css”> p { font-family: ‘Jolly Lodger’, cursive; } </style> will work. By the way, in your code you are defining @font-face … Read more

wkhtmltopdf with full page background

wkhtmltopdf v 0.11.0 rc2 What ended up working: wkhtmltopdf –margin-top 0 –margin-bottom 0 –margin-left 0 –margin-right 0 <url> <output> shortens to wkhtmltopdf -T 0 -B 0 -L 0 -R 0 <url> <output> Using html from stdin (Note dash) echo “<h1>Testing Some Html</h2>” | wkhtmltopdf -T 0 -B 0 -L 0 -R 0 – <output> Using … Read more

How to install wkhtmltopdf with patched qt?

This straightforward solution (no need to install xvfb, neither compiling QT neither wkhtmltopdf) works like a charm on my Debian Jessie server : cd mytmpfolder wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz sudo tar xvf wkhtmltox-0.12.4_linux-generic-amd64.tar.xz sudo mv wkhtmltox/bin/wkhtmlto* /usr/bin/ #create simple html test file echo “<html><body>test</body></html>” >> test.html #perform conversion sudo wkhtmltopdf –disable-smart-shrinking –lowquality –enable-external-links –enable-internal-links test.html test.pdf

tech