Closed mayurchoksi closed 4 years ago
This issue has been automatically marked as stale because it has not had activity in the past 90 days. It will be closed if no further activity occurs. Thank you for your contributions.
this issue occurs when you are using PDF-Lib to add or parse the PDF before the signing process.
{ useObjectStreams: false } to the save() method did the trick! in pdf-lib
Describe the bug and the expected behaviour I have a few PDFs that don't contain a trailer. It seems that PDFs with/without trailers are valid PDFs.
When I try to sign PDFs without a trailer using node-signpdf I get the following error: (node:51815) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of undefined at getXref (/Users/folderX/node_modules/node-signpdf/dist/helpers/plainAddPlaceholder/readRefTable.js:55:34) at getFullXrefTable (/Users/folderX/node_modules/node-signpdf/dist/helpers/plainAddPlaceholder/readRefTable.js:79:25) at readRefTable (/Users/folderX/node_modules/node-signpdf/dist/helpers/plainAddPlaceholder/readRefTable.js:100:25) at readPdf (/Users/folderX/node_modules/node-signpdf/dist/helpers/plainAddPlaceholder/readPdf.js:31:46) at plainAddPlaceholder (/Users/folderX/node_modules/node-signpdf/dist/helpers/plainAddPlaceholder/index.js:54:37)
I am using version the following versions: "node-forge": "^0.9.1", "node-signpdf": "^1.2.3",
Sample code attached. index.txt