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:
@@ -1,12 +1,25 @@
|
||||
export async function impose(snapshot: any, nup: number, format: string, pdfcpuWrapper: any) {
|
||||
return await pdfcpuWrapper.oneToOne([
|
||||
|
||||
import { PdfFile, fromPdfLib } from '../wrappers/PdfFile';
|
||||
export type ImposeParamsType = {
|
||||
file: any;
|
||||
nup: number;
|
||||
format: string;
|
||||
}
|
||||
export type ImposeParamsBaseType = {
|
||||
file: any;
|
||||
nup: number;
|
||||
format: string;
|
||||
pdfcpuWrapper: any;
|
||||
}
|
||||
export async function impose(params: ImposeParamsBaseType) {
|
||||
return await params.pdfcpuWrapper.oneToOne([
|
||||
"pdfcpu.wasm",
|
||||
"nup",
|
||||
"-c",
|
||||
"disable",
|
||||
'f:' + format,
|
||||
'f:' + params.format,
|
||||
"/output.pdf",
|
||||
String(nup),
|
||||
String(params.nup),
|
||||
"input.pdf",
|
||||
], snapshot);
|
||||
], params.file);
|
||||
}
|
||||
Reference in New Issue
Block a user