This request is for allowing to open other document types in PDF Viewer - for example, Word, Excel. The functionality will target viewing only and not editing.
The steps to handle the scenario will be the following:Note: We've registered a bug with this solution. The PDF Viewer does not open other types of documents from the FileSelect in the Toolbar, they can be opened only on initialization of the component. Currently, the bug is in our backlog. Once fixed, the above-listed solution can be used to configure the PDF Viewer for viewing other document types. A knowledge base resource will be published on the matter.
The loading animation is visible only when a user opens a file from the Toolbar of the component. When programmatically opening a file, the loader is not shown.
Open the PDF Viewer component online demo and click the download button:
Expected - the PDF must be downloaded.
Current - the file is not downloaded.
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;
}
}
Set the PdfViewer document (data) value to null. As a result, an endless loader will appear.
===
ADMIN EDIT
===
A possible workaround for the time being is to re-initialize the component after clearing the file: https://blazorrepl.telerik.com/cHYwQola24zzBOAd02.
Pdf viewer should display form fields like Text fields, check boxes, etc and allow users to type in fields. Also support form field calculations.
Once populated, allow client side save to a file blob so that the data could be posted to a server or really whatever the dev wanted to do with it.
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