PyPDFForm icon indicating copy to clipboard operation
PyPDFForm copied to clipboard

Cant insert Signature to the PDF

Open bharathreddy1997 opened this issue 1 year ago • 5 comments

I am trying to insert an signature image to the PDF but instead of the image, it just inserts the name of the file ,

Any help would be great

bharathreddy1997 avatar May 14 '24 14:05 bharathreddy1997

I'll need more context than just that. Could you provide the template and snippet you used?

chinapandaman avatar May 14 '24 15:05 chinapandaman

screen

and this is the code i am using

from PyPDFForm import PdfWrapper

filled = PdfWrapper("test.pdf").fill( { "Signature": "temp1.png" }, )

with open("output.pdf", "wb+") as output: output.write(filled.read())

bharathreddy1997 avatar May 14 '24 15:05 bharathreddy1997

I also need the template. Meaning the test.pdf file in your script.

chinapandaman avatar May 14 '24 15:05 chinapandaman

test.pdf

Here you go

bharathreddy1997 avatar May 14 '24 15:05 bharathreddy1997

So I don't think the Signature field you are trying to fill is actually a signature field.

A signature field, for example the one in this PDF, when opened with Adobe Reader would look something like this: Screenshot 2024-05-14 130903

That's not the case for your template: Screenshot 2024-05-14 162214

In fact I'm not sure what Signature is, and when the library is unsure either, it defaults it to text field. This is why when you specify the value "temp1.png", despite it meant to be a file path, gets filled as a string by the library.

chinapandaman avatar May 14 '24 21:05 chinapandaman

Closing due to inactivity.

chinapandaman avatar Mar 04 '25 22:03 chinapandaman