kendo-ui-core icon indicating copy to clipboard operation
kendo-ui-core copied to clipboard

JavaScript exceptions when using the PDFViewer with the latest PDF.js version

Open IvanDanchev opened this issue 1 year ago • 7 comments

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

  1. 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]

IvanDanchev avatar Aug 03 '23 12:08 IvanDanchev

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

HoekWax avatar Aug 09 '23 13:08 HoekWax

Reported in 1619995

alestoya avatar Aug 17 '23 14:08 alestoya

Reported in ticket ID: 1630023

nelito987 avatar Nov 07 '23 09:11 nelito987

Reported in: 1634261

zstoyanova9 avatar Dec 19 '23 13:12 zstoyanova9

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

sspasova avatar Jan 10 '24 12:01 sspasova

Reopening, since the issue is still reproducible with PDF js versions newer than 3.4.120.

IvanDanchev avatar Mar 14 '24 13:03 IvanDanchev

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

Dimitar-Goshev avatar Mar 14 '24 14:03 Dimitar-Goshev