5
A Python binding for libpoppler-qt4 that aims for completeness and for being
8
Created and currently maintained by Wilbert Berendsen <wbsoft@xs4all.nl>.
10
Homepage: https://pypi.python.org/pypi/python-poppler-qt4/
16
d = popplerqt4.Poppler.Document.load('file.pdf')
22
The Python API closely follows the Poppler Qt4 C++ interface library API,
23
documented at http://people.freedesktop.org/~aacid/docs/qt4/ .
25
Whereever the C++ API requires ``QList``, ``QSet`` or ``QLinkedList``, any
26
Python sequence can be used.
27
API calls that return ``QList``, ``QSet`` or ``QLinkedList`` all return Python
30
There are a few differences:
32
``Poppler::Document::getPdfVersion(int *major, int *minor)`` can simply be
33
called as ``d.getPdfVersion()``, (where ``d`` is a ``Poppler::Document``
34
instance); it will return a tuple of two integers (major, minor).
36
``Poppler::FontIterator`` (returned by ``Poppler::Document::newFontIterator``)
37
is also a Python iterable (e.g. has ``__iter__()`` and ``__next__()`` methods).
38
So although you can use::
40
it = document.newFontIterator()
42
fonts = it.next() # list of FontInfo objects
45
you can also use the more Pythonic::
47
for fonts in document.newFontIterator():
50
In addition to the Poppler namespace, there are two toplevel module
53
``popplerqt4.version()``
54
returns the version of the ``python-poppler-qt4`` package as a
55
tuple of ints, e.g. ``(0, 18, 2)``.
57
``popplerqt4.poppler_version()``
58
returns the version of the linked Poppler-Qt4 library as a
59
tuple of ints, e.g. ``(0, 24, 5)``.
61
This is determined at build time. If at build time the Poppler-Qt4
62
version could not be determined and was not specified, an empty
63
tuple might be returned.