PdfBitmap

A rendered page image owned by the caller.

The buffer uses PdfPixelFormat.Bgra8888 on the current backends. Closing releases the pixel buffer; all other properties keep working.

Properties

Link copied to clipboard
abstract val format: PdfPixelFormat

Pixel layout of the buffer.

Link copied to clipboard
abstract val height: Int

Bitmap height in pixels.

Link copied to clipboard
abstract val isClosed: Boolean

Whether close has been called.

Link copied to clipboard
abstract val stride: Int

Byte distance between the start of two adjacent rows. Rows are not guaranteed to be tightly packed, so always use stride when indexing the buffer.

Link copied to clipboard
abstract val width: Int

Bitmap width in pixels.

Functions

Link copied to clipboard
abstract override fun close()
Link copied to clipboard
abstract fun copyPixels(): ByteArray

Returns a copy of the full pixel buffer, including per-row padding.

abstract fun copyPixels(destination: ByteArray, destinationOffset: Int = 0)

Copies the full pixel buffer into destination starting at destinationOffset. The destination must have enough remaining capacity for the whole buffer.