WeasyPrint
WKHTMLToPDF
WeasyPrint | WKHTMLToPDF | |
---|---|---|
44 | 57 | |
7,117 | 12,952 | |
1.7% | - | |
9.7 | 4.3 | |
8 days ago | almost 2 years ago | |
Python | C++ | |
BSD 3-clause "New" or "Revised" License | GNU Lesser General Public License v3.0 only |
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.
WeasyPrint
-
CSS Written in Pure Go
Also see a full web rendering engine (modern HTML+CSS the whole layout engine) made in pure Python, that can export to PDFs: https://github.com/Kozea/WeasyPrint
-
Launch HN: Onedoc (YC W24) – A better way to create PDFs
Is there a reason you didn't consider something like Weasyprint?
https://weasyprint.org
I've gone through a number of systems to convert CV's, business cards, and other docs and it hasn't let me down yet.
-
CSS for Printing to Paper
You don't _have_ to use a browser. I had very good results with Weasyprint [0]. And there's also PrinceXML [1] if you're willing to pay.
[0]: https://weasyprint.org/
-
Show HN: A new open-source library to design PDF using React
Thanks for your answer! I imagined you would be using PrinceXML behind the scenes since that is probably the gold standard in HTML+CSS rendering.
The only open source alternative I know of is WeasyPrint at https://weasyprint.org/. I'm not sure how well it fares against PrinceXML, though.
And thanks for the pointer to Taffy - I didn't know it before!
- 1.5M PDFs in 25 Minutes
-
Htmldocs: Typeset and Generate PDFs with HTML/CSS
Flexbox support has been [included][1] since 2018, although my use case was the prototypical one - a single row w/ 3 columns - so YMMV with how it handles more complex layouts.
[1]: https://github.com/Kozea/WeasyPrint/pull/579
-
How to Simply Generate a PDF From HTML in Symfony With WeasyPrint
Performance is not the strength of WeasyPrint, meaning that heavy HTML files will increase generation time. You should always compress images before attaching them, as they are not compressed by default. Generating a 50-page-long PDF may take up to a minute in extreme cases, although multi-page documents generated on my project take fewer than 2 seconds to generate.
-
Show HN: Invoice Dragon – An Open Source App to Create PDF Invoices for Free
For Python there is Weasyprint: you prepare the invoice as an HTML document, and Weasyprint turns it into a PDF
https://weasyprint.org/
-
The Gemini protocol seen by this HTTP client person (curl dev)
Well yes, but you can implement HTML+CSS. WeasyPrint did from scratch, and independent implementations of HTML+CSS are considerably more numerous than HTML+CSS+JS.
-
Library to convert HTML to pdf in Golang
In a recent project I used https://github.com/Kozea/WeasyPrint/ it is written in python, so you will need to use it like so:
WKHTMLToPDF
-
Job Adventures - PDF generation | Jun 2024
Some of those problems I had in the past, but at the time I was just rendering tables for a financial report. The main problem I remember having was the CSS part and the long generation time. Because I was not implementing the styling at the time, the CSS part was not really my problem, and I am sure wicked_pdf provides some default styles to help in this part. The long processing times were a problem because we were generating pdfs with over 100 pages, this process would take about 5 min and would get worse if more pdfs were being requested in parallel. I can’t remember what the solution was at the time but I think we ended up generating some pdfs in the background and sending them by email when ready. The wicked_pdf gem uses an instance of https://github.com/wkhtmltopdf/wkhtmltopdf under the hood. This causes problems because it can only generate pdfs one by one. The solution would probably be having a dedicated service that would orchestrate multiple wkhtmltopdf instances.
- Show HN: CLI for generating beautiful PDF for offline reading
-
Working with PDFs in Ruby
We’ll start with the WickedPDF gem, which is powered by the wkhtmltopdf command-line library.
-
Any good tutorials for working with pdfs in Rust?
The only “sane” way I’ve found to be able to deal with pdfs is through this tool https://wkhtmltopdf.org/
-
Batch saving webpages to PDFs? (Sub wiki page deleted)
wget + https://wkhtmltopdf.org/
-
Get attributes from another session without loading that session
Thanks for the suggestion! KnpSnappyBundle was my initial way to go as well, but my pages use quite some Javascript (chartJs) to render and I couldn’t get wkhtmltopdf to work with it. As it seems wkhtmltopdf does not support ES6 https://github.com/wkhtmltopdf/wkhtmltopdf/issues/3596 so I was forced to find another way.
-
Open Source Tool to create a PDF structure via coding?
wkhtmltopdf — Generates PDFs from HTML documents.
-
Fixed width tables in PDFs
Of the HTML-based pdf-engines pandoc supports, prince would have the best typography, but I don't like recommending Prince because it's proprietary and costs money. (I try to stick to open source when I can.) wkhtmltopdf is the fastest, but uses a pretty old codebase, and doesn't even support paged/print css. weasyprint is a little better in my experience, but still has a ways to go typographically. pagedjs-cli is just a wrapper around headless Chrome/Chromium, and while Chrome has made improvements with regard to typography, Google turns off some of those features (e.g., hyphens) in headless mode, which is annoying.
-
Is there a command line program to convert web pages into readable markdown/htm/pdf format? preferably markdown
Concerning pdf there is the well known wkhtmltopdf , but let me say that I love the not so well known percollate
-
LaTex alternative/replacement written in Rust?
Did you try wkhtmltopdf and WeasyPrint, by any chance?
What are some alternatives?
ReportLab
Dompdf - HTML to PDF converter for PHP
PyPDF2 - A pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files
DinkToPdf - C# .NET Core wrapper for wkhtmltopdf library that uses Webkit engine to convert HTML pages to PDF.
QuestPDF - QuestPDF is a modern open-source .NET library for PDF document generation. Offering comprehensive layout engine powered by concise and discoverable C# Fluent API. Easily generate PDF reports, invoices, exports, etc.
TCPDF - Official clone of PHP library to generate PDF documents and barcodes
PDFMiner - Python PDF Parser (Not actively maintained). Check out pdfminer.six.
mPDF - PHP library generating PDF files from UTF-8 encoded HTML
MathJax - Beautiful and accessible math in all browsers
puppeteer - JavaScript API for Chrome and Firefox
pdftabextract - A set of tools for extracting tables from PDF files helping to do data mining on (OCR-processed) scanned documents.
Snappy - PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage