vbuch / node-signpdf

Simple signing of PDFs in node.
MIT License
711 stars 178 forks source link

Adding extra fields on placeholder #223

Closed Aleiiixx closed 8 months ago

Aleiiixx commented 8 months ago

Hi im using the placeholder like this

const pdfWithPlaceholder = plainAddPlaceholder({ pdfBuffer: newPdfNodeBuffer, reason: 'The user is decalaring consent through JavaScript.', contactInfo: 'signpdf@example.com', name: 'John Doe', location: 'Free Text Str., Free World', });

when i open the pdf using adobe i can see on the sign details the reson and the loaction but i cant see the contactInfo for example, and i was wondering if its posible to add other custom fields like ip, cause i would like to add the origin ip every time i sign a pdf is it posible? and if its possible where can i see them when i open the pdf with adobe

vbuch commented 8 months ago

Hi @Aleiiixx , As far as I can see Adobe Reader does not show the ContactInfo anywhere indeed. ContactInfo is optional and supposed to be used in scenarios where the contact info is not embedded in the signing certificate.

And about additional fields: You can see the spec of PDF 1.7 and especially TABLE 8.102 Entries in a signature dictionary on page 727 on what is possible. Just checked: Not much has changed in this regard in the PDF 2.0 spec (Table 255 on page 551).

Aleiiixx commented 8 months ago

Ok, perfect, thank you very much for taking the time to respond.