What is the Best Way to Convert a PDF into an Image in Pipedream using NodeJS?

This topic was automatically generated from Slack. You can find the original thread here.

Hi all :wave:,
I’m having a lot of trouble trying to convert a PDF to an image (base64image) in my nodejs step. I’m trying to convert the pdf to an image so I can feed it into a GPT4o vision api call.

I’ve tried using pdf2pic npm package but pipedream seems to be missing the GraphicsMagick dependancy. Then i tried using pdf-poppler but the step kept failing with an error: "Worker stopped with exit code 1 ".

It seems like pipedream doesn’t support these packages…?

Can you please recommend the best way to convert a pdf into an image on pipedream? Any help or guidance is much appreciated :pray:

I’ve had to hand manage my conversions using _https://codebeautify.org/image-to-base64-converter_ That has worked very well. Then I use the Pipedream file system and nodejs to manage the base64image from there…

you can also consider Acrobat Services, it’s a commercial API for PDF conversion takes from Adobe, but we’ve got a good free tier. feel free to ping me if you want to know moe

more even

thank you for your recommendations, but I ended up just hosting a node express server with an custom endpoint to convert it myself