https://github.com/markruler/htmltopdf
API server to generate PDF from HTML
https://github.com/markruler/htmltopdf
html-to-pdf pdf playwright
Last synced: about 2 months ago
JSON representation
API server to generate PDF from HTML
- Host: GitHub
- URL: https://github.com/markruler/htmltopdf
- Owner: markruler
- Created: 2024-08-21T06:12:38.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-01-08T03:59:15.000Z (4 months ago)
- Last Synced: 2025-04-02T05:32:35.578Z (about 2 months ago)
- Topics: html-to-pdf, pdf, playwright
- Language: Python
- Homepage: https://markruler.github.io/posts/pdf/html-to-pdf/
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HTML to PDF
API server to generate PDF from HTML.
## Prerequisites
- Python 3.9+
## Usage
### Running with Docker
```shell
make docker-build
``````shell
make docker-run
```### Running locally
```shell
python -m venv .venv
source .venv/bin/activate
pip install --no-cache-dir --upgrade -r requirements.txt
playwright install --with-deps # chromium, firefox, webkit, etc.
``````shell
make run
```Running as a background process:
```shell
nohup .venv/bin/uvicorn htmltopdf:app --host=0.0.0.0 --port=38000 > /dev/null 2>&1 &
```## References
- To avoid zombie processes
- [Suggested configuration](https://playwright.dev/docs/ci#docker) - Playwright
- [Docker](https://playwright.dev/docs/docker) - Playwright
- [Playwright를 사용해서 HTML 페이지를 PDF로 만들기](https://markruler.github.io/posts/pdf/html-to-pdf/)