serverlesspub / imagemagick-aws-lambda-2

ImageMagick for AWS Lambda 2 runtimes
https://serverless.pub
Other
259 stars 163 forks source link

GS lib support #1

Closed chocolatetoothpaste closed 5 years ago

chocolatetoothpaste commented 5 years ago

Is it possible to include gslib to support manipulation of PDFs? I need support for PDFs in my lambda function but as of yet cannot find a solution that will work. Compiling Imagemagick from source results in a zip way too large to upload to Lambda as a layer (at least the way I am using to compile).

Thanks

gojko commented 5 years ago

looks like imagemagick needs gs for PDFs, gslib is just improving startup time, so including just that lib won't do much (https://www.imagemagick.org/discourse-server/viewtopic.php?t=21224). what exactly do you need to do with PDFs, perhaps there is a simpler solution?

chocolatetoothpaste commented 5 years ago

I need to convert a single-page pdf into an image (in python). I have not been able to make other solutions work yet, imagemagick/wand are the closest I've gotten so far.

gojko commented 5 years ago

you'll need ghostscript for that, not imagemagick, so try finding gs for lambda somewhere - you might be able to use the binary from this page (haven't tried it myself, but it's worth a shot): https://www.ghostscript.com/download/gsdnld.html

TiberioG commented 1 year ago

Hello, I also need pdf support, since my use case is converting svg to pdf in a lambda layer. Using inskcape is not feasible, and cairoSVG cannot be used due to a bug with svg masks which I intensively use. Anyone was able to edit this repo to add GS? thanks