本文介绍了由于poppler无法在Windows上安装pdftotext的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Windows上安装pdftotext:

I am trying to install pdftotext on windows:

pip install pdftotext

最初失败是因为缺少MS Visual Studio(现已安装),现在失败了,并出现了poppler问题.我已经下载了poppler并将其安装在

It failed originally because of lack of MS visual studio (now installed) and now it fails with a poppler problem. I have downloaded poppler and it is installed in

C:\Program Files (x86)\poppler

我的路径包括此目录.

安装失败并显示错误

The install fails with an error

我在程序文件(x86)中找不到文件poppler-cpp.lib

I cannot find the file poppler-cpp.lib in Program Files (x86)

我知道安装poppler是有问题的,网络上有很多与此有关的问题,并且似乎完全是我的问题(2018年7月19日标记),但似乎没有提供解决方案.我已经在Linux上安装了它,它的工作就像一个梦.但是,我也需要在Windows上工作.

I know that installing poppler is problematic and there are many questions on the web relating to it and one seems to be my problem exactly (mark on 19 July 2018), but no solution seems to have been offered. I have it installed on linux and it works like a dream. But, I need to have working on Windows too.

有人可以帮我解决这个问题吗?

Can someone please help me to sort this out?

[EDIT 2018.09.17我在此处找到了对它的引用:

[EDIT 2018.09.17 I have found a reference to it here:

这会帮助某人来帮助我吗?

Does this help someone to come to my aid?

推荐答案

我在完全一样的条件下苦苦挣扎,无法编译解决方案.

I struggled with exactly the same and wasn't able to compile a solution.

我正在使用的变通办法是运行pdftotext.exe,该文件随miktex 2.9一起安装(我已经将其用于乳胶).

A workaround I'm using is running pdftotext.exe which is installed with miktex 2.9 (I'm already using this for latex).

在安装miktex之后,确定pdftotext.exe的路径.然后,您可以使用子流程模块运行它.

Identify the path to pdftotext.exe after installing miktex. Then you can run it with the subprocess module.

Import subprocess
Subprocess.call([path/pdftotext.exe,
options, file.pdf])

使用所需的选项切换选项.

Switch options with the option you need.

这篇关于由于poppler无法在Windows上安装pdftotext的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-09 03:09