Search code examples
pythonqt5poppler

Python poppler Qt5 Document load error


Though the documentation at pypi clearly states

d = popplerqt5.Poppler.Document.load('file.pdf')

doing so results in the following error:

TypeError: Document.load(): argument 1 has unexpected type 'str'

I'm using Debian Testing.

python3             : 3.4.3-7
python3-pyqt5       : 5.5.1+dfsg-3
libpoppler-qt5-1    : 0.26.5-4
python3-poppler-qt5 : 0.24.2-1+b1

Minimum working Example:

>>> from popplerqt5 import Poppler as PDF
>>> doc = PDF.Document.load( "trial.pdf" )
Traceback (most recent call last):
  File "<console>", line 1, in <module>
TypeError: Document.load(): argument 1 has unexpected type 'str'

Solution

  • Apparently this is the issue with package in debian. I tried compiling from source. This worked fawlessly. I will be filing a bugreport with debian.

    Update: This problem has been fixed in version 0.24.2-1+b2