-
Notifications
You must be signed in to change notification settings - Fork 10
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
Support width in percentage #30 #39
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we implement the same without using an external library?
I think the default value to 40% should be removed, maybe 100% is a better default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! The height at 100% (if it's doable) would solve issue #35
@@ -33,7 +33,7 @@ In the following table the list of parameters that can be provided to the `pdf_v | |||
| name | description | | |||
|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | |||
| input | The source of the PDF file. Accepts a file path, URL, or binary data. | | |||
| width | Width of the PDF viewer in pixels. It defaults to 700 pixels. | | |||
| width | The width of the PDF viewer defaults to 100% of the layout. Specify in pixels with a numeric value, or as a percentage for relative sizing. | | |||
| height | Height of the PDF viewer in pixels. If not provided, the viewer shows the whole content. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about having height = 100% by default too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tried it and pushed it here 5443edb
But, it's outer height not inner height. The custom javascript returned 0 as value when I retrieve inner height because of iframe problem
ref: https://developer.mozilla.org/en-US/docs/Web/API/Window/outerHeight
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK forget about it, we can address the height-related issue in #41
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, do you think I should revert it? Because I've already pushed the code which supports outerHeight.
…er height which is supposed to be inner height
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please merge the main in this branch, run the tests and eventually add new ones 😅
I've merged it. |
…ercentage # Conflicts: # streamlit_pdf_viewer/__init__.py
Support #30
Maybe this is solution for #35 and #37, too.