命令行 - 在 Windows 与 Ubuntu 服务器中使用 pdftotext



在我的Windows 7 PC上,命令行输入"pdftotext myfile.pdf"在与myfile.pdf相同的目录中创建一个.txt文件。 但是,当我使用相同的 myfile.pdf 在我的 ubuntu-12.04 服务器上尝试相同的命令行输入时,我得到的错误输出如下:

Error: May not be a PDF file (continuing anyway)
Error (2): Illegal character <21> in hex string
Error (4): Illegal character <4f> in hex string
Error (6): Illegal character <54> in hex string
Error (7): Illegal character <59> in hex string
Error (8): Illegal character <50> in hex string
Error (11): Illegal character <48> in hex string
Error (12): Illegal character <54> in hex string
Error (13): Illegal character <4d> in hex string
Error (14): Illegal character <4c> in hex string
Error (16): Illegal character <50> in hex string
Error (17): Illegal character <55> in hex string
Error (19): Illegal character <4c> in hex string
Error (20): Illegal character <49> in hex string
Error (23): Illegal character <22> in hex string
Error (24): Illegal character <2d> in hex string
Error (25): Illegal character <2f> in hex string
Error (26): Illegal character <2f> in hex string
Error (27): Illegal character <57> in hex string
Error (30): Illegal character <2f> in hex string
Error (31): Illegal character <2f> in hex string
Error (33): Illegal character <54> in hex string
Error (36): Illegal character <48> in hex string
Error (37): Illegal character <54> in hex string
Error (38): Illegal character <4d> in hex string

等等...

Error (122): Illegal character <6c> in hex string
Error: PDF file is damaged - attempting to reconstruct xref table...
Error: Couldn't find trailer dictionary
Error: Couldn't read xref table

Windows 7 pdf实用程序包是否与Linux上可用的软件包(来自Poppler)不同? 否则,相同的调用应该产生相同的结果,不是吗?

这是因为您尝试作为输入的文件不是PDF文件。

它以(空格是未知字符)开头

 ! O TYP  HTML PU LI  "-//W  // T  HTM

。可以快速(?)解释为...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML

所以这很可能是下载PDF的错误页面。无论哪种情况,它都是 HTML 文件,而不是 PDF。

相关内容

  • 没有找到相关文章

最新更新