Hi Guys,
Until release 19.4.0.52 the Annotations Exported by SfPDFViewerServer.ExportAnnotationsAsObjectAsync() was imported without problems.
After release 19.4.0.54 when I try to import Annotations with SfPDFViewerServer.ImportAnnotation the Javascript console log a error on Chrome or Edge Chromium:
Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded
I'm sending the json exported by SfPDFViewerServer.ExportAnnotationsAsObjectAsync() in 19.4.0.52 release.
Thanks!
Attachment: json_exported_SfPDFViewer_b26e90cd.zip
|
<button @onclick="@OnDeleteAnnotationsClick">Delete Annotations</button>
<button @onclick="@OnExportAnnotationsAsObject">Export Annotations As Object</button>
<button @onclick="@OnExportAnnotationsAsStream">Export Annotations As Stream</button>
<button @onclick="@OnImportAnnotationsAsObject">Import Annotations As Object</button>
<button @onclick="@OnImportAnnotationsAsFileName">Import Annotations As File Name</button>
<button @onclick="@OnImportAnnotationsAsStream">Import Annotations As Stream</button>
PdfViewerAnnotationSettings AnnotationSettings;
public object annotation;
public Stream annotationStream;
async Task OnDeleteAnnotationsClick(MouseEventArgs args)
{
await PDFViewer.DeleteAnnotationsAsync();
}
async Task OnImportAnnotationsAsObject(MouseEventArgs args)
{
await PDFViewer.ImportAnnotationAsync(annotation);
}
async Task OnImportAnnotationsAsFileName(MouseEventArgs args)
{
//The json/xfdf file has been placed inside the data folder.
PDFViewer.ImportAnnotation("Blazor_Succinctly.json", AnnotationDataFormat.Json);
}
async Task OnImportAnnotationsAsStream(MouseEventArgs args)
{
await PDFViewer.ImportAnnotationAsync(annotationStream);
}
async Task OnExportAnnotationsAsObject(MouseEventArgs args)
{
annotation = await PDFViewer.ExportAnnotationsAsObjectAsync();
}
async Task OnExportAnnotationsAsStream(MouseEventArgs args)
{
annotationStream = await PDFViewer.ExportAnnotationAsStreamAsync();
}
|