TaTo30 / vue-pdf

PDF component for Vue 3
https://tato30.github.io/vue-pdf/
MIT License
463 stars 65 forks source link

It's possible to draw a signature? #34

Closed sbellver closed 1 year ago

sbellver commented 1 year ago

Hi all.

I wonder if it's posible add a signature (draw with finger) as anotation into PDF.

I try to enable annotation-layer but i cant see any change

TaTo30 commented 1 year ago

You can add an annotation and reload page but the drawing should be done externally.

rxw1 commented 1 year ago

Hello,

I had some good success using https://github.com/WangShayne/vue3-signature. It will give you the signature as a base64-encoded string. There are probably plenty of solutions for actually putting that signature on the PDF and baking it in. I solved this by sending the signature and the PDF to my backend, having some logic there to find the correct annotation and its coordinates, preparing the signature image a little bit, and then adding it as an annotation in the correct coordinates of the annotation field.

NB: I did not utilize any of the actual sign features, i.e., actual signature fields, etc., provided by Adobe.

TaTo30 commented 1 year ago

Thanks @rxw1. It looks a nice solution for me.

Feel free to reopen the issue if you thinks is convenient.