#!/bin/sh


pdffile=$1
pdfname=$(pdftohtml -i -stdout "${pdffile}" | grep TITLE | \
	sed -e "s_<TITLE>\(.*\)</TITLE>_\1_g" | \
	w3m -dump  -T text/html -O ascii| sed -e "s_[ /]__g" )

mv "${pdffile}" "${pdfname}.pdf"

