Hi there,
Although it is not recommended, we can call external program (to create pdf) inside a stored procedure.
I can help to review the flow but if it is the only to go, I surely can do this for you.
I believe the html is reside inside a db field, isn't it?
Long live and prosper,
Sunandar Gusti