kendo-ui-core
kendo-ui-core copied to clipboard
JavaScript exceptions when using the PDFViewer with the latest PDF.js version
Bug report
Using the PDFViewer with the latest version of PDF.js (3.9.179) throws js exceptions. Version 3.4.120 is the last one, with which no js exception is thrown.
Reproduction of the problem
Dojo example: https://dojo.telerik.com/IHedIhur/3
- Open the devtools console and run the example.
Current behavior
The file is loaded, however, js exceptions are thrown:
The --scale-factor
CSS-variable must be set, to the same value as viewport.scale
, either on the container
-element itself or higher up in the DOM. text_layer.js:480:14
Expected/desired behavior
No js exceptions when using PDF.js versions newer than v3.4.120.
Environment
- Kendo UI version: 2023.2.718
- jQuery version: x.y
- Browser: [all]
Hello, before in my code I had
<div class="min-h-[400px] w-full">
{#if browser}
<Document
loadOptions={{
url: '...'
}}
>
<div>
<Page/>
</div>
</Document>
{/if}
</div>
Now I have
<div class="min-h-[400px] w-full" style="--scale-factor: 1;">
{#if browser}
<Document
loadOptions={{
url: '...'
}}
>
<div>
<Page/>
</div>
</Document>
{/if}
</div>
You can try adding style="--scale-factor: 1;"
to the container of your pdf
Reported in 1619995
Reported in ticket ID: 1630023
Reported in: 1634261
I am closing this issue because it is no longer reproducible using jszip 3.10.1 and Kendo UI 2023.3.1114. I am linking a working Dojo example - https://dojo.telerik.com/@sspasova/UqIlAtuz
Reopening, since the issue is still reproducible with PDF js versions newer than 3.4.120.
The issue is not reproducible all the time. On my side I reproduce it with https://dojo.telerik.com/@sspasova/UqIlAtuz on Chrome 122 when running the Dojo. But the issue is not reproducible on my side in Firefox or if I open the Fullscreen version of the same Dojo in Chrome https://runner.telerik.io/fullscreen/@sspasova/UqIlAtuz