mindee
Version:
Mindee Client Library for Node.js
26 lines (25 loc) • 941 B
TypeScript
import type * as pdfLibTypes from "@cantoo/pdf-lib";
import { PageOptions } from "../input/pageOptions.js";
import { LocalInputSource } from "../input/index.js";
export interface SplitPdf {
file: Buffer;
totalPagesRemoved: number;
}
/**
* Cut pages from a PDF file. If pages indexes are out of bounds, it will throw an error.
* @param file
* @param pageOptions
* @returns the new cut PDF file.
*/
export declare function extractPages(file: Buffer, pageOptions: PageOptions): Promise<SplitPdf>;
/**
* Count the number of pages in a PDF file.
* @param file
* @returns the number of pages in the file.
*/
export declare function countPages(file: Buffer): Promise<number>;
/**
* Creates a PDF from a local file. Converts images to PDFs if needed.
* @param inputSource The input source to create a PDF from.
*/
export declare function createPdfFromInputSource(inputSource: LocalInputSource): Promise<pdfLibTypes.PDFDocument>;