Simple bash script to extract thumbnail from document