We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug If a PDF file is changed whilst in a session, the new PDF is not shown. The old PDF must be cached in the browser in some way.
Expected behavior I expect the new PDF to be shown after closing and re-opening the preview display.
Potential Solution Convert PDF into bytes and load use base64.
from base64 import b64encode def preview_pdf(path: pathlib.Path): if not isinstance(path, pathlib.PurePath): path = pathlib.Path(path) with open(path, "rb") as pdf_file: content_b64 = b64encode(pdf_file.read()).decode() return IFrame(src=f"data:application/pdf;base64,{content_b64}", width=1000, height=1000)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
If a PDF file is changed whilst in a session, the new PDF is not shown. The old PDF must be cached in the browser in some way.
Expected behavior
I expect the new PDF to be shown after closing and re-opening the preview display.
Potential Solution
Convert PDF into bytes and load use base64.
The text was updated successfully, but these errors were encountered: