Solved type issues in traverseOperations etc. Changed functions to take a object single parameter. Condensed endpoints into a function call

This commit is contained in:
Saud Fatayerji
2023-11-14 03:26:42 +03:00
parent 77274e6117
commit 9956367384
18 changed files with 377 additions and 260 deletions

View File

@@ -2,7 +2,14 @@
import { PDFPage } from 'pdf-lib';
import { PdfFile, fromPdfLib } from '../wrappers/PdfFile';
export async function scaleContent(file: PdfFile, scaleFactor: number|number[]): Promise<PdfFile> {
export type ScaleContentParamsType = {
file: PdfFile;
scaleFactor: number|number[];
}
export async function scaleContent(params: ScaleContentParamsType): Promise<PdfFile> {
const { file, scaleFactor } = params;
const pdfDoc = await file.getAsPdfLib();
const pages = pdfDoc.getPages();