RasterizedPage

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

NameTypeAccessDescription
widthintReadGets the width.
heightintReadGets the height.
pixelsbytesReadGets the pixels.
dpifloatReadGets the dpi.

Methods

SignatureDescription
get_pixel(x: int, y: int)ColorReturn the RGB pixel at (x, y) with origin at the top-left.
to_png()bytesEncode this raster as a PNG file.
to_tiff()bytesEncode this raster as an uncompressed baseline RGB TIFF file.
save(path: str | Path)PathSave the raster to .png or .tif/.tiff and return the path.

See Also