Hello everybody.
My English is very poor, when you use node, you use this expression.
const image = doc.createImage(fs.readFileSync('./cat.jpg'));
but how to create image in javascript or angular.
Thanks.
it's a base64 format image.
Please approach this stackoverflow who details all different variations https://stackoverflow.com/questions/6150289/how-to-convert-image-into-base64-string-using-javascript
That's correct
It can also be Buffer or Uint8Array or ArrayBuffer too, as well as the aforementioned base 64 string:
https://github.com/dolanmiu/docx/blob/master/src/file/media/media.ts#L48
Pick which one works for you best
A lot of thanks everybody.
Most helpful comment
That's correct
It can also be
BufferorUint8ArrayorArrayBuffertoo, as well as the aforementioned base 64 string:https://github.com/dolanmiu/docx/blob/master/src/file/media/media.ts#L48
Pick which one works for you best