#!/usr/bin/env bash
if pdfistext $Sinput_file $start_page $end_page >/dev/null; then
pdftotext -f $Sstart_page -l $Send_page $Sinput_file - | text2wave -o $Smiddle_file;
else
pdftoppm -f $Sstart_page -l $Send_page -mono $Sinput_file - | gocr - | sed $sedargs | text2wave -o $Smiddle_file;
fi