mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-05 20:02:47 +01:00
feat: update GitHub Actions workflow for PDF engine and viewer
This commit is contained in:
@@ -6,6 +6,7 @@ import { requirePdfInput, processBatch } from '../types';
|
||||
import { loadPyMuPDF } from '../../utils/pymupdf-loader.js';
|
||||
import { hexToRgb } from '../../utils/helpers.js';
|
||||
import { loadPdfDocument } from '../../utils/load-pdf-document.js';
|
||||
import { redactDocumentData } from '../../utils/redact-document-data.js';
|
||||
import { wfError } from '../errors';
|
||||
|
||||
export class RedactNode extends BaseWorkflowNode {
|
||||
@@ -106,9 +107,14 @@ export class RedactNode extends BaseWorkflowNode {
|
||||
}
|
||||
}
|
||||
|
||||
const resultBytes = new Uint8Array(doc.save());
|
||||
const redactedBytes = new Uint8Array(doc.save());
|
||||
doc.close();
|
||||
|
||||
const resultBytes = await redactDocumentData(
|
||||
redactedBytes,
|
||||
mode === 'text' ? searchText : undefined
|
||||
);
|
||||
|
||||
const resultDoc = await loadPdfDocument(resultBytes);
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user