Search code examples
djangodjango-templatesdjango-viewswagtailwagtail-snippet

Generating WagtailCMS Document Previews


Is there a way to extend Wagtail's documents to show file previews? There's a service ( I have not tested ), which looks cool, but the free plan to Pro plan is a huge leap in cost. I am hoping someone has figured this out already and can point me to the solution. Thank you.


Solution

  • FilePreviews.io's 100 documents a month on the free plan seems pretty generous to me. You could try to build something similar, e.g. using ImageMagick to create PDF thumbnails:

    http://duncanlock.net/blog/2013/11/18/how-to-create-thumbnails-for-pdfs-with-imagemagick-on-linux/

    and use a service like Aspose to convert common file formats to PDFs:

    https://www.aspose.com

    Or you could do it manually, by adding a thumbnail field to your document model, and telling users to provide their own thumbnails.

    But if you or your client are uploading more than 100 documents a month, and you want reliable thumbnail generation for multiple document types, $49 a month may be better value than working it all out yourself.