I use TelerikPdfViewer to let my users annotate PDF documents (highlights, text boxes, drawings). Since the component only provides a built-in Download button (client-side) and not a Save to backend, I implemented a custom Save button that:
1. Calls await pdfViewerRef.GetFileAsync() to retrieve th e annotated PDF as byte[].
2. Sends the bytes to my server via a Blazor service call.
3. The server persists them to a file share with File.WriteAllBytesAsync(path, bytes).
Simplified:
<PdfViewerToolBarCustomTool>
<TelerikButton OnClick="@SaveAnnotationsAsync">Save</TelerikButton>
</PdfViewerToolBarCustomTool>
var annotatedPdf = await pdfViewerRef.GetFileAsync();
await _scanFlowApi.SaveAnnotatedDocumentAsync(documentId, annotatedPdf);
// server-side: await File.WriteAllBytesAsync(path, annotatedPdf, ct);
It works — the annotations are saved and I can reopen the file in the viewer without issues. But after saving and opening the file in Adobe Reader, closing it shows the prompt "Do you want to save the changes made to this document?" — even though the user hasn't modified anything in Adobe. The PDF seems to contain incremental updates appended at the end.