Skip to contents

Returns the embedded image's decoded pixel buffer as a pdf_render_page()-compatible pdfium_bitmap. Wraps FPDFImageObj_GetBitmap, which decodes the source stream but does not apply the page's coordinate transformation - the bitmap is the raw source raster, oriented in the image's own coordinate system.

Usage

pdf_image_bitmap(obj)

Arguments

obj

A pdfium_obj of type "image".

Value

A pdfium_bitmap (integer matrix with class c("pdfium_bitmap", "nativeRaster"), dim = c(height, width)) carrying attributes dpi = NA_real_ (the source image's DPI is in pdf_image_info() but doesn't apply to this raw raster), source_page, source_path, and rotation_applied = 0L. Use as.array.pdfium_bitmap() / as.raster.pdfium_bitmap() to convert to other shapes.

See also

pdf_image_rendered() for the CTM-applied rendering, pdf_image_data() for the raw embedded stream bytes.