Skip to content

Commit

Permalink
Warn on using legacy methods (#45)
Browse files Browse the repository at this point in the history
Add notice to warn people that the legacy_* methods may not work on all browsers.
  • Loading branch information
lfoppiano authored May 11, 2024
1 parent 5d6cc43 commit 16096b1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions streamlit_pdf_viewer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
)


def pdf_viewer(input: Union[str, Path, bytes],
width: int = 700,
height: int = None,
def pdf_viewer(input: Union[str, Path, bytes],
width: int = 700,
height: int = None,
key=None,
annotations: list = (),
pages_vertical_spacing: int = 2,
Expand Down Expand Up @@ -70,9 +70,11 @@ def pdf_viewer(input: Union[str, Path, bytes],
binary = fo.read()
else:
binary = input

if rendering == RENDERING_IFRAME or rendering == RENDERING_EMBED:
if height is None:
print(f"{RENDERING_IFRAME} and {RENDERING_EMBED} may not work consistently on all browsers "
f"they might disapper in future releases.")
if height is None:
height = "100%"

base64_pdf = base64.b64encode(binary).decode('utf-8')
Expand Down

0 comments on commit 16096b1

Please sign in to comment.