I am building a print-on-demand integration that demands the pdf files have certain dimensions for Media and Crop boxes. I have looked around and didn’t manage to find a library to do this kind of manipulation in Elixir. I have found https://pdf-lib.js.org/ which fits my use case perfectly.
How do I use this library in Elixir ? Or am I better off writing a Javascript micro service to handle pdf manipulation ?
You are literally running node as a separate process in the method I described so you can do whatever you want with that node process. You would just write it in such a way that it communicates over stdin/stdout and the elixir port can interact with it. See Port — Elixir v1.12.1 for more.