Command line tricks: converting file formats



Command line tools: convert, pandoc, mutool.


  • PNG to EPS
    convert input.png eps2:output.eps
    

  • PNG to PDF
    mutool convert -o output.pdf input.png
    mutool convert -o output.pdf *.png # multiple images
    

  • PDF to TXT
    mutool draw -F txt input.pdf -o output.txt
    

  • PDF to PNG (pages 1-10, rotate 90 degree, resolution 200 dpi)
    mutool convert -O rotate=90 resolution=200 -o output%d.png input.pdf 1-10
    

  • LaTeX to Docx with bibliography (in IEEE style)
    pandoc -s input.tex --bibliography input.bib --citeproc --csl ieee.csl -o output.docx
    

  • LaTeX bibliography to HTML (in IEEE style)
    pandoc -s input.bib --citeproc --csl ieee.csl -o output.html