mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-22 15:35:03 +00:00
remove blank pages, frontend
Thank you a lot for helping me debug this sbplat --------- Co-authored-by: Eric <71648843+sbplat@users.noreply.github.com>
This commit is contained in:
parent
b1bb8e0f02
commit
df10eacf92
@ -1,4 +1,9 @@
|
||||
import * as PDFJS from "pdfjs-dist";
|
||||
import pdfJSWorkerURL from "pdfjs-dist/build/pdf.worker.min.mjs?url";
|
||||
const isBrowser = import.meta.env.SSR === false
|
||||
if(isBrowser){
|
||||
PDFJS.GlobalWorkerOptions.workerSrc = pdfJSWorkerURL;
|
||||
}
|
||||
|
||||
import type { PDFDocumentProxy as PDFJSDocument } from "pdfjs-dist/types/src/display/api";
|
||||
import { PDFDocument as PDFLibDocument } from "pdf-lib";
|
||||
@ -73,7 +78,7 @@ export class PdfFile {
|
||||
});
|
||||
default:
|
||||
return new Promise(async (resolve) => {
|
||||
const pdfjsDoc = await PDFJS.getDocument(await this.uint8Array).promise;
|
||||
const pdfjsDoc = await PDFJS.getDocument({ data: await this.uint8Array, isOffscreenCanvasSupported: false }).promise;
|
||||
this.pdfJsDocument = pdfjsDoc;
|
||||
resolve(pdfjsDoc);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user