Cleared up client and shared modules
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
export async function impose(snapshot, nup, format, pdfcpuWraopper) {
|
||||
return await pdfcpuWraopper.oneToOne([
|
||||
export async function impose(snapshot: any, nup: number, format: string, pdfcpuWrapper: any) {
|
||||
return await pdfcpuWrapper.oneToOne([
|
||||
"pdfcpu.wasm",
|
||||
"nup",
|
||||
"-c",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { PDFDocument } from 'pdf-lib';
|
||||
import { detectEmptyPages } from "./common/detectEmptyPages.js";
|
||||
|
||||
export async function removeBlankPages(snapshot, whiteThreashold) {
|
||||
export async function removeBlankPages(snapshot: string | ArrayBuffer | Uint8Array, whiteThreashold: number) {
|
||||
|
||||
const emptyPages = await detectEmptyPages(snapshot, whiteThreashold);
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
import { PDFDocument } from 'pdf-lib';
|
||||
import PDFJS from 'pdfjs-dist';
|
||||
import jsQR from "jsqr";
|
||||
|
||||
import { detectEmptyPages } from "./common/detectEmptyPages.js";
|
||||
import { getImagesOnPage } from "./common/getImagesOnPage.js";
|
||||
@@ -10,8 +11,7 @@ import { TypedArray, DocumentInitParameters } from 'pdfjs-dist/types/src/display
|
||||
export async function splitOn(
|
||||
snapshot: string | ArrayBuffer | Uint8Array,
|
||||
type: "BAR_CODE"|"QR_CODE"|"BLANK_PAGE",
|
||||
whiteThreashold: number,
|
||||
jsQR: (arg0: any, arg1: number, arg2: number) => any) {
|
||||
whiteThreashold: number) {
|
||||
let splitAtPages: number[] = [];
|
||||
|
||||
switch (type) {
|
||||
@@ -86,7 +86,7 @@ export async function splitOn(
|
||||
return pagesWithQR;
|
||||
}
|
||||
|
||||
async function checkForQROnImage(image) {
|
||||
async function checkForQROnImage(image: any) {
|
||||
// TODO: There is an issue with the jsQR package (The package expects rgba but sometimes we have rgb), and the package seems to be stale, we could create a fork and fix the issue. In the meanwhile we just force rgba:
|
||||
// Check for rgb and convert to rgba
|
||||
|
||||
|
||||
Reference in New Issue
Block a user