entonces, cuando estoy probando con la biblioteca PDFNet de PDFTRON, cuando ejecuto solo el archivo con la función PDFnet.initialize (), funciona bien, pero una vez que lo ejecuto en angular, dice:
core.mjs:6461 ERROR TypeError: Cannot read properties of undefined (reading 'initialize')
aunque importé el espacio de nombres, aquí está mi código:
const CryptoJS = require('crypto-js'); import { PDFNet } from '@pdftron/pdfnet-node'; import { exit } from 'process'; import * as qr from 'qr-image'; class DocumentSV { public statu: number; // ---------------- Preparation -------------------- // Récuperer le document dont on veut signer constructor() { this.statu = 0; } async Sign(docpath : string, pfxpath : string) { try { await PDFNet.initialize(/*license*/); const doc = await PDFNet.PDFDoc.createFromFilePath(docpath); . . . await doc.save('src/app/Document/Signed.pdf', PDFNet.SDFDoc.SaveOptions.e_remove_unused); exit(1); } catch (err) { console.log('error', err) } } } const _DocumentSV = DocumentSV; export { _DocumentSV as DocumentSV };```