Sigh. Well, no joy on the mac, despite the presumed promise of platform-neutral Python.
Python 2.5.1:
line 8: !DOCTYPE: No such file or directory
line 9: syntax error near unexpected token `newline'
line 9: ` "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>;
Python 3.0:
File "pdfmunge.py", line 8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
^
SyntaxError: invalid syntax