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。

属性

名称类型访问描述
widthint读取获取宽度。
heightint读取获取高度。
pixelsbytes读取获取像素。
dpifloat读取获取 DPI。

方法

签名描述
get_pixel(x: int, y: int) → Color返回位于 (x, y) 的 RGB 像素,原点位于左上角。
to_png() → bytes将此栅格编码为 PNG 文件。
to_tiff() → bytes将此栅格编码为未压缩的基线 RGB TIFF 文件。
`save(path: strPath)→Path`

另请参阅

 中文