mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-09 17:14:16 +01:00
feat(workflow): add altenate merge tool and translate workflow node and engine errors across locales
This commit is contained in:
1 parent
0040317e48
commit
ef3dab5aeb
74 files changed
+2552
-1077
No files matched your search
@@ -5,6 +5,7 @@ import type { SocketData } from '../types';
|
||||
import { requirePdfInput, processBatch } from '../types';
|
||||
import { PDFDocument } from 'pdf-lib';
|
||||
import * as pdfjsLib from 'pdfjs-dist';
|
||||
import { wfError } from '../errors';
|
||||
|
||||
export class PosterizeNode extends BaseWorkflowNode {
|
||||
readonly category = 'Organize & Manage' as const;
|
||||
@@ -57,7 +58,7 @@ export class PosterizeNode extends BaseWorkflowNode {
|
||||
canvas.height = viewport.height;
|
||||
const ctx = canvas.getContext('2d');
|
||||
if (!ctx)
|
||||
throw new Error(`Failed to get canvas context for page ${i}`);
|
||||
throw new Error(wfError('failedToGetCanvasContext', { page: i }));
|
||||
await page.render({ canvasContext: ctx, viewport, canvas }).promise;
|
||||
|
||||
const tileW = viewport.width / cols;
|
||||
@@ -70,7 +71,7 @@ export class PosterizeNode extends BaseWorkflowNode {
|
||||
tileCanvas.height = tileH;
|
||||
const tileCtx = tileCanvas.getContext('2d');
|
||||
if (!tileCtx)
|
||||
throw new Error('Failed to get tile canvas context');
|
||||
throw new Error(wfError('posterizeFailedTileCanvas'));
|
||||
tileCtx.drawImage(
|
||||
canvas,
|
||||
c * tileW,
|
||||
|
||||
Reference in new issue
Block a user