You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Tested and developed to support Firefox and Chrome.
34
34
- The legacy visualization works only on Firefox and does not support annotations
35
-
-Our JavaScript skills are limited, so all troubleshooting may take time
35
+
-This is a side project, so all troubleshooting may take time
36
36
- The component is still in development, so expect some bugs and limitations
37
37
- The streamlit reload at each action may render slowly for complex PDF documents
38
+
- Removed support showing PDF documents using the native pdf.js browser's viewer.
38
39
39
40
## Caveats
40
41
41
-
Here some caveats to be aware of:
42
+
Here are some caveats to be aware of:
42
43
43
44
- It is mandatory to specify a `width` to show PDF document on tabs and expanders, otherwise, the viewer will not be
44
45
displayed on tabs not immediately visible.
@@ -49,8 +50,7 @@ Here some caveats to be aware of:
49
50
useful).
50
51
- If you need to use all the available space and limit the height, you can encapsulate the `pdf_viewer()` into a
51
52
`st.component(width:...)` setting the width.
52
-
- The `legacy` rendering is not supported on Chrome, due to security reasons.
53
-
53
+
- The `legacy` rendering has been removed from version 0.1.x+
54
54
## Getting started
55
55
56
56
```sh
@@ -95,7 +95,6 @@ In the following table the list of parameters that can be provided to the `pdf_v
95
95
| annotations | A list of annotations to be overlaid on the PDF. Format is described [here](#annotation-format). |
96
96
| pages_vertical_spacing | The vertical space (in pixels) between each page of the PDF. Defaults to 2 pixels. |
97
97
| annotation_outline_size | Size of the outline around each annotation in pixels. Defaults to 1 pixel. |
98
-
| rendering | Type of rendering: `unwrap` (default), `legacy_iframe`, or `legacy_embed`. The default value, `unwrap` shows the PDF document using pdf.js, and supports the visualisation of annotations. Other values are `legacy_iframe` and `legacy_embed` which use the legacy approach of injecting the document into an `<embed>` or `<iframe>`. They allow viewing the PDF using the viewer of the browser that contains additional features we are still working to implement in this component. **IMPORTANT**: :warning: The "legacy" methods **work only with Firefox**, and **do not support annotations**. :warning:|
99
98
| pages_to_render | Filter the rendering to a specific set of pages. By default, all pages are rendered. |
100
99
| render_text | Enable a layer of text on top of the PDF document. The text may be selected and copied. **NOTE** to avoid breaking existing deployments, we made this optional at first, also considering that having many annotations might interfere with the copy-paste. |
101
100
| zoom_level | The zoom level of the PDF viewer. Can be a float (0.1-10.0), `"auto"` for fit-to-width, `"auto-height"` for fit-to-height, or `None` (defaults to auto-fit to width). When zoom controls are enabled, users can interactively adjust the zoom level. |
@@ -207,9 +206,9 @@ correct directory before running these commands.
207
206
npm run build
208
207
```
209
208
210
-
1. Make sure that _RELEASE = True in`streamlit_pdf_viewer/__init__.py`.
209
+
2. Make sure that _RELEASE = True in`streamlit_pdf_viewer/__init__.py`.
:param annotations: A list of annotations to be overlaid on the PDF. Each annotation should be a dictionary.
55
51
:param pages_vertical_spacing: The vertical space (in pixels) between each page of the PDF. Defaults to 2 pixels.
56
52
:param annotation_outline_size: Size of the outline around each annotation in pixels. Defaults to 1 pixel.
57
-
:param rendering: Type of rendering. The default is "unwrap", which unwrap the PDF. Other values are
58
53
:param pages_to_render: Optional list of page numbers to render. If None, all pages are rendered. This allows for selective rendering of pages in the PDF.
59
-
"legacy_iframe" and "legacy_embed" which uses the legacy approach for showing PDF document with streamlit.
60
-
These methods enable the default pdf viewer of Firefox/Chrome/Edge that contains additional features we are still
61
-
working to implement for the "unwrap" method.
62
54
:param render_text: Whether to enable selection of text in the PDF viewer. Defaults to False.
63
55
:param resolution_boost: Boost the resolution by a factor from 2 to 10. Defaults to 1.
64
56
:param zoom_level: The zoom level of the PDF viewer. Can be a float (0.1-10.0), "auto" for fit-to-width, "auto-height" for fit-to-height, or None (defaults to auto-fit to width).
0 commit comments