0

I will be doing some pdf generation for my application. Currently, my plan is to create HTML using templates and convert them to PDF.

The pdf's aren't long. Maximum 3 pages. And approximately we will be making approx 100 docs in a day.

I was happy with the results I got from chrome --headless in my local machine. I called the cli command directly from my clojure code. So far so good. Looking at the number of wrappers available (Browserless, Chromeless, Puppeteer, ...) I'm not sure about the scalability factor in production.

  • Is it safe to use/call the chrome cli directly in production boxes?
  • What will I miss if I skip these wrappers?

My server side stack is Clojure/Compojure/Leiningen. Any insights/alternatives are appreciated.

Prasanna
  • 10,956
  • 2
  • 28
  • 40

2 Answers2

0

Instead of detouring through html and chrome, I'd just use a pdf creating library such as clj-pdf. Here is a nice blog post about it.

p.s. If you dont mind running a third program to generate the pdf, I would have used emacs with org-mode (or heck, even writing it in elisp altogether) ;)

stm
  • 662
  • 1
  • 6
  • 23
Shlomi
  • 4,708
  • 1
  • 23
  • 32
0

I'm using Athena PDF for pdf generation in combination with Clojure:

https://github.com/arachnys/athenapdf

It has a REST interface. Since it runs in Docker its easy to scale.

Michiel Borkent
  • 34,228
  • 15
  • 86
  • 149