Can't load file from RadPdfViewer

2 Answers 604 Views
Ajax PdfViewer
loic
Top achievements
Rank 1
Iron
loic asked on 16 Feb 2022, 02:17 PM

Hello, I have a RadPdfViewer in one of my pages but no matter the way I try to load a PDF, it stays hanging in the loading stage indefinitely.

It stays that way even if I try to load a Pdf by simply clicking open.

What can I do to fix this ?

2 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 18 Feb 2022, 03:11 PM

Hello loic,

Can you, please, provide a bit more details on the exact scenario in which the problem occurs?

  • Are you facing the issue in all browsers or just in specific one? If it is IE, can you ensure that it is not running in Compatibility mode?
  • Which version of the controls do you use?
  • Are you facing the same issue in our online demos here? If no - can you compare the setup of the demo with your actual one?
 

We would greatly appreciate it if you share the Fiddler Jam capture with us as it will provide most of the needed information.

To make the capture easier for you, you can use the link below that will pre-configure the extension and make the capturing process even quicker:

  • https://jam.getfiddler.com/recording-links/bf148e2e6c547955527c03f132a2288b46637e2a3f4f0b2895b6c0366be978ea385eeb8855a1594aa141b5fceec9e2ea 

Looking forward to your reply!

Regards,
Vessy
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

loic
Top achievements
Rank 1
Iron
commented on 21 Feb 2022, 08:50 AM

Hello,

  • I'm facing the issue on all browsers
  • My version of Telerik.Web.UI is 2022.1.119.45
  • I'm not facing the issue on the telerik website, but when I paste the demo page in my project I have the same issue

 

Here's the fiddler jam capture :

https://jam.getfiddler.com/spaces/74e26b9d-6f6d-4f05-afa6-442f060ffe39/7d8827cd-d7c8-4fc3-a868-8e9484ead0c6?pt=92d9fbbf3e1b34473e4171a7261a924eb59434e0baa05b11de85621c738a2640c7e6d5182a35404384fd584938bafaae

0
Vessy
Telerik team
answered on 21 Feb 2022, 06:34 PM

Hi loic,

Thanks a lot for the provided Fiddler log.

RadPdfViewer is based on the PDF.js library so it will be registered on the page in order for the control to be able to function. Please, add the below highlighted script to the page and let me know what the result is:

<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.worker.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <script type="text/javascript">
        window.pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.worker.js';
    </script>
    <div class="demo-container size-wide no-bg" runat="server">
        <telerik:RadPdfViewer runat="server" ID="RadPdfViewer2" Height="550px" Width="100%" Scale="0.9">
            <PdfjsProcessingSettings File="../Document.pdf">
            </PdfjsProcessingSettings>
        </telerik:RadPdfViewer>
    </div>

 

Regards,
Vessy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

michael
Top achievements
Rank 1
commented on 20 Apr 2022, 11:11 AM

Loic, Vessy,

Have you made any progress on this? I am having the same problem.

It was always slow, but used to work just fine but seems to have stopped fairly recently (not sure if it was the last update of the ASP JAX library or one prior). Did anything change in the Library that perhaps I needed to update in my code?

Mike

Vessy
Telerik team
commented on 21 Apr 2022, 01:30 PM

Hi michael,

There are some important updates introduced in the latest version of the PDF.js library. Can you, please, try loading the Pdf viewer with the latest version of the PDF.js like shown below and see what the result will be?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.13.216/pdf.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.13.216/pdf.worker.js"></script>
    <script type="text/javascript">
        window.pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.13.216/pdf.worker.js';
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <div>
            <telerik:RadPdfViewer ID="pdfViewer" runat="server">
                <PdfjsProcessingSettings File="Employee Performance Evaluation Jan 2022.pdf" />
            </telerik:RadPdfViewer>
        </div>
    </form>
</body>
</html>

Tags
Ajax PdfViewer
Asked by
loic
Top achievements
Rank 1
Iron
Answers by
Vessy
Telerik team
Share this question
or