From 27d338dec0428bc22e2838eb8641c6e0d1681e22 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 10 May 2013 20:46:04 +0200 Subject: Include mk* scripts --- mkpdf2htm-default | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 mkpdf2htm-default (limited to 'mkpdf2htm-default') diff --git a/mkpdf2htm-default b/mkpdf2htm-default new file mode 100755 index 0000000..dbf408a --- /dev/null +++ b/mkpdf2htm-default @@ -0,0 +1,23 @@ +#!/bin/sh + +# convert text from PDF to HTML + +set -e + +# resolve options +eval set -- "$(getopt -s sh -o f -- "$@")" +while true; do case "$1" in -f) force=1; shift;; --) shift; break;; esac; done + +. /lib/lsb/init-functions + +log_action_begin_msg "Convert PDF → HTML" +for stem in "$@"; do + infile=$stem.pdf + outfile=$stem.htm + log_action_cont_msg $stem + [ -n "$force" ] || [ ! -f $outfile ] || [ $outfile -ot $infile ] || [ $outfile -ot "$0" ] || { log_warning_msg "skipped"; continue; } + pdftohtml -q -c -s -i $infile + mv -f $stem-html.html $outfile + rm -f $stem-outline.html +done +log_action_end_msg $? -- cgit v1.2.3