vbuch / node-signpdf

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

plainAddPlaceholder displaces view of PDF #67

Closed ghost closed 4 years ago

ghost commented 4 years ago

Describe the bug and the expected behaviour View of the pdf is displaced when plainAddPlaceholder is used. PDF generated by wkhtmltopdf Is it a bug in signing or in the helpers? Its an issue with helpers, "plainAddPlaceholder". Updating pageIndex to 1 of "plainAddPlaceholder" resolves the issue To Reproduce Sample code is below

// generate pdf by command below wkhtmltopdf "https://google.com"

// Code to addPlaceHolder const fs = require('fs') const node_signpdf = require('node-signpdf') const plainAddPlaceholder = require('./helpers').plainAddPlaceholder const SignPdf = new node_signpdf.SignPdf() const signBuffer = fs.readFileSync(certificate.p12); let pdfBuffer = fs.readFileSync(input.pdf); pdfBuffer = plainAddPlaceholder({ pdfBuffer, reason : 'I have reviewed It' }); fs.writeFileSync('fileWithPlaceHolder.pdf', pdfBuffer);

stale[bot] commented 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.