Skip to content

Commit

Permalink
Update pdf_viewer to Handle Optional Height Parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
t29mato committed Jan 17, 2024
1 parent cd7bd9f commit 9196b85
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion streamlit_pdf_viewer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
)


def pdf_viewer(input: Union[str, Path, bytes], width="700", height="800", key=None, annotations=[]):
# pdf_viewer function to display a PDF file in a Streamlit app.
# The 'height' parameter accepts a numeric value that specifies the height in pixels.
# If 'height' is not provided, the PDF viewer will display without overflow.
def pdf_viewer(input: Union[str, Path, bytes], width="700", height=None, key=None, annotations=[]):
if type(input) is not bytes:
with open(input, 'rb') as fo:
binary = fo.read()
Expand Down

0 comments on commit 9196b85

Please sign in to comment.