happypdf / extractImageBytes
Function: extractImageBytes()
ts
function extractImageBytes(stream): ExtractedImageBytes | undefined;Defined in: src/api/extraction/imageBytes.ts:25
Convert an Image XObject stream into usable image file bytes.
- DCTDecode → JPEG bytes as stored
- DeviceRGB / DeviceGray 8-bit (typically Flate) → PNG Returns undefined for unsupported color spaces / filters.
Parameters
| Parameter | Type |
|---|---|
stream | PDFStream |
Returns
ExtractedImageBytes | undefined