Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

refactor: update to latest mupdf

Marc Seitzaf95ab6fa9dc
diff --git a/pages/api/mupdf/get-pages.ts b/pages/api/mupdf/get-pages.ts
index ac4a64d0..81e04f8d 100644
--- a/pages/api/mupdf/get-pages.ts
+++ b/pages/api/mupdf/get-pages.ts
@@ -1,7 +1,6 @@
import { NextApiRequest, NextApiResponse } from "next";
-// @ts-ignore
-import mupdf from "mupdf";
+import * as mupdf from "mupdf";
export default async (req: NextApiRequest, res: NextApiResponse) => {
// check if post method
@@ -17,7 +16,7 @@ export default async (req: NextApiRequest, res: NextApiResponse) => {
// Convert the response to an ArrayBuffer
const pdfData = await response.arrayBuffer();
// Create a MuPDF instance
- var doc = mupdf.Document.openDocument(pdfData, "application/pdf");
+ var doc = new mupdf.PDFDocument(pdfData);
var n = doc.countPages();