Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
bits-to-dead-trees
Advanced tools
🖥 -> 🌲 -> 📄 -> 🖨
Exposes a web server with a single endpoint to take in a URL and create a PDF out of that. It's using Playwright in the background for this.
git checkout https://github.com/rmehner/bits-to-dead-trees
cd bits-to-dead-trees
npm install
npm start
to start the server. It'll listen to port 8000 on localhost by default.playwright
dependency, you should run npm run update-schemas
to make sure that
the server knows about new PDF optionsnpm run start:dev
to start everything in dev mode with build watch and friendsThe server exposes the /pdf
endpoint that listens to a POST request and expects a JSON body:
{
"url": "https://your-target-url.com/site/you/want/a/pdf/of",
"pdfOptions": {},
"gotoOptions": {},
"browserContextOptions": {}
}
pdfOptions
are the options for the pdf
call in Playwright: https://playwright.dev/docs/api/class-page#page-pdf.gotoOptions
are the options for the goto
method in Playwright: https://playwright.dev/docs/api/class-page#page-goto
networkidle
browserContextOptions
are the options for the browser context in Playwright: https://playwright.dev/docs/api/class-browser#browser-new-context
ignoreHTTPSErrors
to true
The response is the PDF file.
Versions are automatically build as Docker images and are available on GitHub's package registry
If you want to use it internally with docker-compose, this should give you a good idea to start:
services:
pdf:
image: ghcr.io/rmehner/bits-to-dead-trees:v2.20.0
ports:
- 8000:8000
FAQs
Turn HTML into PDF files
We found that bits-to-dead-trees demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.