https://github.com/misl6/py4web-weasyprint
WeasyPrint plugin for py4web, easely create PDF files via py4web
https://github.com/misl6/py4web-weasyprint
py4web py4web-plugin weasyprint
Last synced: 9 months ago
JSON representation
WeasyPrint plugin for py4web, easely create PDF files via py4web
- Host: GitHub
- URL: https://github.com/misl6/py4web-weasyprint
- Owner: misl6
- License: bsd-2-clause
- Created: 2020-03-28T11:38:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-30T10:06:52.000Z (about 6 years ago)
- Last Synced: 2025-06-13T21:45:55.674Z (about 1 year ago)
- Topics: py4web, py4web-plugin, weasyprint
- Language: Python
- Homepage:
- Size: 98.6 KB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# py4web-weasyprint
Easely generate PDF outputs via [WeasyPrint](https://github.com/Kozea/WeasyPrint) on top of [py4web](https://github.com/web2py/py4web).
## Installation
Considering that this plugin works on top of `weasyprint`, it needs some external dependencies as weasyprint does.
### Step 1)
Follow [these install instructions](https://weasyprint.readthedocs.io/en/latest/install.html#linux) if you're on a **Linux** distro.
Follow [these install instructions](https://weasyprint.readthedocs.io/en/latest/install.html#macos) if you're on **MacOS**.
Follow [these install instructions](https://weasyprint.readthedocs.io/en/latest/install.html#windows) if you're on **Windows**.
### Step 2)
#### Building from source:
`python setup.py install`
#### Installing from pip:
`pip install py4web-weasyprint` (still not available)
## Example
```python
from py4web_weasy import WeasyTemplate
@action('mypdfpage')
@action.uses(WeasyTemplate("mypdfpage.html"))
def mypdfpage():
return {}
```