2023-10-28 19:48:16 +02:00
|
|
|
// PDFLib gets imported via index.html script-tag
|
2023-10-24 19:03:43 +02:00
|
|
|
// PDFJS as pdfjsLib via index.html script-tag
|
2023-10-28 19:48:16 +02:00
|
|
|
// jsQR via index.html script-tag
|
2023-10-27 03:14:22 +02:00
|
|
|
|
2023-10-22 01:11:17 +02:00
|
|
|
import * as pdfcpuWraopper from "./wasm/pdfcpu-wrapper-browser.js";
|
2023-10-27 03:14:22 +02:00
|
|
|
const OpenCV = { cv: cv } // OPENCV gets importet as cv via index.html script-tag
|
2023-10-22 01:11:17 +02:00
|
|
|
|
|
|
|
import { extractPages as dependantExtractPages } from "./functions/extractPages.js";
|
|
|
|
import { impose as dependantImpose } from './functions/impose.js';
|
|
|
|
import { mergePDFs as dependantMergePDFs } from './functions/mergePDFs.js';
|
|
|
|
import { rotatePages as dependantRotatePages } from './functions/rotatePages.js';
|
|
|
|
import { scaleContent as dependantScaleContent} from './functions/scaleContent.js';
|
|
|
|
import { scalePage as dependantScalePage } from './functions/scalePage.js';
|
|
|
|
import { splitPDF as dependantSplitPDF } from './functions/splitPDF.js';
|
2023-10-22 18:30:45 +02:00
|
|
|
import { editMetadata as dependantEditMetadata} from "./functions/editMetadata.js";
|
2023-10-23 14:11:49 +02:00
|
|
|
import { organizePages as dependantOrganizePages} from "./functions/organizePages.js";
|
2023-10-24 16:09:10 +02:00
|
|
|
import { removeBlankPages as dependantRemoveBlankPages} from "./functions/removeBlankPages.js";
|
2023-10-27 02:56:13 +02:00
|
|
|
import { splitOn as dependantSplitOn } from "./functions/splitOn.js";
|
2023-10-22 00:55:28 +02:00
|
|
|
|
|
|
|
export async function extractPages(snapshot, pagesToExtractArray) {
|
|
|
|
return dependantExtractPages(snapshot, pagesToExtractArray, PDFLib);
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function impose(snapshot, nup, format) {
|
|
|
|
return dependantImpose(snapshot, nup, format, pdfcpuWraopper);
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function mergePDFs(snapshots) {
|
|
|
|
return dependantMergePDFs(snapshots, PDFLib);
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function rotatePages(snapshot, rotation) {
|
|
|
|
return dependantRotatePages(snapshot, rotation, PDFLib);
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function scaleContent(snapshot, scaleFactor) {
|
|
|
|
return dependantScaleContent(snapshot, scaleFactor, PDFLib);
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function scalePage(snapshot, pageSize) {
|
|
|
|
return dependantScalePage(snapshot, pageSize, PDFLib);
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function splitPDF(snapshot, splitAfterPageArray) {
|
|
|
|
return dependantSplitPDF(snapshot, splitAfterPageArray, PDFLib);
|
2023-10-22 18:30:45 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function editMetadata(snapshot, metadata) {
|
|
|
|
return dependantEditMetadata(snapshot, metadata, PDFLib);
|
2023-10-23 14:11:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function organizePages(snapshot, operation, customOrderString) {
|
|
|
|
return dependantOrganizePages(snapshot, operation, customOrderString, PDFLib);
|
2023-10-24 16:09:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function removeBlankPages(snapshot, whiteThreashold) {
|
2023-10-24 19:03:43 +02:00
|
|
|
return dependantRemoveBlankPages(snapshot, whiteThreashold, pdfjsLib, OpenCV, PDFLib);
|
2023-10-27 02:56:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export async function splitOn(snapshot, type, whiteThreashold) {
|
2023-10-27 03:14:22 +02:00
|
|
|
return dependantSplitOn(snapshot, type, whiteThreashold, pdfjsLib, OpenCV, PDFLib, jsQR);
|
2023-10-22 00:55:28 +02:00
|
|
|
}
|