aka easily download print a web page as a PDF.
- Start the server:
docker compose up
- Print the example.org page: http://localhost:3000/?url=http://example.org&name=mysite.pdf
Bun and WeasyPrint should be installed on your system.
Run the server on port 3000:
bun index.ts
You can change the port by passing it as argument: bun index.ts 1234
to run on port 1234.
Now generate a PDF from a web page and call it "example.pdf": http://localhost:3000/?url=https://www.iana.org/help/example-domains&name=example.pdf
I needed a PDF printer that could be simple, light and quick to run.
This script on only 20 lines of code with no lib dependency!
This software is free and provided with an MIT license attached.