RasterizedPage
RasterizedPage
概述
RasterizedPage 是 Aspose.PDF FOSS 中用于 Python 的类。
已渲染的 PDF 页面,采用打包的 RGB 格式。
此类提供 4 种方法,用于在 Python 程序中处理 RasterizedPage 对象。可用的方法包括:get_pixel、save、to_png、to_tiff。在安装 Aspose.PDF FOSS for Python 包后,所有公共成员均可供任何 Python 应用程序访问。属性:dpi、height、pixels、width。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
width | int | 读取 | 获取宽度。 |
height | int | 读取 | 获取高度。 |
pixels | bytes | 读取 | 获取像素。 |
dpi | float | 读取 | 获取 DPI。 |
方法
| 签名 | 描述 |
|---|---|
get_pixel(x: int, y: int) → Color | 返回位于 (x, y) 的 RGB 像素,原点位于左上角。 |
to_png() → bytes | 将此栅格编码为 PNG 文件。 |
to_tiff() → bytes | 将此栅格编码为未压缩的基线 RGB TIFF 文件。 |
| `save(path: str | Path)→Path` |