Use @app.call(env) if not rendering for pdf.