RasterizedPage
Overview
RasterizedPage is a class in Aspose.PDF FOSS for Python.
A rendered PDF page in packed RGB format.
This class provides 4 methods for working with RasterizedPage objects in Python programs.
Available methods include: get_pixel, save, to_png, to_tiff.
All public members are accessible to any Python application after installing the Aspose.PDF FOSS for Python package.
Properties: dpi, height, pixels, width.
Properties
| Name | Type | Access | Description |
|---|---|---|---|
width | int | Read | Gets the width. |
height | int | Read | Gets the height. |
pixels | bytes | Read | Gets the pixels. |
dpi | float | Read | Gets the dpi. |
Methods
| Signature | Description |
|---|---|
get_pixel(x: int, y: int) → Color | Return the RGB pixel at (x, y) with origin at the top-left. |
to_png() → bytes | Encode this raster as a PNG file. |
to_tiff() → bytes | Encode this raster as an uncompressed baseline RGB TIFF file. |
save(path: str | Path) → Path | Save the raster to .png or .tif/.tiff and return the path. |