#!/bin/bash # # Convert PDF to hybrid HTML output with images and line art rendered to a # background image, and text overlaid on top as absolutely positioned HTML # text. input=$1 out=${2:-out} fmt=${3:-png} dpi=${4:-96} scale=$(expr 72 '*' $dpi / 96) if test -f "$1" then echo Processing "$input" out=$out fmt=$fmt dpi=$dpi else echo "usage: pdftohtml.sh input.pdf output-stem image-format dpi" echo " example: pdftohtml.sh input.pdf output png 96" exit fi title=$(basename "$input" | sed 's/.pdf$//') mutool convert -Oresolution=$dpi -o $out.html "$input" sed -i -e "/
/a