Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant insert Signature to the PDF #633

Open
bharathreddy1997 opened this issue May 14, 2024 · 5 comments
Open

Cant insert Signature to the PDF #633

bharathreddy1997 opened this issue May 14, 2024 · 5 comments

Comments

@bharathreddy1997
Copy link

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

@chinapandaman
Copy link
Owner

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

@bharathreddy1997
Copy link
Author

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

@chinapandaman
Copy link
Owner

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

@bharathreddy1997
Copy link
Author

test.pdf

Here you go

@chinapandaman
Copy link
Owner

chinapandaman commented May 14, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants