chinapandaman/PyPDFForm

Cant insert Signature to the PDF

bharathreddy1997 opened this issue · 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

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

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())

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

test.pdf

Here you go

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.