Hallo,
i want to Render PDF Files with the PDF Viewer Component.
The Data of the PDF is already fetched from the API when the PDF-Viewer starts Rendering the Loading animation appears and freezes.
After a few Seconds the PDF will be Rendered.
The size of the PDF File is about 5MB.
Thank you Dimo! I'll be looking forward to that, this framework has been working great for us!
If anyone runs into this issues before the updated version, I found this method works decently: https://taithienbo.medium.com/displaying-pdfs-in-blazor-ca6b5de2930c (albeit not very pretty to open the pdf in an iframe)
Hi David,
Thanks for the additional information.
I think these are two separate issues. On one hand, the PDF Viewer animation freezes, but it depends on the animation type. The other animations don't exhibit the same problem with the same large file.
On the other hand, we have a performance issue, which will be fixed in our next release.
Regards,
Dimo
Progress Telerik
Hi Dimo and Nadezhda,
I am running into this issue in 2024, has the fix been added to the code?
My tests seem to show that the issue is not the loader animation, but the code that generates the PDF itself... I tried opening the "telerik.ui.for.blazor.5.1.1.pdf" from the documentation section of the Telerik Product Download page and it took over 160 seconds to finish, during which it freezes the browser due to long running javascript functions. In comparison, the https://github.com/mozilla/pdf.js script opens the same file in about 2 seconds. I'm not sure what the causes this difference or if there is a way to speed up the Telerik PDFViewer component... but just wanted to mention that.
Thank you,
David Green
Hi Thomas and Simon,
A workaround for the time being would be to not show the loader in the PDFViewer. To do so, set the EnableLoaderContainer property to "false".
I hope this suffices until the fix is available.
Regards,
Nadezhda Tacheva
Progress Telerik
Hi Demo
Would there be a workaround for this? We are having issues with this in our production application.
Thank you
Hello Simon,
I am converting your support ticket to a public bug report.
I made some experiments and found the culprit. The problem is caused by the specific CSS animation that we use in the PDF Viewer. Namely, the InfiniteSpinner loader type relies on top and left CSS style changes, while the Pulsing loader type relies on transformations. It seems that browsers stop these type of CSS animations during rendering.
You can verify this on the following REPL test page - just select some larger PDF document.
So, we can either change the loader type in the PDF Viewer, or research ways to change the animation implementation. In the meantime, please excuse us for any trouble. I hope the issue is not a major show-stopper.
Regards,
Dimo
Progress Telerik