:panda_face: Extracted methods from the middleware method render_as_pdf?.