question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How-to Sign already create PDF document

See original GitHub issue

Hi Guys,

Grate work… I’ll will appreciate to create and submit a demo of using node-signpdf for the ones using jsPDF. The problem is that I can not find how to create the placeholders as shows on the tests

const signature = pdf.ref({ Type: 'Sig', Filter: 'Adobe.PPKLite', SubFilter: 'adbe.pkcs7.detached', ByteRange: [ 0, DEFAULT_BYTE_RANGE_PLACEHOLDER, DEFAULT_BYTE_RANGE_PLACEHOLDER, DEFAULT_BYTE_RANGE_PLACEHOLDER, ], Contents: Buffer.from(String.fromCharCode(0).repeat(signatureLength)), Reason: new String(reason), // eslint-disable-line no-new-wrappers M: new Date(), }); When looking on the jsPDF I could not find the equivalent to pdf.ref, but I am sure there is a way to do that, any idea?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

4reactions
vbuchcommented, Apr 22, 2019

I’ve started playing with this a bit: https://github.com/vbuch/node-signpdf/tree/play-with-trailers It’s hell lot of string/buffer operations that need to be done, but seems like it is doable at least to the bare minimum functionality. Will let you know once I have something working. This would enable adding signature placeholder to any PDF (currently only thinking about really limited options) so it won’t matter if you created your document with PdfKit, jsPDF or another tool. Not sure the code will be that readable so I will keep the pdfkit examples in the helpers somehow as well.

2reactions
vbuchcommented, Apr 16, 2019

Heads up: What the ref function basically does in pdfkit is store an item an enumerate it. So just reading the trailer will give you the current number of items. Use that number for you next added item and increase the number in the trailer. Link the AcroForm in the root descriptor. That’s all you need to do. The pdf spec is available at http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf

Read more comments on GitHub >

github_iconTop Results From Across the Web

Signing PDFs in Adobe Acrobat
Open the PDF document or form that you want to sign. Click the Sign icon in the toolbar. Alternatively, you can choose Tools...
Read more >
How to add a signature to a PDF with Adobe Acrobat - Jotform
Adding a signature to a PDF. Open the PDF file in Adobe Acrobat Reader. Click on Fill & Sign in the Tools panel...
Read more >
How to create a signature for PDF documents on a PC
Now, if you want to add your signature to a PDF, just open your document using Adobe Acrobat Reader and click on the...
Read more >
How to add a signature to a PDF document.
Open your PDF document. · Switch to Edit Mode by selecting the Edit icon in the toolbar. · Click the Signature icon ....
Read more >
How to add digital signatures to PDF documents - PandaDoc
First, you'll need a digital certificate, either from a registered provider or through a self-sign service like Adobe Sign. You cannot add a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found