绑定到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如何确保在ActivityfromStaticMethodNewInstance中创建片段   java什么是允许集合的线程安全列表实现。分类   java正则表达式,用于检查字符串是否为正自然数   java Selenium WebDriver getText()   JSF(AWS)下的java Springboot白标签错误页面   java禁用特定URL Spring的基本身份验证   字符串无法转换为int!如何在java上对扫描的整数求和?   java创建键值对象列表   java Gradle with TestNg:未找到任何测试   java在Spark之外加载Mllib模型   当值存在时,比较器Java树映射为键返回null   java如何在Travis上使用Maven构建RPM包?   使用socket上传安卓 Java文件,需要上传文件的百分比?   java同步两个水平滚动视图   java通过扫描仪读取日期类型的字段