I’m in the process of migrating a website from a Laravel backend to a Rust Actix backend, and I need some advice on a specific feature implementation.
In the Laravel setup, we have a feature that allows users to create reports using Blade templates and then print these reports. My goal is to replicate this functionality in Rust, and for templating, I’m using Tera.
Here’s where I’m hitting a roadblock:
Dynamic HTML to PDF Conversion: In Laravel, converting Blade templates to PDFs was straightforward. However, in Rust, I haven’t found a crate or library that seamlessly converts HTML generated from Tera templates into PDF format.
Current Tools and Their Limitations:
Printpdf: While it’s a great library for creating PDFs in Rust, it doesn’t support dynamic HTML rendering.
wkhtmltopdf: This tool can convert HTML to PDF but requires system installation, which isn’t ideal for my use case.
What I’m looking for is a Rust Actix equivalent to Laravel’s Blade templates, specifically for generating and downloading dynamic PDFs directly from HTML templates without relying on system dependencies.
If anyone has experience with this or suggestions for libraries or approaches, your input would be greatly appreciated!
Thanks in advance!
Rust library that can convert dynamic html to pdf