Duplicated
Last Updated: 16 Sep 2024 12:39 by ADMIN
Created by: RND
Comments: 1
Category: PDFViewer
Type: Bug Report
0

We're currently working on requiring a Google CASA Security Assessment, as part of this they scanned our site. 

However, the scan found an eval() function in the telerik-blazor.js file:

if(_util.isNodeJS){const worker=eval("require")(this.workerSrc);return worker.WorkerMessageHandler}

 

Is it possible to remove eval() from telerik-blazor.js?

 
Duplicated
Last Updated: 14 Feb 2025 12:05 by ADMIN

Hello together,

we are running into a problem with TelerikPdfViewer. When clicking the download button, download starts and performs properly.

BUT: the downloaded PDF file does not match the PDF that was provided via Data="@PdfData". On download something internally prepends some text to the PDF:

–€À³JS.ReceiveByteArray’Æ ‘¢%PDF-1.7
%úûüý
3 0 obj
<</ca 1.00000 /AIS false >>
endobj
5 0 obj

The original PDF file starts at "%PDF-1.7" (end of first line). That part before (including that "JS.ReceiveByteArray") was somehow added during the download workflow by Telerik. We ensured that the PDF data we provided to the viewer (via Data="@PdfData") ist valid. We did so by inspecting the byte[]-Array manually in the debugger as well as downloading it via a JS function to the client.

This is how we are using the TelerikPdfViewer. But the error occurs no matter if we are handling the OnDownload-Event (setting the filename) or not handlign that event at all (i.e. eliminating the OnDownload="@OnPdfDownload" completely)

        <TelerikPdfViewer Data="@PdfData" Width="100%" Height="100%" Zoom="1m" OnDownload="@OnPdfDownload">
            <PdfViewerToolBar>
                <PdfViewerToolBarPagerTool />

                <PdfViewerToolBarSpacer />

                <PdfViewerToolBarZoomTool />
                <PdfViewerToolBarSelectionTool />
                <PdfViewerToolBarSearchTool />

                <PdfViewerToolBarSpacer />

                <PdfViewerToolBarDownloadTool />
                <PdfViewerToolBarPrintTool />
            </PdfViewerToolBar>
        </TelerikPdfViewer>

We use Telerik.UI.for.Blazor (6.2.0).

Thanks for your feedback on this issue and best regards!

Sebastian

1 2 3 4