Skip to content
New issue

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

Render only a selection of pages #1

Merged
merged 2 commits into from
Feb 13, 2024
Merged

Conversation

t29mato
Copy link
Collaborator

@t29mato t29mato commented Feb 9, 2024

@lfoppiano
Copy link
Owner

lfoppiano commented Feb 9, 2024

@t29mato I'm not so sure, but it seems you linked the wrong issue 🤔

@lfoppiano lfoppiano changed the title to select pdfs to show Render only a selection of pages Feb 9, 2024
streamlit_app.py Outdated
st.divider()

st.header("Page Selection")
page_options = list(range(1, 101)) # Replace 101 with the actual number of pages + 1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this line indicates the problem with this feature... 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with your point. However, as a parameter for the library, it is an Optional List type and can be passed in the form of [1, 2, 3]. How best to show this select box in the Structure-viewer? Another idea I'm considering is to allow users to input arrays as strings. Do you have any other ideas?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No ideas, without having the pdf in advance is not possible to guess any page range

@t29mato
Copy link
Collaborator Author

t29mato commented Feb 10, 2024

@t29mato I'm not so sure, but it seems you linked the wrong issue 🤔

Thank you for letting me know.
Yes, it's supposed to be lfoppiano/streamlit-pdf-viewer#22
I've updated it.

@t29mato t29mato added the enhancement New feature or request label Feb 10, 2024
@lfoppiano
Copy link
Owner

lfoppiano commented Feb 13, 2024

I've improved the flow, and now the demo allow the selection of pages after the PDF document is loaded.
We could have a string like like in the printing form which allow also input such as 1-4, 5, and so on, but I guess for the demo is fine like this 😉

@t29mato
Copy link
Collaborator Author

t29mato commented Feb 13, 2024

Oh, you set it up to automatically fetch the page numbers on the backend. That's great. Thanks.

@lfoppiano lfoppiano merged commit 9a65d5d into main Feb 13, 2024
5 checks passed
@lfoppiano lfoppiano deleted the feature/selective-pdf-rendering branch February 13, 2024 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants