Converts all document formats using LibreOffice first to PDF and then to an image, using build-in pdf previwer of ActiveStorage
- needs:
unoconv
, a command line tool which uses libreoffice, e.g.apt install unoconv
- needs a PDF converter, because libreoffice will make a pdf from the office document, Mupdf oder Poppler are already integrated into ActiveStorage, and poppler is free to use, e.g.
apt install poppler-utils
Line 32 works only as:
previewer.new(blob).send(:draw_first_page_from, output_pdf, &block)