绑定到poppler-qt5的python

python-poppler-qt5的Python项目详细描述


libpoppler-qt5的一个python绑定,其目标是完整性和 积极维护。

由wilbert berendsen<;wbsoft@xs4all.nl>;创建和当前维护。

主页:https://pypi.python.org/pypi/python-poppler-qt5/

用法:

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

文档

Python API紧跟PopQuter Qt5 C++接口库API, 记录在http://people.freedesktop.org/~aacid/docs/qt5/

注意:Pyqt5<;5.4版本当前不支持qtXML模块, 使用qdomdocument、qdomelement和qdomnode类型的所有方法都是 已禁用。这涉及到Document::toc()方法和一些构造函数 以及Annotation子类中的store()方法。所以,使用 建议Pyqt5>;=5.4。

C++的API需要^ {TT4} $,^ {Tt5} $或^ {TT6}$,任何 可以使用python序列。 api调用返回QListQSetQLinkedListall返回python 名单。

还有其他一些区别:

Poppler::Document::getPdfVersion(int *major, int *minor)可以是 称为d.getPdfVersion(),(其中dPoppler::Document 实例);它将返回一个由两个整数组成的元组(major、minor)。

Poppler::Document__len____getitem__方法,对应 到numPages()page(int num)

Poppler::FontIterator(由Poppler::Document::newFontIterator返回) 也是一个python iterable(例如有__iter__()__next__()方法)。 因此,尽管您可以使用:

it = document.newFontIterator()
while it.hasNext():
    fonts = it.next()  # list of FontInfo objects
    ...

您也可以使用更具Python性的:

for fonts in document.newFontIterator():
    ...

除了poppler名称空间之外,还有两个顶级模块 功能:

^{tt23}$
returns the version of the ^{tt24}$ package as a tuple of ints, e.g. ^{tt25}$.
^{tt26}$

returns the version of the linked Poppler-Qt5 library as a tuple of ints, e.g. ^{tt27}$.

This is determined at build time. If at build time the Poppler-Qt5 version could not be determined and was not specified, an empty tuple might be returned.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
用于批量操作的java RESTful API分块响应   java读取在线存储的文本文件   在Java ME中将双精度舍入到小数点后5位   java查找一个数字的最接近因子   java更改JMenuBar的字体   java Kmeans聚类算法运行时间和复杂性   java是否可以阻止try catch返回null   java内容解析器指向具有正确URI的错误表   java Android Kotlin插装测试未被识别为插装测试   java TestNG@Dataprovider   在forloop和print语句中声明变量时发生java错误   java在Android Studio 3中设置JNI