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. Additionally, you may configure the Toolbar to not include the "Open" tool.
<style>
.no-open .k-blank-page {
display: none;
}
/* Use these selectors if you want to separately target the upload or the dropzone */
/* .no-open .k-external-dropzone,
.no-open .k-upload{
display: none;
} */
</style>
<TelerikPdfViewer Data="@PdfSource"
OnOpen="@OnPdfOpen"
Height="600px"
Class="no-open">
<PdfViewerToolBar>
<PdfViewerToolBarDownloadTool />
<PdfViewerToolBarPrintTool />
<PdfViewerToolBarSpacer />
<PdfViewerToolBarPagerTool />
<PdfViewerToolBarSpacer />
<PdfViewerToolBarZoomTool />
<PdfViewerToolBarSelectionTool />
<PdfViewerToolBarSearchTool />
<PdfViewerToolBarAnnotationsTool />
</PdfViewerToolBar>
</TelerikPdfViewer>
@code {
private byte[] PdfSource { get; set; }
private bool LoaderVisible { get; set; }
private async Task OnPdfOpen(PdfViewerOpenEventArgs args)
{
// Cancel the event for additional precaution in case someone bypasses the CSS and forces the page to show the button and the dropzone.
args.IsCancelled = true;
}
}
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