This is OT but have not been able to get a response elsewhere (stack overflow and the project site itself) so thought someone here might know or have some ideas.
First, I am using wkhtmltopdf stand alone without any of the rails gems as I found that for some reason using WickedPdf or PdfKit my pdf’s did not generate with active links from the links from those in the html. When I run wkhtmltopdf from the console, I get good, active links.
I am running production on Ubuntu 10.04 Server. I need whhtmltopdf to work without an X Server (as I have no gui there). The wkhtmltopdf static binary is said to have a patched QT that will allow this. However I have not been able to get the static binary to work. These are the results the steps I took to install:
Result: Once installed (see steps below), when I execute wkhtmltopdf in the terminal, it does not fire up… just returns me to the prompt - like it ran and did something, but with no error but no output:
:/usr/bin$ wkhtmltopdf
:/usr/bin$
Same behavior if I put args:
:/usr/bin$ wkhtmltopdf http://www.google.com test.pdf
:/usr/bin$
Am I doing something wrong — my understanding that the static binary should just fire up. Perhaps missing some dependency? Is there a way to get some verbose output?
These are the steps I have followed:
In /usr/bin:
Confirmed that the existing (non-static) wkhtmltopdf resides there and that it executes. When I execute it with no args I get the help/about output from the app.
Moved the existing wkhtmltopdf out of the directory (renamed it)
I am running production on Ubuntu 10.04 Server. I need whhtmltopdf to
work without an X Server (as I have no gui there). The wkhtmltopdf
static binary is said to have a patched QT that will allow this.
However I have not been able to get the static binary to work. These
are the results the steps I took to install:
Result: Once installed (see steps below), when I execute wkhtmltopdf
in the terminal, it does not fire up... just returns me to the
prompt - like it ran
[...]
In /usr/bin:
1) Confirmed that the existing (non-static) wkhtmltopdf resides there
and that it executes. When I execute it with no args I get the
help/about output from the app.
Don't install anything manually in /usr/bin. That directory belongs to
your system (Ubuntu). Use /usr/local (or /usr/opt in special cases) for
your own stuff.
2) Moved the existing wkhtmltopdf out of the directory (renamed it)
Don't. Just deinstall it.
3) Get the static binary: sudo curl -C - -O http: //
wkhtmltopdf.googlecode.com/files/wkhtmltopdf-0.9.9-static-i386.tar.bz
2
4) Untar: tar xvjf wkhtmltopdf-0.9.9-static-i386.tar.bz2
Sanitiy check: is the unpacked binary executable? What do you get if you
start it with its complete path: /usr/local/bin/wkhtmltopdf-i386?
5) Rename: mv wkhtmltopdf-i386 wkthtmltopdf
Do this in /usr/local/bin and instead of renaming just add a symlink.
Do you get this impression from
Google Code Archive - Long-term storage for Google Code Project Hosting. ? That page
describes how to *compile* the binary for yourself, something you don't
need to do. You probably already have installed openssl, but you won't
need the other packages. They don't hurt either (apart from taking up
space).
Finally, do you get any output from
$ /usr/local/bin/wkhtmltopdf-i386
If you don't get anything, try
$ strace /usr/local/bin/wkhtmltopdf-i386
to get a trace of system calls the program is executing. You may need to
install the strace package for that.
Michael - thanks, and for the reminder on usr/bin…
Sanitiy check: is the unpacked binary executable? What do you get if you
start it with its complete path: /usr/local/bin/wkhtmltopdf-i386?
That is the rub… when I run this I get no error but no love either, it just gives me a new command prompt. As if I was executing a program that has no functionality:
Could that last line be the problem?
When I check /lib I have /lib/ld-linux-x86-64.so.2
But not /lib/ld-linux.so.2
Are you sure that the i386-binary is the correct one for your system?
If you're running a 64-bit Linux, the amd64 tarball is the right one for
you. No matter if you have an Intel or AMD CPU! The naming is like that
for "historical" reasons, I reckon, as it was AMD who introduced this
extension of the original i386/IA-32 architecture.
Michael - you’re the man! It was the amd binary. I had thought I tried that yesterday but must have made a mistake. And yes, I did use strace to get that output – good thing to know about.