From 82f8d243b6aba94bd9ed083f242f2470e00fc122 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sun, 28 May 2023 19:05:05 +0100 Subject: Support readAsBuffer() on images --- lib/documents.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') diff --git a/lib/documents.js b/lib/documents.js index 9088ed9..cc6a2a3 100644 --- a/lib/documents.js +++ b/lib/documents.js @@ -168,6 +168,11 @@ function Image(options) { readAsBase64String: function() { return options.readImage("base64"); }, + readAsBuffer: function() { + return options.readImage().then(function(arrayBuffer) { + return Buffer.from(arrayBuffer); + }); + }, altText: options.altText, contentType: options.contentType }; -- cgit v1.2.3