have generating html and pdf working on server side