Hi all,
I would like to announce that we have released the first version of the streamlit-pdf-viewer. A component to show PDF documents in streamlit.
This component unwraps and shows PDF documents in streamlit and decorates them with annotations.

We are still actively working on it, and we welcome any help such as suggestions, comments, testers and developers :slight_smile:

Github: GitHub - lfoppiano/streamlit-pdf-viewer: Streamlit PDF viewer
Demo application:
Pypi: streamlit-pdf-viewer · PyPI


Is there a way to set the width of the displayed pdf to 100%. Something like this?

pdf_viewer(input=binary_data, width="100%", height=1000)

Also it would be useful if you show how to format the annotations in the readme. Like a short example. It is stated that it is a list of dictionaries but what should the dictionary look like.

@Odrec thanks. Indeed the annotations are not documented… sorry about that.

The width is tricky because the components are opened in an iframe, and we haven’t figured out how to get its sizes… but we are working on it.

I opened the two requests in the project’s Github: Issues · lfoppiano/streamlit-pdf-viewer · GitHub

Feel free to open up more issues.

@lfoppiano Great stuff, how can I zoom the pdf document? And I noticed the pdf’s resolution is decreased in the display. Any way to prevent that?

@dano, could you open a GitHub issue with some examples and the code that you used? I think it depends on the resolution you use and the PDF document. I’m happy to look into it.

As for the Zoom, we have already noted them, but for the moment, we are a bit short of time to work on it.