Skip to contents

Wraps FPDFBitmap_Create. Allocates a width × height bitmap that can be populated via pdf_bitmap_fill_rect() or pdf_bitmap_set_buffer() and then attached to an image page- object via pdf_image_set_bitmap(). This is the v0.1.0 path for embedding non-JPEG (PNG / TIFF / raw raster) images into a PDF.

Usage

pdf_bitmap_new(width, height, alpha = TRUE)

Arguments

width, height

Integer — pixel dimensions. Must be positive.

alpha

Logical. If TRUE (default), the bitmap has an alpha channel.

Value

A pdfium_image_buffer handle.

Details

Pixel layout:

  • alpha = TRUE: BGRA, 4 bytes per pixel, top-down rows.

  • alpha = FALSE: BGRx, 4 bytes per pixel with the 4th byte unused.