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.

For some PDFs plainAddPlaceholder returns error, although it works for w3dummy.pdf

See original GitHub issue
function signExistingPDF(pdfFile: string) {
  let pdfBuffer = readFileSync(pdfFile);
  pdfBuffer = plainAddPlaceholder({
      pdfBuffer,
      reason: 'I have reviewed it.',
      // signatureLength: 1612,
  });

  return pdfBuffer;
}

Stack trace

TypeError: Cannot read property 'split' of undefined
    at getXref (/.../node_modules/node-signpdf/dist/helpers/plainAddPlaceholder/readRefTable.js:55:34)
    at getFullXrefTable (/.../node_modules/node-signpdf/dist/helpers/plainAddPlaceholder/readRefTable.js:79:25)
    at readRefTable (/.../node_modules/node-signpdf/dist/helpers/plainAddPlaceholder/readRefTable.js:100:25)
    at readPdf (/.../node_modules/node-signpdf/dist/helpers/plainAddPlaceholder/readPdf.js:31:46)
    at plainAddPlaceholder (/.../node_modules/node-signpdf/dist/helpers/plainAddPlaceholder/index.js:54:37)
    at signExistingPDF (/.../pdfsig/index.ts:66:15)
........

Although it works for w3dummy.pdf

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sumanmaity1234commented, Jan 31, 2020

Hi @vbuch, looks like the issue has been resolved with the latest changes. Thanks for fixing it.

I think this issue can be marked as fixed until @vologab @lucasmassi has some other points.

0reactions
vbuchcommented, Jan 30, 2020

@vologab @sumanmaity1234 @lucasmassi #57 is now in 1.2.2. Could you check if your issues are still reproducible or this one can be closed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

plainAddPlaceholder creating invisible signature #39 - GitHub
I used plainAddPlaceholder function to create the placeholder and then added the signature. The output PDF have the signature properly, but Acrobat Reader...
Read more >
Troubleshoot viewing PDF files on the web - Adobe Support
Follow these steps to solve the common issues around viewing PDF files from a website.
Read more >
PDF documents not printing from web browsers
PDF documents not printing from web browsers. Most PDF documents are designed to work using Adobe Acrobat Reader as the reader software. But...
Read more >
How to Work With a PDF in Python
In this step-by-step tutorial, you'll learn how to work with a PDF in Python. You'll see how to extract metadata from preexisting PDFs...
Read more >
Help with PDF Documents - Maine.gov
Some documents on Maine.gov are provided in PDF format. ... You received an error message containing "% PDF" or you have received 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