forked from frescobaldi/python-poppler-qt4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
49 lines (31 loc) · 1.28 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
python-poppler-qt4
==================
A Python binding for libpoppler-qt4 that aims for completeness and for being
actively maintained.
Created and currently maintained by Wilbert Berendsen <wbsoft@xs4all.nl>.
Homepage: https://pypi.python.org/pypi/python-poppler-qt4/
Usage:
======
import popplerqt4
d = popplerqt4.Poppler.Document.load('file.pdf')
Documentation:
==============
The Python API closely follows the Poppler Qt4 C++ interface library API,
documented at http://people.freedesktop.org/~aacid/docs/qt4/ .
Whereever the C++ API requires QList, QSet or QLinkedList, any Python sequence
can be used. API calls that return QList, QSet or QLinkedList all return Python
lists.
There are a few differences:
Poppler::Document::getPdfVersion(int *major, int *minor) can simply be called as
d.getPdfVersion() [where d is a Poppler::Document instance]; it will return
a tuple of two integers (major, minor).
Poppler::FontIterator (returned by Poppler::Document::newFontIterator) is also
a Python iterable (e.g. has __iter__() and __next__() methods). So although you
can use:
it = document.newFontIterator()
while it.hasNext():
fonts = it.next() # list of FontInfo objects
...
you can also use the more Pythonic:
for fonts in document.newFontIterator():
...