From 3c11c8ad5293eb061d564fa28d0b795397ebc6c7 Mon Sep 17 00:00:00 2001 From: Luca Foppiano Date: Thu, 4 Apr 2024 06:24:52 +0900 Subject: [PATCH] add notice about deprecation --- streamlit_pdf_viewer/__init__.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/streamlit_pdf_viewer/__init__.py b/streamlit_pdf_viewer/__init__.py index 058ae81b..b7ae0c3e 100644 --- a/streamlit_pdf_viewer/__init__.py +++ b/streamlit_pdf_viewer/__init__.py @@ -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, @@ -70,9 +70,12 @@ 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: + console.warn(f"{RENDERING_IFRAME} and {RENDERING_EMBED} are deprecated. " + f"They do not work consistently on all browswer " + f"and will be removed in a future release.") + if height is None: height = "100%" base64_pdf = base64.b64encode(binary).decode('utf-8')