我正在使用Xpdf's pdftotext从Ubuntu上的一些希伯来语pdf文件中获取文本。
在我的本地机器上工作得很好。然后,我尝试在另一台机器上这样做,而在文本文件中没有出现希伯来文字符。我验证了我有语言包(见下面为什么我这么认为)。我还能在哪里找出问题呢?
>> tail -2 /etc/xpdf/xpdfrc
include /etc/xpdf/includes
>> cat /etc/xpdf/includes
# This file was automatically generated by /usr/sbin/update-xpdfrc.
# Instead, add or remove files in /etc/xpdf/ then run
# /usr/sbin/update-xpdfrc to regenerate this file.
include /etc/xpdf/xpdfrc-latin2
include /etc/xpdf/xpdfrc-thai
include /etc/xpdf/xpdfrc-greek
include /etc/xpdf/xpdfrc-turkish
include /etc/xpdf/xpdfrc-arabic
include /etc/xpdf/xpdfrc-hebrew
include /etc/xpdf/xpdfrc-cyrillic
>> cat /etc/xpdf/xpdfrc-hebrew
#----- begin Hebrew support package (2003-feb-16)
unicodeMap ISO-8859-8 /usr/share/xpdf/hebrew/ISO-8859-8.unicodeMap
unicodeMap Windows-1255 /usr/share/xpdf/hebrew/Windows-1255.unicodeMap
#----- end Hebrew support package
>> ls /usr/share/xpdf/hebrew/
ISO-8859-8.unicodeMap Windows-1255.unicodeMap发布于 2010-05-25 21:47:45
幸运的是,友好的Ubuntu使安装语言变得很容易。只需将此命令输入shell:
sudo apt-get install language-support-he language-pack-he您将注意到它将希伯来文支持添加到其他许多子系统(例如HSpell、My拼写和PostgreSQL ),并安装了一些希伯来字体。
为了达到良好效果,请安装以下希伯来文字体:
sudo apt-get install culmus culmus-fancy xfonts-efont-unicode xfonts-efont-unicode-ib xfonts-intl-european msttcorefonts最后,确保在运行pdftotext时,指定UTF-8编码格式,因为它可能不会自动检测到源:
pdftotext -enc UTF-8 input.pdf output.txt发布于 2010-09-16 10:04:59
您应该看看TET,文本提取工具包 by PDFlib.com (由Thomas运行,"PostScript和PDF圣经“的作者)。
TET主要是一个库,可以在其他PDF处理应用程序中使用,但它们也.
这一个可以从PDF(墨水)中提取非ASCII文本。CJK,希伯来语,阿拉伯语),恢复他们原来的字符对或三人组的连接符号,通常它围绕Adobe自己的文本提取功能运行.
它可用于Windows、Linux、Mac和各种Unix系统。
https://serverfault.com/questions/145256
复制相似问题