From 14d653e7015e85bc5c258e04cf36479acb0d70c3 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Fri, 26 Apr 2024 13:39:57 +0200 Subject: [PATCH] fix(core): update --- ts/00_commitinfo_data.ts | 2 +- ts/smartpdf.classes.smartpdf.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 9c581d8..cd644f0 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartpdf', - version: '3.1.3', + version: '3.1.4', description: 'A library for creating PDFs dynamically from HTML or websites with additional features like merging PDFs.' } diff --git a/ts/smartpdf.classes.smartpdf.ts b/ts/smartpdf.classes.smartpdf.ts index 8ac1c0b..de69c13 100644 --- a/ts/smartpdf.classes.smartpdf.ts +++ b/ts/smartpdf.classes.smartpdf.ts @@ -232,7 +232,7 @@ export class SmartPdf { height?: number; quality?: number; } = {} - ): Promise { + ) { const { width = 1024, height = 768, quality = 100 } = options; // Load the PDF document @@ -257,6 +257,8 @@ export class SmartPdf { } // Resolve all promises and return the array of buffers - return Promise.all(imagePromises); + const imageBuffers = await Promise.all(imagePromises); + const imageUint8Arrays = imageBuffers.map((buffer) => new Uint8Array(buffer)); + return imageUint8Arrays; } }