设备#

Device

不同的格式处理器(如 pdf, xps 等)将页面解释为“设备”。设备是对页面进行所有操作的基础:渲染、文本提取和搜索。设备类型由所选的构造方法决定。

类 API

class Device#
__init__(self, object, clip)#

构造函数,用于像素图或显示列表设备。

参数:
  • object (PixmapDisplayList) – 可以是 PixmapDisplayList

  • clip (IRect) – 可选的 IRect,用于 Pixmap 设备,限制渲染在页面的特定区域。如果需要完整的页面,指定 None。对于显示列表设备,此参数必须省略。

__init__(self, textpage, flags=0)#

构造函数,用于文本页面设备。

参数:
  • textpage (TextPage) – TextPage 对象

  • flags (int) – 控制如何将文本解析到文本页面。目前,3 个选项可以编码到此参数中,参见 字体属性。要设置这些选项,可以使用类似 flags=0 | TEXT_PRESERVE_LIGATURES | … 的方式。

The different format handlers (pdf, xps, etc.) interpret pages to a “device”. Devices are the basis for everything that can be done with a page: rendering, text extraction and searching. The device type is determined by the selected construction method.

Class API


本软件按原样提供,不作任何明示或暗示担保。本软件根据许可分发,除非根据该许可条款明确授权,否则不得复制、修改或分发。请参阅 artifex.com 上的许可信息,或联系 Artifex Software Inc., 39 Mesa Street, Suite 108A, San Francisco CA 94129, United States 了解更多信息。