pypoppler shouldn't always require X11 to be running

Bug #1163236 reported by Jim Minter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Poppler Python Bindings
New
Undecided
Unassigned

Bug Description

TL;DR: I believe the following should work when the DISPLAY environment variable is unset, but it doesn't appear to.

$ python -c 'import poppler; d=poppler.document_new_from_file("file:///path/to/file.pdf", None); print d.get_n_pages()'
10
$ DISPLAY= python -c 'import poppler; d=poppler.document_new_from_file("file:///path/to/file.pdf", None); print d.get_n_pages()'
ImportError: could not import gtk.gdk
Traceback (most recent call last):
  File "<string>", line 1, in <module>
AttributeError: '__main__.PopplerDocument' object has no attribute 'get_n_pages'

At the moment, using pypoppler to do anything useful requires X to be running - this shouldn't be a hard requirement. For example, the program pdftotext (part of poppler) doesn't require X running to extract text from PDF files -- why should pypoppler?

The knock-on effect is that AFAICS pypoppler can't currently be easily used as a server-side process to handle PDF files.

$ rpm -q python pypoppler
python-2.7.3-13.fc18.x86_64
pypoppler-0.12.1-22.fc18.x86_64

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.