Refactor PDF renderer.