stavro / arc

:paperclip: Flexible file upload and attachment library for Elixir
1.16k stars 210 forks source link

How to upload a pdf/docx/xlsx file and we can get an thumbnail of the first page #259

Closed hoangvn2404 closed 6 years ago

hoangvn2404 commented 6 years ago

I see there is a transform function to generate a thumbnail version, but it only work for upload file with image type, is there any way I can upload PDF/docx file and can get the thumbnail of the first page of the document?

stavro commented 6 years ago

Yes - you can use any bash executable in your transform function. I'm not sure which command line utility would convert PDF to Image, but if you have one you can set it up as described in https://github.com/stavro/arc#complex-transformations