Error importing Annotations

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


1 Reply 1 reply marked as answer

DM Dhivyabharathi Mohan Syncfusion Team March 28, 2022 01:24 PM UTC

Hi Denilson, 
 
We have checked by importing and exporting the annotations using the below code snippets and the reported issue is not replicated on our end in the versions v19.4.0.52 and v19.4.0.54 . We have shared the code snippets and sample in which we tried to replicate the reported issue. 
 
 
Code snippets: 
  
<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(); 
    } 
  
 
Could you please try with the provided code snippets and let us know whether you are facing the same issue? And kindly share the code snippets and modified sample in which you are facing this issue. It will be helpful for us to investigate further and provide the solution at the earliest. 
 
 
Regards, 
Dhivya. 


Marked as answer
Loader.
Up arrow icon