~ubuntu-branches/debian/sid/python-poppler-qt4/sid

« back to all changes in this revision

Viewing changes to README.rst

  • Committer: Package Import Robot
  • Author(s): Anthony Fok
  • Date: 2015-09-02 02:57:58 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20150902025758-e6hy7jbboeoy1yq2
Tags: 0.24.0-1
* New upstream release. (Closes: #758108)
* Revamp package with py2dsc (python-stdeb), pybuild and friends.
* Add new python3-poppler-qt4 binary package for Python 3.
* Convert debian/copyright to machine-readable format v1.0.
* Bump Standards-Version to 3.9.6, no changes needed.
* Promote "Debian Python Modules Team" as Maintainer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
==================
 
2
python-poppler-qt4
 
3
==================
 
4
 
 
5
A Python binding for libpoppler-qt4 that aims for completeness and for being
 
6
actively maintained.
 
7
 
 
8
Created and currently maintained by Wilbert Berendsen <wbsoft@xs4all.nl>.
 
9
 
 
10
Homepage: https://pypi.python.org/pypi/python-poppler-qt4/
 
11
 
 
12
 
 
13
Usage::
 
14
 
 
15
    import popplerqt4
 
16
    d = popplerqt4.Poppler.Document.load('file.pdf')
 
17
 
 
18
 
 
19
Documentation
 
20
-------------
 
21
 
 
22
The Python API closely follows the Poppler Qt4 C++ interface library API,
 
23
documented at http://people.freedesktop.org/~aacid/docs/qt4/ .
 
24
 
 
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
 
28
lists.
 
29
 
 
30
There are a few differences:
 
31
 
 
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).
 
35
 
 
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::
 
39
 
 
40
    it = document.newFontIterator()
 
41
    while it.hasNext():
 
42
        fonts = it.next()  # list of FontInfo objects
 
43
        ...
 
44
 
 
45
you can also use the more Pythonic::
 
46
 
 
47
    for fonts in document.newFontIterator():
 
48
        ...
 
49
 
 
50
In addition to the Poppler namespace, there are two toplevel module
 
51
functions:
 
52
 
 
53
    ``popplerqt4.version()``
 
54
        returns the version of the ``python-poppler-qt4`` package as a
 
55
        tuple of ints, e.g. ``(0, 18, 2)``.
 
56
    
 
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)``.
 
60
        
 
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.
 
64