Updated html->pdf middleware and spec