ImagePlacement
ImagePlacement
概述
ImagePlacement 是 Aspose.PDF FOSS 中用于 Python 的类。
表示放置在 PDF 页面上的图像。
此类提供 4 种方法,用于在 Python 程序中处理 ImagePlacement 对象。可用的方法包括:__init__、hide、replace、save。安装 Aspose.PDF FOSS for Python 包后,所有公共成员对任何 Python 应用程序均可访问。属性:bits_per_component、color_space、height、image_data、matrix、name,以及另外 5 项。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
image_data | bytes | 读取 | 返回当前图像负载。 |
rectangle | Rectangle | 读取 | 页面上图像的边界矩形(x、y、宽度、高度,单位为 PDF 点)。 |
resolution | tuple[float, float] | 读取 | 图像分辨率为 (horizontal_dpi, vertical_dpi)。 |
rotation | int | 读取 | 旋转角度(单位为度)(0, 90, 180, 270)。 |
matrix | tuple[float, float, float, float, float, float] | 读取 | PDF 变换矩阵 (a, b, c, d, e, f)。 |
width | `int | None` | 读取 |
height | `int | None` | 读取 |
bits_per_component | `int | None` | 读取 |
color_space | `str | None` | 读取 |
name | `` | 读取 | 获取名称。 |
page_index | `` | 读取 | 获取页面索引。 |
方法
| 签名 | 描述 |
|---|---|
| `init(name: str, image_data: bytes | bytearray, page_index: int, rect: Rectangle |
| `replace(new_image_data: bytes | bytearray)` |
| `save(path: str | os.PathLike, color_space: str |
hide() | 隐藏图像位置。 |