-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Attach (recommended) or Link to PDF file
I'm making an informational website for company internal usage where I need to display various pdf documents as thumbnails + 1 document in full view. Every document is embedded as an iframe.
Sadly I didn't manage to get the supplied viewer.html to do exactly what I needed (no padding, no toolbar, no scroll bars, hide cursor when inactive, etc...) so I created a light weight "mini viewer" which essentially consists of modified code examples provided by you so it would render a pdf the way I need.
Right now I'm facing the problem that auto-refreshing the PDF bloats the memory usage until the site eventually crashes.
Example-iframe to reproduce the problem (without the File-parameter it will load the default example pdf):
<iframe src="./pdfjs/web/viewer_mini.html?Refresh=1" style="width:80vw; height:80vh"></iframe>The following files must be dropped in the '..\pdfjs\web' directory. Rename the viewer_mini_controls.mjs.txt to viewer_mini_controls.mjs). I added a few comments here and there trying to explain the usage if anyone is interested.
viewer_mini.html
viewer_mini_controls.mjs.txt
Web browser and its version
MS Edge 138, MS Edge 142
Operating system and its version
Windows 10 , Windows 11
PDF.js version
5.4.394
Is the bug present in the latest PDF.js version?
Yes
Is a browser extension
No
Steps to reproduce the problem
Create an HTML File with an IFrame containing the viewer_mini.html (both linked files must be dropped in the '..\pdfjs\web' directory. Rename the viewer_mini_controls.mjs.txt to viewer_mini_controls.mjs).
For accelerated testing purpose set Refresh=1 (the default PDF will be loaded and refreshed every second)
-> Watch your memory usage steadily rising.
What is the expected behavior?
The memory usage should not increase
What went wrong?
Website eventually crashes.
Link to a viewer
No response
Additional context
No response