Skip to content

Commit

Permalink
Merge pull request #505 from chinapandaman/PPF-503
Browse files Browse the repository at this point in the history
PPF-503: update docs for filling signature field
  • Loading branch information
chinapandaman authored Feb 16, 2024
2 parents 89d46f8 + dc89d81 commit 5ee8c6d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/fill.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,27 @@ filled = PdfWrapper("sample_template_with_dropdown.pdf").fill(
with open("output.pdf", "wb+") as output:
output.write(filled.read())
```

## Fill signature widgets

A signature field widget allows you to sign a PDF form in a handwritten format. PyPDFForm lets you use a signature image to populate
any signature field widget.

Consider [this PDF](https://github.com/chinapandaman/PyPDFForm/raw/master/pdf_samples/signature/sample_template_with_signature.pdf)
and [this signature image](https://github.com/chinapandaman/PyPDFForm/raw/master/image_samples/sample_signature.png):

```python
from PyPDFForm import PdfWrapper

signed = PdfWrapper("sample_template_with_signature.pdf").fill(
{
"signature": "sample_signature.png"
},
)

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

**NOTE:** As described [here](install.md/#create-a-pdf-wrapper), the value of the signature in your dictionary can be a file path shown above, but also an open file object and a file stream
that's in `bytes`.

0 comments on commit 5ee8c6d

Please sign in to comment.