pdfjs
Our great sponsors
pdfjs | chrome-headless-render-pdf | |
---|---|---|
2 | 1 | |
760 | 221 | |
- | - | |
6.9 | 2.5 | |
4 months ago | 8 months ago | |
JavaScript | JavaScript | |
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
pdfjs
-
Is node the right choice for HTML to PDF conversion?
pdfjs was pretty good when I used it https://github.com/rkusa/pdfjs
-
Astro JS non-HTML Routes: File & Resource API
We use the pdfjs package here to generate the PDF for us. It just has dummy content in our case. You might generate it from scratch or compose it from other PDFs in your real-world app. See more on pdfjs usage in the docs. The most important part is the output we return in line 12. For a static site, aim to return an object with a body field which is a string. For SSR you can return a Response object instead and even stream HTML. We use binary encoding here which makes sure Astro encodes PDFs including images (for example) correctly — thanks to @altano for tip here.
chrome-headless-render-pdf
-
API-driven dynamic PDF generator.
You could generate html using your own tools like Django or PHP and then use something like chrome-headless-render-pdf to convert your page to pdf. I haven't tried it but I think it would work okay. You probably have to serve the pdfs on a webserver or something because it looks like they are just saved to disk after conversion.
What are some alternatives?
pdf-lib - Create and modify PDF documents in any JavaScript environment
Dompdf - HTML to PDF converter for PHP
react-pdf - 📄 Create PDF files using React
chromic_pdf - Convenient HTML to PDF/A rendering library for Elixir based on Chrome & Ghostscript
pdfmake - Client/server side PDF printing in pure JavaScript
DownloadNet - 💾 DownloadNet - All content you browse online available offline. Search through the full-text of all pages in your browser history. ⭐️ Star to support our work!
satori - Enlightened library to convert HTML and CSS to SVG
carbone - Fast and simple report generator, from JSON to pdf, xslx, docx, odt...
node-anvil - Node API Client for Anvil
screenshoteer - Make website screenshots and mobile emulations from the command line.
svg2pdf.js - A javascript-only SVG to PDF conversion utility that runs in the browser. Brought to you by yWorks - the diagramming experts
pdf-bot - 🤖 A Node queue API for generating PDFs using headless Chrome. Comes with a CLI, S3 storage and webhooks for notifying subscribers about generated PDFs