vbuch / node-signpdf

Simple signing of PDFs in node.
MIT License
676 stars 174 forks source link

'/Fields' is a PDFRef so it cannot be pushed to #218

Open bistrachilikova opened 6 months ago

bistrachilikova commented 6 months ago

Describe the bug and the expected behaviour We are attempting to sign a PDF file and we are adding a placeholder with placeholder-pdf-lib. However, we are getting the 'fields.push is not a function' error from pdfLibAddPlaceholder.js:124 fields.push(widgetDictRef); I noticed that when reading the PDF, the '/Fields' object is a PDFRef, not a PDFArray - not sure if this is expected.

Is it a bug in signing or in the helpers? Not sure

To Reproduce I'm unfortunately unable to give you the PDF that's giving us issues. Here is what the /Fields object looks like: PDFName { encodedName: '/Fields' } => PDFRef { objectNumber: 32, generationNumber: 0, tag: '32 0 R' },

vbuch commented 5 months ago

Just in theory (without looking at code), the PDFRef should be pointing towards an array object where it should be possible to push.