mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-01-23 00:06:08 +01:00
97e4eab7bb
Split express into different ports for easier migration Typed page ops that had warnings
11 lines
429 B
TypeScript
11 lines
429 B
TypeScript
|
|
import { PDFDocument } from 'pdf-lib';
|
|
import { createSubDocument } from './common/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);
|
|
};
|