I want to detect when a user has added or removed an annotation in the PDF Viewer.
When a user invokes a Search tool, their intention is to directly write a text to search, therefore the edit for the search text should be focused immediately. In the current implementation, users have to manually focus the edit all the time, which is really inconvenient.
Related to PDF Viewer does not display editable Acro fields, which was fixed in version 8.0, but the problem with readonly Acro fields persisted.
This is a regression in version 7.0.0. Version 6.2.0 displays all the acro field values as expected.
Trying to upload a large file from a mobile device breaks the component.
Step to reproduce:
The issue can be reproduced only in version 8.0.0
The PDF Viewer fails to display the loaded document if StateHasChanged() is called when the Data parameter is set.
A possible workaround is to call await Task.Delay(...) after StateHasChanged()
Test Page (run this in a server app):
<h1>PDF Viewer Tests</h1>
<h2>Load Initially</h2>
<TelerikPdfViewer Data="@FileData1"
EnableLoaderContainer="true"
Height="30vh"
Zoom="0.75m">
</TelerikPdfViewer>
<h2>Load On Demand</h2>
<TelerikButton ThemeColor="@ThemeConstants.Button.ThemeColor.Primary"
OnClick="@( async () => await LoadPdf(2) )">Load PDF</TelerikButton>
<TelerikPdfViewer Data="@FileData2"
EnableLoaderContainer="true"
Height="30vh"
Zoom="0.75m">
</TelerikPdfViewer>
@code {
private byte[]? FileData1 { get; set; }
private byte[]? FileData2 { get; set; }
protected async override Task OnInitializedAsync()
{
await LoadPdf(1);
}
public async Task LoadPdf(int id)
{
await Task.Delay(1000);
if (id == 2)
{
FileData2 = Convert.FromBase64String(PdfBase64);
}
else
{
FileData1 = Convert.FromBase64String(PdfBase64);
}
StateHasChanged();
await Task.Delay(300);
}
private const string PdfBase64 = "JVBERi0xLjEKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0tpZHNbMyAwIFJdL0NvdW50IDEvTWVkaWFCb3ggWy00MCAtNjQgMjYwIDgwXSA+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9SZXNvdXJjZXM8PC9Gb250PDwvRjE8PC9UeXBlL0ZvbnQvU3VidHlwZS9UeXBlMS9CYXNlRm9udC9BcmlhbD4+ID4+ID4+L0NvbnRlbnRzIDQgMCBSPj5lbmRvYmoKNCAwIG9iajw8L0xlbmd0aCA1OT4+CnN0cmVhbQpCVAovRjEgMTggVGYKMCAwIFRkCihUZWxlcmlrIFBkZlZpZXdlciBmb3IgQmxhem9yKSBUagpFVAplbmRzdHJlYW0KZW5kb2JqCnhyZWYKMCA1CjAwMDAwMDAwMDAgNjU1MzUgZgowMDAwMDAwMDIxIDAwMDAwIG4KMDAwMDAwMDA4NiAwMDAwMCBuCjAwMDAwMDAxOTUgMDAwMDAgbgowMDAwMDAwNDkwIDAwMDAwIG4KdHJhaWxlciA8PCAgL1Jvb3QgMSAwIFIgL1NpemUgNSA+PgpzdGFydHhyZWYKNjA5CiUlRU9G";
}
Acro field values don't show in the PDF VIewer, although they display in the print preview dialog.
This is a regression in version 7.0.0. Version 6.2.0 displays the acro field values as expected.
===
TELERIK edit: This public item originally concerned to all Acro fields. We fixed the problem for editable Acro fields, while the fix for readonly ones can be tracked at PDF Viewer does not display readonly Acro fields
I want to have an option for digital signatures with browser-based certificate selection.
===
ADMIN EDIT
===
For the time being, you can use the following custom approach: Signing PDFs with PdfPRocessing in PdfViewer.
Hello,
we are using the PDFViewer Component.
The zoom function usually works perfectly, both on mobile and desktop.
But there is one exception.
There is one scenario, where our PO got an crash, when he try to use ANY zoom functionality of the component.
He is using:
After clicking the Print button, the pages are ordered incorrectly. Can be seen in the preview window.
Steps to reproduce:
1. Open https://demos.telerik.com/blazor-ui/pdfviewer/overview
2. Click the Print button
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?
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");
}
}
We still have some problems with printed pdf quality after the updates in 6.0.0. When pdf is printed using Telerik PDF viewer it seems it gets processed/rasterized and loses quality.