Closed stanvanheumen closed 8 months ago
Indeed the library is designed to sign from scratch a file. I will have a look at your scenario (sign in a signature field). This is a busy week for me, I'll have time for it next week.
Feature added in 1.0.15. Documentation updated. The field you want to sign is called 'Signature28'. For the moment both background and texts have to be provided. This will be fixed in the next version.
Q: I want to add a regression test for your pdf. Is it ok to add it to git repository?
Great work! I've just tested it and I can now successfully digitally sign the PDF. Yes, you can add the PDF to the git repository.
I did however get a small issue with the background property. I've tried to resize the image to the dimensions of the signature widget in the PDF file (width: 128px; height: 58px):
The resulting drawn image looks like this:
Is there something I can do to fix this?
I know that there are some issues with the visual aspect. I'm working on. Also same text should be visible (it is in fact in the pdf reder in Ubuntu, but not in Adobe Reader on windows).
You can solve your problem by providing an empty array for texts: const parameters: SignFieldParameters = { fieldName: 'Signature1,
name: 'Test Signer',
location: 'Timisoara',
reason: 'Signing',
contactInfo: 'signer@semnezonline.ro',
background: await fse.readFile(...),
texts: [ ]
};
Now both background and texts are displayed (version 1.0.16).
We are currently facing an issue with sign-pdf-lib. Despite our best efforts and thorough research, we have been unable to successfully sign our PDF correctly using this library.
View our code below, we have attached the PDF as well. When we try to sign our PDF (which contains a signature field already) it creates a new signature instead of signing the existing signature field.
How can we (visually and digitally) sign our PDF using your library?
Personal_History_Disclosure_Form_v01092023.pdf