I’m trying to use pdf-lib in an n8n Function Node, but I keep getting the error “pdf-lib not found”. I built a custom Docker image where I installed pdf-lib, but it still doesn’t seem to work.
{Cannot find module ‘pdf-lib’ [line 1], VMError}
I also tried installing it temporarily during runtime, but I still get the same error. I know there are API services for merging PDFs, but I want to run everything locally. I also looked into Strilling PDF, but unfortunately, I couldn’t get it to work properly.
Strilling Error{The service was not able to process your request [item 0]}
If anyone knows how to set up pdf-lib (or an alternative like Sterling PDF) correctly in n8n, I’d really appreciate some help.
I did a workaround of creating a microservice that handles the pdfs, defined it in the docker compose yml to startup with other services (based on the starter kit), and a code node that calls the microservice.
Hi, @ONLimitt
We’ve launched new custom node for working with PDF files.
Using this node, you can create a new PDF file from HTML, merge multiple PDF files or take a screenshot of a website.
All you need is just an API key for customjs.space.
You can also use our template for merging multiple PDF files.
We are really sorry, @jakeThai
That’s because of the issue with payload size exceeds.
We are working with it right now.
You can still try with small PDF files like invoice or something.
Thank you for your interests.
Have a good day.