how can I pass data, actually file's base64 code, straight from flask(python) to javascript, but without using render_template or redirect?
I need to do that, because send_from_directory is downloading .pdf file straight to user's computer, I need just a pre-view of .pdf file, so I get file's code by .read(), encode with base64, and what I want to do is decode that in js/jquery and generate new pdf with that code.