jsreport / jsreport-pdf-utils

jsreport extension providing pdf operations like merge or concatenation
MIT License
8 stars 4 forks source link

Error: Error while executing pdf-utils operations. Signature exceeds placeholder length: 13138 > 8192 #30

Closed pittam closed 3 years ago

pittam commented 3 years ago

Hi, Recently, we have deployed the JSReports in AWS Lambda but facing the same issue while signing the pdf.

Error: Error while executing pdf-utils operations. Signature exceeds placeholder length: 13138 > 8192

at module.exports (/Users/spittam/GDD/Projects/2020/aws/jsreportapp/node_modules/jsreport-core/lib/util/createError.js:11:13)

at Reporter.createError (/Users/spittam/GDD/Projects/2020/aws/jsreportapp/node_modules/jsreport-core/lib/reporter.js:332:12)

at AsyncFunction. (/Users/spittam/GDD/Projects/2020/aws/jsreportapp/node_modules/jsreport-pdf-utils/lib/main.js:382:22)

at runMicrotasks (<anonymous>)

at processTicksAndRejections (internal/process/task_queues.js:93:5)

caused by: Error: Signature exceeds placeholder length: 13138 > 8192

at SignPdf.sign (/Users/spittam/GDD/Projects/2020/aws/jsreportapp/node_modules/node-signpdf/dist/signpdf.js:145:13)

at module.exports.sign (/Users/spittam/GDD/Projects/2020/aws/jsreportapp/node_modules/jsreport-pdf-utils/lib/utils/sign.js:66:17)

at Object.postprocess (/Users/spittam/GDD/Projects/2020/aws/jsreportapp/node_modules/jsreport-pdf-utils/lib/utils/pdfManipulator.js:122:31)

at processTicksAndRejections (internal/process/task_queues.js:93:5)

at async module.exports (/Users/spittam/GDD/Projects/2020/aws/jsreportapp/node_modules/jsreport-pdf-utils/lib/scriptPdfProcessing.js:83:5)

at async scriptExecModuleWrapper (/Users/spittam/GDD/Projects/2020/aws/jsreportapp/node_modules/jsreport-core/lib/scriptExecModuleWrapper.js:34:20)

Any suggestions to fix the issue ? .

Originally posted by @pittam in https://github.com/jsreport/jsreport-pdf-sign/issues/1#issuecomment-828896242

pofider commented 3 years ago

Thank you for the issue report.

I included extension's config maxSignaturePlaceholderLength in the latest 1.11.0. You can apply it using

{ "extensions": { "pdf-utils": { "maxSignaturePlaceholderLength": 16384 } } }