Skip to content

Commit

Permalink
Minor docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas-C committed Apr 12, 2023
1 parent 01816de commit 08f8e4c
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions docs/UsageInWebAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Note that `FPDF` instance objects are not designed to be reusable:
Hence, even if the `FPDF` class should be thread-safe, we recommend that you either **create an instance for every request**,
or if you want to use a global / shared object, to only store the bytes returned from `output()`.


## Django ##
[Django](https://www.djangoproject.com/) is:
> a high-level Python web framework that encourages rapid development and clean, pragmatic design
Expand All @@ -24,6 +25,7 @@ def report(request):
return HttpResponse(bytes(pdf.output()), content_type="application/pdf")
```


## Flask ##
[Flask](https://flask.palletsprojects.com) is a micro web framework written in Python.

Expand All @@ -46,6 +48,7 @@ def hello_world():
return response
```


## AWS lambda ##
The following code demonstrates some minimal [AWS lambda handler function](https://docs.aws.amazon.com/lambda/latest/dg/python-handler.html)
that returns a PDF file as binary output:
Expand Down Expand Up @@ -145,14 +148,6 @@ st.download_button(
)
```

## Jupyter ##
Check [tutorial/notebook.ipynb](https://github.com/PyFPDF/fpdf2/blob/master/tutorial/notebook.ipynb)

## web2py ##
Usage of the original PyFPDF lib with [web2py](http://www.web2py.com/) is described here: <https://github.com/reingart/pyfpdf/blob/master/docs/Web2Py.md>

`v1.7.2` of PyFPDF is included in `web2py` since release `1.85.2`: <https://github.com/web2py/web2py/tree/master/gluon/contrib/fpdf>


## FastAPI ##
[FastAPI](https://fastapi.tiangolo.com/) is:
Expand Down Expand Up @@ -205,3 +200,13 @@ async def create_pdf(request: Request):
raise HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e))

```


## Jupyter ##
Check [tutorial/notebook.ipynb](https://github.com/PyFPDF/fpdf2/blob/master/tutorial/notebook.ipynb)


## web2py ##
Usage of the original PyFPDF lib with [web2py](http://www.web2py.com/) is described here: <https://github.com/reingart/pyfpdf/blob/master/docs/Web2Py.md>

`v1.7.2` of PyFPDF is included in `web2py` since release `1.85.2`: <https://github.com/web2py/web2py/tree/master/gluon/contrib/fpdf>

0 comments on commit 08f8e4c

Please sign in to comment.