Freetext annotations are not portable from UWP to Blazor

I have a UWP app where I export the annotations.  I then import those annotations into the Blazor version of the app.  If I look at the result of

object JsonResult = pdfviewer.ImportAnnotation(jsonObject);

in PdfViewerController.ImportAnnotations, it seems that the FreeText annotation is incorrectly referenced as a Signature Annotation.  I have tried a few other types of annotations and they seem to work fine.

Regards,

Arthur


8 Replies

VS Vasugi Sivajothi Syncfusion Team November 3, 2021 11:17 AM UTC

Hi Arthur, 
 
Thank you for contacting Syncfusion support. 
 
We suspect that the reported issue is due to importing improper JSON structure in the PDF document. We have handled specific structures for export and import annotations internally. So, we suggest you use the same tool to export and import annotations in the PDF document. However, please share the exported JSON data to replicate the reported issue on our end. This will be helpful to investigate further and provide the solution at the earliest. 
 
Regards, 
Vasugi. 



AB Arthur Butler November 3, 2021 12:09 PM UTC

Here is what I am doing. Is this correct? Should I be doing this differently.


In the Xamarin UWP app, I do this:

                Stream fdfStreamToSave = await _pdf_viewer.ExportAnnotationsAsync(AnnotationDataFormat.XFdf, System.Threading.CancellationToken.None);

                byte[] result;

                if (fdfStreamToSave is MemoryStream)

                {

                    result = ((MemoryStream)fdfStreamToSave).ToArray();

                }

                else

                {

                    result = readFully(fdfStreamToSave);

                }

                string annotations = Convert.ToBase64String(result); // in the real app, this will get saved in the database


Then, in PdfViewerController.cs (web service used by the Blazor app), do this where annotations is the base64 string from the UWP app which would come from the database in a real app.

     var annotations = "77u/PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjx4ZmRmIHhtbDpzcGFjZT0icHJlc2VydmUiIHhtbG5zPSJodHRwOi8vbnMuYWRvYmUuY29tL3hmZGYvIj4NCiAgPGFubm90cz4NCiAgICA8dW5kZXJsaW5lIHBhZ2U9IjEiIG9wYWNpdHk9IjAuNDk4MDM5MiIgcmVjdD0iNzEuNzYwMDYsNTk3LjQ5MTMsMjYxLjYzMDQsNjA5LjAxMTMiIGZsYWdzPSJwcmludCIgY29vcmRzPSI3MS43NjAwNiw2MDkuMDExMywyNjEuNjMwNCw2MDkuMDExMyw3MS43NjAwNiw1OTcuNDkxMywyNjEuNjMwNCw1OTcuNDkxMyIgY29sb3I9IiMwMEZGMDAiIHdpZHRoPSIxIiBib3JkZXI9IjAsMCwxIiAvPg0KICAgIDxoaWdobGlnaHQgcGFnZT0iMSIgb3BhY2l0eT0iMC40OTgwMzkyIiByZWN0PSI3MS43NjAwNyw1NzMuMTMyNiwyMjQuNzI5OCw1ODQuNjUyNiIgZmxhZ3M9InByaW50IiBjb29yZHM9IjcxLjc2MDA3LDU4NC42NTI2LDIyNC43Mjk4LDU4NC42NTI2LDcxLjc2MDA3LDU3My4xMzI2LDIyNC43Mjk4LDU3My4xMzI2IiBjb2xvcj0iI0ZGRkYwMCIgd2lkdGg9IjEiIGJvcmRlcj0iMCwwLDEiIC8+DQogICAgPGZyZWV0ZXh0IHBhZ2U9IjEiIHJlY3Q9IjQ2Ny4yMzQ2LDcwNS41NTQ0LDQ5Ni4zNzMzLDcyMy4wMTU0IiByb3RhdGlvbj0iMCIgYm9yZGVyPSIwLDAsMCIgZmxhZ3M9InByaW50IiBmcmluZ2U9IjAsMCwwLDAiIHE9IjAiIElUPSJGcmVlVGV4dENhbGxvdXQiIGhlYWQ9Ik5vbmUiPg0KICAgICAgPGRlZmF1bHRhcHBlYXJhbmNlPjAgMCAwIHJnIDwvZGVmYXVsdGFwcGVhcmFuY2U+DQogICAgICA8ZGVmYXVsdHN0eWxlPmZvbnQ6SGVsdmV0aWNhIDEycHQ7c3R5bGU6UmVndWxhcjsgY29sb3I6IzNENTlGMTwvZGVmYXVsdHN0eWxlPg0KICAgICAgPGNvbnRlbnRzPkhlbGxvPC9jb250ZW50cz4NCiAgICA8L2ZyZWV0ZXh0Pg0KICA8L2Fubm90cz4NCiAgPGYgaHJlZj0iIiAvPg0KPC94ZmRmPg==";

                            jsonObject["importedData"] = annotations;

                            object JsonResult = pdfviewer.ImportAnnotation(jsonObject);

                            return Content(JsonConvert.SerializeObject(JsonResult));



DM Dhivyabharathi Mohan Syncfusion Team November 4, 2021 05:46 AM UTC

Hi Arthur,  
 
Thank you for the update. 
 
In Syncfusion PDF Viewer control we will differentiate the signature annotation with the ink and free text annotation based on the author property. If the author value and name value do not set for the free-text annotation, then it will be considered as signature text. So, we request you to add the Author and Name properties while saving the free-text annotation to resolve the issue. 
 
Regards, 
Dhivya. 



AB Arthur Butler November 8, 2021 08:16 AM UTC

I create the annotation on the Xamarin.Forms app.  I do not see any API for setting Author in the Xamarin app.  I then import those annotations into the Blazor app.  This is where the free-text annotation gets imported incorrectly.

Regards,

Arthur



VS Vasugi Sivajothi Syncfusion Team November 10, 2021 01:23 PM UTC

Hi Arthur, 
 
Thank you for the update. Currently, we are validating the reported issue “FreeText annotations are not imported properly” in the Blazor PDF Viewer. We will analyze further on this and update you with more details on November 12, 2021. 
 
Regards, 
Vasugi. 



VS Vasugi Sivajothi Syncfusion Team November 12, 2021 02:16 PM UTC

Hi Arthur, 
 
We have confirmed that the reported issue “Free-text annotations exported from Xamarin PDF Viewer are unable to import” is a defect and logged the defect report for the same. The fix for this issue will be included in our upcoming weekly nuget release on 1st December 2021.  
  
You can track the status using the below feedback link. 
 
 
Regards, 
Vasugi 



VS Vasugi Sivajothi Syncfusion Team December 1, 2021 02:25 PM UTC

Hi Arthur,  
 
Sorry for the inconvenience. The fix for the reported issue is not included in the latest weekly release. However, it will be included in our upcoming weekly NuGet release on 8th December 2021. 
 
Regards, 
Vasugi 



SK Shamini Kiruba Sobers Syncfusion Team December 9, 2021 01:20 PM UTC

Hi Arthur, 

We have fixed the reported issue and the fix for the reported issue was included in our latest weekly release v19.3.0.57. Kindly upgrade to that version to get the issue resolved.  
    
Packages:    
    
Blazor Client     
Blazor Sever    
Service side package       
ASP.NET Core :       
        
ASP.NET MVC:       
   
 
Regards, 
Shamini 


Loader.
Up arrow icon