-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
318340e
commit 148133f
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,32 @@ | ||
# Fill a PDF form in place (beta) | ||
|
||
**NOTE:** This page contains beta features, meaning it's known that these features do not support some PDF forms but | ||
currently there are no plans and/or solutions to fix them. | ||
|
||
The `FormWrapper` class allows you to fill a PDF form in place as if you were filling it manually. The resulted filled | ||
PDF form will NOT be flattened and will still be editable. | ||
|
||
Similar to the `PdfWrapper` class, the `FormWrapper` also supports widgets including text fields, checkboxes, radio | ||
buttons, dropdowns, and paragraphs. However, it does NOT support signature widgets. | ||
|
||
Consider [this PDF](https://github.com/chinapandaman/PyPDFForm/raw/master/pdf_samples/dropdown/sample_template_with_dropdown.pdf): | ||
|
||
```python | ||
from PyPDFForm import FormWrapper | ||
|
||
filled = FormWrapper("sample_template_with_dropdown.pdf").fill( | ||
{ | ||
"test_1": "test_1", | ||
"test_2": "test_2", | ||
"test_3": "test_3", | ||
"check_1": True, | ||
"check_2": True, | ||
"check_3": True, | ||
"radio_1": 1, | ||
"dropdown_1": 1, | ||
}, | ||
) | ||
|
||
with open("output.pdf", "wb+") as output: | ||
output.write(filled.read()) | ||
``` |