One possible issue is that the file variable might not be properly resolving to the correct file path. Make sure that the file variable contains the correct file path to the PDF file that you want to display.
You might also want to check that the file exists at the specified location and that your Streamlit app has the necessary permissions to access it.
Let me know how it goes. If it’s still not working, we can take a closer look
I have made a sample HTML page with the same html markdown snippet, located in the same path as the streamlit python file. This one show the file as expected.
Using this minimal streamlit code (MinimalSolution.py) to show a PDF-file:
@Goyo
The iframe approach may not work well anymore, tested in MS edge and chrome, iframes are blocked. The section of your blog about pdf is also not displayed correctly
It works for me using Firefox 110.0.1 but not Edge 112.0.1722.58 (Windows 10) when running in Streamlit Cloud. It works with both browsers when running in localhost.