Bug Report
Description of the problem
I am using an image as the Uint8Array that is downloaded from AWS.
doc.image throws the error:
TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes. Received Uint8Array(1239071)
The buffer is Uint8Array as console.log(jpgBuffer instanceof Uint8Array) returns true;
Code sample
const jpgBuffer: Uint8Array = await response.Body.transformToByteArray();
console.log(jpgBuffer instanceof Uint8Array); // true
doc.image(jpgBuffer, 50, 45, { width: 50 });
Your environment
- pdfkit version: ^0.13.0
- Node version: 16.13.1
- Browser version (if applicable):
- Operating System: MacOs 13.3.1
Bug Report
Description of the problem
I am using an image as the Uint8Array that is downloaded from AWS.
doc.image throws the error:
TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes. Received Uint8Array(1239071)
The buffer is Uint8Array as console.log(jpgBuffer instanceof Uint8Array) returns true;
Code sample
const jpgBuffer: Uint8Array = await response.Body.transformToByteArray();
console.log(jpgBuffer instanceof Uint8Array); // true
doc.image(jpgBuffer, 50, 45, { width: 50 });
Your environment