Hey folks, I'm trying to convert my pdf to images, and it seems setGMClass(true) is going to help me, however, it seems it only supports ImageMagick version >=7, since mine failed with version 6.9.
My code:
const pdf2picConvert = pdf2pic.fromBuffer(fileBuffer, {
format: 'png',
preserveAspectRatio: true,
density: dpi // output pixels per inch
})
pdf2picConvert.setGMClass(true) // Use ImageMagick - this is the key line, so you don't have to touch return type
const pageNumber = 1
const imageBufferResponse = await pdf2picConvert(pageNumber, {
responseType: 'buffer'
})
Asking because I'm using vercel serverless api, and they only have ImageMagick 6.9 available in their image, they don't have graphicsmagick. Hence my struggle here
Hey folks, I'm trying to convert my pdf to images, and it seems
setGMClass(true)
is going to help me, however, it seems it only supports ImageMagick version >=7, since mine failed with version 6.9.My code:
Asking because I'm using vercel serverless api, and they only have ImageMagick 6.9 available in their image, they don't have graphicsmagick. Hence my struggle here