Question

I have a HostGator VPS server, and want to be able to run pdftotext, part of xpdf (http://www.foolabs.com/xpdf/download.html).

After testing this out on my Mac, it worked fine, so I went to installing it on my VPS server.

I followed the installation instructions and it all isntalled flawlessly:

  1. Copy the executables (xpdf, pdftotext, etc.) to to /usr/local/bin.

  2. Copy the man pages (*.1 and *.5) to /usr/local/man/man1 and /usr/local/man/man5.

  3. Copy the sample-xpdfrc file to /usr/local/etc/xpdfrc

Then I tested it out:

root@*** [~]# pdftotext
pdftotext: /lib64/libc.so.6: version `GLIBC_2.11' not found (required by pdftotext)

So as you can see, it couldn't find /lib64/libc.so.6. /lib64/libc.so.6 is there, however, as shown by this:

root@*** [~]# /lib64/libc.so.6
GNU C Library stable release version 2.5, by Roland McGrath et al.
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.1.2 20080704 (Red Hat 4.1.2-52).
Compiled on a Linux 2.6.9 system on 2012-03-19.
Available extensions:
        The C stubs add-on version 2.1.2.
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        GNU libio by Per Bothner
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
        Native POSIX Threads Library by Ulrich Drepper et al
        BIND-8.2.3-T5B
        RT using linux kernel aio
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.

I then contacted HostGator, where they told me that it will not work on my server, as it can't find /lib64/libc.so.6, and is therefor not available on Centos 6 64bit.

If this is indeed true, are there any alternatives to pdftotext that do a simple and fast conversion that would work on this server? Is it possible that the pdftotext can be complied for a different version, or that I installed it incorrectly with permissions?

No correct solution

OTHER TIPS

Neither of these commands will work:

yum install xpdf
yum install poppler-utils

xpdf will install poppler-utils anyway and this will result in this pdftotext

pdftotext version 0.26.5 Copyright 2005-2014 The Poppler Developers - http://poppler.freedesktop.org Copyright 1996-2011 Glyph & Cog, LLC

This is not the version you want. You want this one:

pdftotext version 4.03 [www.xpdfreader.com] Copyright 1996-2021 Glyph & Cog, LLC

This will require going to www.xpdfreader.com and then clicking on "Download". Use the latest versions from this page to set up the newer pdftotext command.

I actually compiled the sources myself:

cd /tmp
wget https://dl.xpdfreader.com/xpdf-4.03.tar.gz
tar -xf xpdf-4.03.tar.gz
cd xpdf-4.03
mkdir build
cmake -DCMAKE_BUILD_TYPE=Release

If successful you should see:

-- Configuring done -- Generating done -- Build files have been written to: /tmp/xpdf-4.03

Then just type:

make

It should end with:

[100%] Built target pdftotext

Then type

make install

Now when you type pdftotext you should see:

pdftotext version 4.03 [www.xpdfreader.com] Copyright 1996-2021 Glyph & Cog, LLC

Note: I wrote all my code for pdftotext version 4.03. Took me a while to realise 4.03 and 0.26 produce vastly different results.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top