olefs

command line tools to extract data from OLE documents like doc, ppt, xls, msg
git clone https://logand.com/git/olefs.git/
Log | Files | Refs

ppt2html (383B)


      1 #!/usr/bin/env bash
      2 set -euo pipefail
      3 d=$(mktemp -d -q)
      4 (
      5     cd $d
      6     cfb cat "$1" '/Root Entry/PowerPoint Document' >.doc
      7     ppt html .doc >index.html
      8     rm .doc
      9     cfb cat "$1" '/Root Entry/Pictures' >.pic
     10     ppt extract .pic
     11     rm .pic
     12     ls * \
     13         | grep -v index.html \
     14         | sort -n \
     15         | xargs -n 1 -I{} echo '<img src="{}">' >>index.html
     16     echo $d
     17 )