arun1
ChromicPDF seems to be the popular choice for pdf generation at the moment. However, I wanted to get some community input on pdf generation libraries that DO NOT have a dependency on Chromium, puppeteer etc. I am trying to avoid the dev ops overhead of managing these additional dependencies. I would rather just draw out a PDF from scratch.
Libraries I looked into:
elixir-pdf - seems functional for the basic needs.
elixir2pdf - The underlying erlang library erlguten is giving me compilation errors so I could not test this
Does anyone have any other suggestions ?
Trending in Questions
Hello!
Suppose you are building workflow (order / task / payment) processing system with the following requirements:
Each workflow con...
New
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app?
Looking for hints regarding:
Addi...
New
Kia ora,
We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
Hi all, I wanted to ask how the community is dealing with post-release steps.
Today we have Ecto migrations, which make sure that the db...
New
Hello,
I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
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
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #blog-post
- #phoenix_html
- #iex
- #graphql
- #ai
- #genstage
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex











First 10 of 21 Posts
gushonorato
Is generating PDFs on the server strictly required? I always generate PDFs on the client side when possible. The two main reasons are:
I’ve been using paged.js and I’m very happy with the results. It even allows me to show a preview before printing to the client.
If you really need to create PDFs on the server side, the most popular library is PdfGenerator, which uses WKHTML instead of Chrome or Puppeteer.
mindok
This thread has quite a few options: Looking for a Prawn-Like PDF Generation Library in Elixir
asianfilm
I’ve been using Typst, a Rust library for generating PDFs from markdown. Typst is also a pure functional language such that you can put display logic into functions in a template to keep such logic out of Elixir.
To use the latest version, 0.12, you’ll want to use it on the command line from Elixir. There is an Elixir library that packages the Rust for version 0.3 called ExTypst and a fork that updates it to version 0.9.
arun1
Thank you. I did look at PDF generator but unfortunately WKHTML has been archived and is no longer available through brew or asdf. It seems most people are trying to migrate of it.
acrolink
I find styling in in HTML and CSS then converting to PDF easier. As for generation using Chromium, the best way to do it is by using an AWS Lambda. Handles concurrency of multiple invocations perfectly.
MikeRocke
Just done whole investigation into this for work (we are a Java house).
If you can avoid it in the first place, that’s the best approach (i.e. let the client print as pdf from their browser and use css3 styling for print media).
I did contemplate the XSL-FO route, but that seems progressively out of fashion, (I believe it’s down to the push for better CSS for printed media).
I also thought about postscript or tex, but that felt just as fiddly.
I would love to hear your results!
D4no0
I think not, unless HTML will be page-size aware at some point, using that technology is very limited when it comes to generating more involved PDFs that actually need to follow some page structure.
I’ve used successfully latex for generating some pretty beefy PDFs before, however the way compiler was implemented makes it really hard to work with and it’s really laggy, especially if you have to do multiple passes. The best alternative on the market is mentioned above by @asianfilm,
typst.There is no great integration library in elixir, yet, but this shouldn’t stop you from using the compiler as external dependency.
MikeRocke
Ah sorry I might’ve missed something. I thought CSS supports page sizing with size CSS at-rule descriptor - CSS | MDN
Unless we are talking different things?
D4no0
Very interesting, this is certainly something new.
The main question is: can this be used to do things like displaying the page number at the bottom of every page?
MikeRocke
Great question! No idea on that one I’m afraid!