Skip to content

Commit

Permalink
PPF-524: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
chinapandaman committed Mar 16, 2024
1 parent 318340e commit 148133f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ pip install -U PyPDFForm

## Create a PDF wrapper

There are two classes provided by the library that abstract a PDF form. The `FormWrapper` class allows you to fill a
PDF form if you don't need any other API. More info about `FormWrapper` can be found
[here](simple_fill.md).

The class that implements most of PyPDFForm's APIs is `PdfWrapper`. It takes various optional parameters to instantiate,
with the most important one being the PDF form "template".

Expand Down
31 changes: 31 additions & 0 deletions docs/simple_fill.md
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())
```

0 comments on commit 148133f

Please sign in to comment.