Try it out
Be aware that the deployed demo instance is with minimal resources. If it does not work it may be maxxed out, or scaled to zero. In the second case after few seconds it should work again. In the first.. well stop ddosing pls.
tl;dr for the curious ones
Resources:
- github logo mcraa/libre-to-pdf-node
- docker logo docker pull mcraa/libre-to-pdf-node
- special thanks to Libre office as most of the work is done by them.
- as well as to the creator of the node lib used office-to-pdf
So what is added here?
Simple web server created with one endpoint making that CLI command happening. So you can use it with one click.
Or one docker run.
Or simply adding it to a kubernetes cluster.
You choose your cup of tea.
Background story
Recently a client who handles documents with sensitive data on their web application wanted to have previews online of all the files uploaded. My colleague quickly realized converting to PDF is the way to go, but all solutions he quickly found were sending the file to an unknown thirdparty blackbox. Which was not acceptable of course.
Luckily a very similar problem existed years ago (just check the commit date in the repo). Search on docker hub improved since then, while writing this I found a similar solution 4 years older.
So we added a container to the clients cluster, the files never leave our solution, and all files can have preview now as the browser handles pdf easily.