render_pdf function

Render to pdf