Closed kiranbangar5946 closed 2 years ago
@kiranbangar5946 this is known issue but noone ever tackled it. See #108 Somone needs to read the specs and check where the info is lost.
@vbuch ok understood so i changed it to potrait as i too had same doubt and tried but placeholder is invisble and in adobe reader it shows Field:Signature1 is invisible
.Is this not implemented ? and i see a tilt rectangle with watermark view copy.Your suggestions might lead me in right direction am struggling on it .Thank you sir!
An e-signature doesn't need to be visible. We only have the implementation of invisible ones. See #26 and #39. They both refer to the same topic. This is where asignature is made invisible. plainAddPlaceholder
uses pdfkitAddPlaceholder
internally so it's the same code that creates the widget.
Hi. I am also having the same problem. I used to generate pdf using html-pdf
library
and sign the generated pdf with node-signpdf
const pdfBufferWithPlaceholder = plainAddPlaceholder({pdfBuffer, reason: 'reason'}); const signedPdfBuffer = Signer.sign(pdfBufferWithPlaceholder, p12Cert, {passphrase});
The file is successfully signed but the first page becomes blank when it is viewed in Adobe Acrobat.
When I use pdfkit
to generate pdf instead of html-pdf
, it works fine. It's not making the
first page blank after signing. But I really need the generated pdf from html-pdf
to work.
Thanks in advance
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.
hi @vbuch we would be able to fund this issue if it would help you to resolve it. it would be really great.
I was using https://github.com/marcbachmann/node-html-pdf to generate the PDF. So I change tohttps://github.com/mrafiqk/html-pdf-node and now it works like a charm
@kiranbangar5946 , @dotob , I would love to help here, but could you please provide a file that you have issues with? Of course, I'm interested in the version before trying to sign it.
hi @vbuch,
thanks for having a look at this.
here are the two files: original and signed
what we do in code:
let pdfBuffer = plainAddPlaceholder({
pdfBuffer: await fs.readFile("original.pdf"),
reason: 'reasons',
signatureLength: 1612,
});
const signedPdf = signer.sign(pdfBuffer, await fs.readFile(PATH_TO_P12_CERTIFICATE), {
passphrase: 'xxxxxxx',
});
regards sebastian
OK. Looking at the original I see a couple of things:
Note: If you can save your document without the use of streams, you will probably succeed in signing it (just as a quick fix).
Hey, colleague of @dotob here, we are using https://github.com/Hopding/pdf-lib to edit an existing pdf.
When first trying to sign our pdf we ran into this issue https://github.com/vbuch/node-signpdf/issues/79.
We solved it by using await pdfDoc.save({ useObjectStreams: false, });
So I think we already save the document without the use of streams. Thanks for taking a look.
@niklas-dahl , the document shared by @dotob as original does contain streams. Also, there is a better way to place the signature placeholder than our plainAddPlaceholder if you are already using pdf-lib. See https://github.com/Hopding/pdf-lib/issues/112#issuecomment-569085380
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.
hi @vbuch thanks for building such a library firstly apart from these i need some suggestion as am not generating pdf using pdfkit so am using plainAddPlaceholder function which in turn creates digital signature but my first page of pdf is blank and is in potrait mode my placeholder isnt visible please help :(