Yes, I think you got it right. Of course, there are some web services, although I have no experience using them, so I will not list them here.
Creating a document thumbnail requires rendering documents and office documents such as docx to be so complex that only very few libraries / applications can display them. LibreOffice seems to be the best choice in this area.
Fortunately, a Python script already exists that provides a command line interface for conversion using LibreOffice / OpenOffice: unoconv . It should be able to use all export filters present in the office suite (including png and pdf).
I noticed that some problems are exported directly to png, but pdf export was mostly fine.
Btw: If you have problems with imagemagick, you can try ghostscript.
source share