Stirling-PDF/public/functions/extractPages.js
2023-10-26 19:56:23 +02:00

8 lines
349 B
JavaScript

import { createSubDocument } from "./shared/createSubDocument.js";
export async function extractPages(snapshot, pagesToExtractArray, PDFLib) {
const pdfDoc = await PDFLib.PDFDocument.load(snapshot)
// TODO: invent a better format for pagesToExtractArray and convert it.
return createSubDocument(pdfDoc, pagesToExtractArray, PDFLib);
};