mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2024-12-21 19:08:24 +01:00
11 lines
422 B
TypeScript
11 lines
422 B
TypeScript
|
|
import { PDFDocument } from 'pdf-lib';
|
|
import { createSubDocument } from './createSubDocument';
|
|
|
|
export async function extractPages(snapshot: string | Uint8Array | ArrayBuffer, pagesToExtractArray: number[]): Promise<Uint8Array>{
|
|
const pdfDoc = await PDFDocument.load(snapshot)
|
|
|
|
// TODO: invent a better format for pagesToExtractArray and convert it.
|
|
return createSubDocument(pdfDoc, pagesToExtractArray);
|
|
};
|