Please expose a parameter to show or hide the "Select files..." button inside the empty PDF Viewer.
Currently, a possible workaround is to use CSS:
<TelerikButton OnClick="@OnOpenToggle">Toggle Open Buttons</TelerikButton>
<TelerikPdfViewer Data="@PdfSource"
Class="@HideOpenClass"
Height="400px" />
<style>
.hide-open .k-blank-page,
.hide-open .k-button:has(.k-i-folder-open) {
display: none;
}
</style>
@code {
private byte[] PdfSource { get; set; }
private string HideOpenClass { get; set; } = string.Empty;
private async Task OnOpenToggle()
{
string _hideOpenClass = "hide-open";
HideOpenClass = HideOpenClass == _hideOpenClass ? string.Empty : _hideOpenClass;
}
}
When you search for a term, the document is not scrolled. Also when the user inserts a search term and clicks Enter the document is scrolled to the second match instead of the first one.
When the user scrolls the PDF Viewer down and then opens another PDF file, the new document should display on the first page. Currently, the new file displays scrolled to the page from the previous file and the user must scroll to the top manually.
===
A possible workaround is to scroll the PDF file with JavaScript in the PDF Viewer OnOpen event:
@inject IJSRuntime js
<TelerikPdfViewer Data="@PdfSource"
Height="600px"
OnOpen="@OnPdfViewerOpen"
Class="@PdfViewerClass">
</TelerikPdfViewer>
<script suppress-error="BL9992">
function scrollPdfToTop(selector) {
var pdfCanvas = document.querySelector(selector);
if (pdfCanvas) {
pdfCanvas.scrollTop = 0;
}
}
</script>
@code {
private byte[]? PdfSource { get; set; }
private string PdfViewerClass { get; set; } = "scrollable-pdf-viewer";
private async Task OnPdfViewerOpen()
{
await js.InvokeVoidAsync("scrollPdfToTop", $".{PdfViewerClass} .k-pdf-viewer-canvas");
}
}
Hello, I like the Telerik PDF Viewer for Blazor, but it's not supporting Table of Contents (TOC) links. I would like to request this feature so that there are links in the TOC automatically. I'm using Blazor WebAssembly.
Thank you for considering my request.
Nice job on Telerik, Kendo UI and Test Studio R3 2022! I like the PDF Viewer UI Controls. Question: Any plans to add annotations and comments to CLIENT-SIDE ONLY solution i.e. .NET Blazor MAUI libraries similar to this server-side only solution
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?
I would like to have access to the search option of the pdf viewer.
I have an old Asp.net framework site hosting the scanned pages (57.000) of the local newspaper from its start in May 1945 and want to rewrite it in Blazor.
One of the features is that you can search for words on all pages (using SQL Full-text indexing search on a table with all the plain texts to quickly locate the pages containing these words) and when a found page is clicked show the pdf of that page and prefill the searchbox of the pdf viewer to automatic highlight the found words).
This article gives a solution to achieve that in JS, but it would be nice if this could be done from de C# code https://www.telerik.com/forums/open-pdfviewer-with-highlighted-text
Kind regards,
Kees Alderliesten