Refactor PDF helper, and render pdf on browser.