Capitalised pdfJsDocument and pdfLibDocument

This commit is contained in:
Saud Fatayerji
2023-11-15 02:38:07 +03:00
parent 5f23491189
commit 57415bea85
10 changed files with 21 additions and 21 deletions

View File

@@ -21,7 +21,7 @@ export async function sortPagesWithPreset(params: SortPagesWithPresetParamsType)
throw new Error("Operation not supported");
}
const pdflibDocument = await file.pdflibDocument;
const pdflibDocument = await file.pdfLibDocument;
const pageCount = pdflibDocument.getPageCount();
const sortIndecies = sortFunction(pageCount);
@@ -36,7 +36,7 @@ export type RearrangePagesParamsType = {
export async function rearrangePages(params: RearrangePagesParamsType): Promise<PdfFile> {
const { file, fancyPageSelector } = params;
const pdflibDocument = await file.pdflibDocument;
const pdflibDocument = await file.pdfLibDocument;
const pagesToExtractArray = parseFancyPageSelector(fancyPageSelector, pdflibDocument.getPageCount());
const newDocument = selectPages({file: file, pagesToExtractArray});
@@ -50,7 +50,7 @@ export type SelectPagesParamsType = {
export async function selectPages(params: SelectPagesParamsType): Promise<PdfFile> {
const { file, pagesToExtractArray } = params;
const pdflibDocument = await file.pdflibDocument;
const pdflibDocument = await file.pdfLibDocument;
const subDocument = await PDFDocument.create();
@@ -75,7 +75,7 @@ export type RemovePagesParamsType = {
export async function removePages(params: RemovePagesParamsType): Promise<PdfFile> {
const { file, pagesToRemoveArray } = params;
const pdflibDocument = await file.pdflibDocument;
const pdflibDocument = await file.pdfLibDocument;
const pagesToExtractArray = invertSelection(pagesToRemoveArray, pdflibDocument.getPageIndices())
return selectPages({file: file, pagesToExtractArray});