implemented tempfile and urls for pdf export, yet to be tested in production