centos - Centos 6 64位上的pdftotext?

标签 centos hosting pdftotext xpdf centos6

我有一个 HostGator VPS 服务器,并且希望能够运行 pdftotextxpdf 的一部分(http://www.foolabs.com/xpdf/download.html)。

在我的 Mac 上测试后,它运行良好,所以我将它安装在我的 VPS 服务器上。

我按照安装说明进行操作,一切都完美无缺:

  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



然后我测试了它:
root@*** [~]# pdftotext
pdftotext: /lib64/libc.so.6: version `GLIBC_2.11' not found (required by pdftotext)

如您所见,它找不到/lib64/libc.so.6 . /lib64/libc.so.6但是,是否存在,如下所示:
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>.

然后我联系了 HostGator,他们告诉我它无法在我的服务器上运行,因为它找不到 /lib64/libc.so.6。 ,因此在 Centos 6 64 位上不可用。

如果确实如此,是否有任何替代 pdftotext 的方法?可以在此服务器上进行简单快速的转换吗? pdftotext 有可能吗?可以针对不同的版本进行编译,或者我使用权限错误地安装了它?

最佳答案

这些命令都不起作用:

yum install xpdf
yum install poppler-utils
xpdf 无论如何都会安装 poppler-utils 这将导致这个 pdftotext

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


这不是您想要的版本。你想要这个:

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


这将需要转到 www.xpdfreader.com然后点击“下载”。使用此页面中的最新版本来设置较新的 pdftotext 命令。
我实际上自己编译了源代码:
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
如果成功,您应该看到:

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


然后只需键入:
make
它应该以:

[100%] Built target pdftotext


然后输入
make install
现在,当您键入 pdftotext 时,您应该会看到:

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


注意:我为 pdftotext 4.03 版编写了所有代码。我花了一段时间才意识到 4.03 和 0.26 产生了截然不同的结果。

关于centos - Centos 6 64位上的pdftotext?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14823620/

相关文章:

php - shell_exec() 不执行 pdftotext 命令

java - 使用编码参数将 PdfToText 作为 Java 进程运行

python-3.x - python3.6安装uwsgi报错centos

python - 带有 flask 的 mod_wsgi 配置

mongodb - 庞大的 Mongo 数据集。我需要多少 RAM 以及如何避免因支付托管费用而被毁掉?

python - 托管中型 Python/Django 应用程序

pdf - 无需 pdftotext 将 PDF 转换为文本?

java - Centos 7 如何获取 java 的替代列表

javascript - 在 Linux CentOs 上运行 node.js 服务器

Linux Ubuntu 14.04 在 1 台机器 1 个 ip 上的 2 个不同的 Web 服务器上运行 2 个网站