Streamlit-pdf-viewer

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: https://structure-vision.streamlit.app/
Pypi: streamlit-pdf-viewer · PyPI

11 Likes

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)

1 Like

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.

Hey @lfoppiano :wave:

Siddhant here, creator of PDF WorkDesk

Thank you for this component, I am using this extensively in my app!

Recently I noticed an issue with an Invalid Canvas Size error. This seems to be coming from pdf-viewer (thread below)

Is this something you are aware of? Or is there a way I can handle this from the app’s end?

1 Like

Hi @SiddhantSadangi and thanks for reaching out.

In my experience I’ve never had such issue, however I’m going to investigate invalid canvas size · Issue #54 · lfoppiano/streamlit-pdf-viewer · GitHub

You can follow up on github :wink:

1 Like