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