manuel-rubio

manuel-rubio

Because I don’t want to continue using wkthmlpdf or chromium/chrome for only exporting a HTML to PDF, I decided to create a library called Press that lets us convert an HTML document directly to PDF. This library was designed for use inside Conta, where we need to generate invoices, and it works very well.

Press is a dependency-free Elixir library for rendering HTML+CSS into PDF, targeting structured business documents: invoices, delivery notes, payslips, and reports. “Dependency-free” means zero runtime dependencies — only modules that ship with OTP itself (e.g. :zlib) are used.

Check it out and let me know what you think.

Showing Posts 1 to 10

Lucassifoni

Lucassifoni

You’re implementing HTML+CSS rendering à la weasyprint in Elixir ? Interesting, I will monitor it closely.

manuel-rubio

manuel-rubio OP

Well, it’s not the first time"crazy" project I do, previously I did myproto to simulate a MySQL server, ephp for putting PHP on top of Erlang, and I rewrote Lambdapad for getting a good website static generator. This time my pain was I don’t want to install chrome on my server and get timeouts when generating a PDF or even worse, dedicate 1GB only for that.

abrookewood

abrookewood

This is great - I was looking for something a while ago and wasn’t really happy with the options. Ended up skipping PDF and just exporting a markdown file as a result. I would definitely have been happier with this!

alvinkatojr

alvinkatojr

This is great! We had another pdf library for directly working with pdfs and now this one which converts html and css to pdf. Big ups to you and every body else who’s made working with pdfs in Elixir a breeze! Many thanks!

RodolfoSilva

RodolfoSilva

Great!

Personally, with AI, I just use https://typst.app/. It’s a fast and maintainable way to generate PDFs. It has drastically reduced resource consumption and gives me a more standard way to write documents without having to use HTML.

manuel-rubio

manuel-rubio OP

Not a bad solution, but I’d like to avoid dependencies on third-party elements for the project where I’m using Press, that’s because I created it. Keep in mind that it was created for even drop internal dependencies like Chrome. Thanks for the info.

olivermt

olivermt

Typst is a tiny binary and also a standard format similar to latex templates fwiw. But this library you made is still cool as hell imo!

manuel-rubio

manuel-rubio OP

Yes, but as I said, I don’t like to run third-party dependencies. If I wanted to do that, I could continue using chromic_pdf using chrome/chromium or wkthmltopdf under the hood. I’m not saying it’s not a good solution, but it’s not the solution I was looking for.

olivermt

olivermt

That comparison makes it seem like you haven’t looked closely at what typst actually is? The “third party dependency” is an OSS rust nif through rustler that runs super lightweight.

How can you compare that with deploying chromium on the runtime?

Chromic is orders of magnitude better than the other chrome based pdf solutions out there, but it is still an operational nightmare compared to the embedded typst nif.

manuel-rubio

manuel-rubio OP

A dependency could be integrated into the code, or you could use it as an external command. If we use chromic_pdf, we depend on Chrome, Chromium, or wkhtmltopdf. If we use typst, we have a dependency on typst; even if that’s not integrated into the code, we need to use it, so we depend on it.

Besides that, I want you to understand I’m not saying Typst is a bad product. I know it’s great for generating nice PDFs from specifications, and it’s very valuable. But my point is: I don’t like internal or external dependencies. That’s all.

And above all, thanks for giving us this heads-up about this tool. For sure, I’ll use it for other projects.

Where Next? Top

Trending in Announcing Top

restlessronin
The repo is at GitHub - cyberchitta/openai_ex: Community maintained Elixir library for OpenAI API · GitHub. Docs are at OpenaiEx User Gu...
152 12366 136
New
type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
kip
I’ll shortly be launching Text, a nascent text analysis library. Current functionality In this early version (not ready for prime time) ...
New

Other Trending Topics Top

budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New
Null-logic-0
What IDE or editor are you using for Elixir development? Personally, I use Zed, and I really like it, but sometimes I wish there were a ...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews