Stirling-PDF/public/functions/extractPages.js

8 lines
349 B
JavaScript
Raw Normal View History

import { createSubDocument } from "./shared/createSubDocument.js";
export async function extractPages(snapshot, pagesToExtractArray, PDFLib) {
const pdfDoc = await PDFLib.PDFDocument.load(snapshot)
2023-10-17 03:40:54 +02:00
// TODO: invent a better format for pagesToExtractArray and convert it.
return createSubDocument(pdfDoc, pagesToExtractArray, PDFLib);
};