ImagePlacement
Overview
ImagePlacement is a class in Aspose.PDF FOSS for Python.
Represent an image placed on a PDF page.
This class provides 4 methods for working with ImagePlacement objects in Python programs.
Available methods include: __init__, hide, replace, save.
All public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package.
Properties: bits_per_component, color_space, height, image_data, matrix, name, and 5 more.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
image_data | bytes | Read | Return the current image payload. |
rectangle | Rectangle | Read | Bounding rectangle of the image on the page (x, y, width, height in PDF points). |
resolution | tuple[float, float] | Read | Image resolution as (horizontal_dpi, vertical_dpi). |
rotation | int | Read | Rotation angle in degrees (0, 90, 180, 270). |
matrix | tuple[float, float, float, float, float, float] | Read | PDF transformation matrix (a, b, c, d, e, f). |
width | int | None | Read | Pixel width from the image XObject, when known. |
height | int | None | Read | Pixel height from the image XObject, when known. |
bits_per_component | int | None | Read | Bits per colour component, when known. |
color_space | str | None | Read | Resolved colour-space kind (gray/rgb/cmyk/indexed). |
name | `` | Read | Gets the name. |
page_index | `` | Read | Gets the page index. |
Methods
| Signature | Description |
|---|---|
__init__(name: str, image_data: bytes | bytearray, page_index: int, rect: Rectangle | None, resolution: tuple[float, float] | None, rotation: int, matrix: tuple[float, float, float, float, float, float] | None, meta: dict | None, limits: PdfLoadLimits | None) | Calls init(name, image_data, page_index, rect, resolution, rotation, matrix, meta, limits) on this ImagePlacement instance. |
replace(new_image_data: bytes | bytearray) | Replace the current image data with new_image_data. |
save(path: str | os.PathLike, color_space: str | None) → Path | Save the image as a real, openable image file. |
hide() | Hide the image placement. |