I am working on a project where annotations need to be imported and exported. I am able to export the annotations just fine like this:
using var stream = await pdfViewer.ExportAnnotationAsStream();
using var sr = new StreamReader(stream);
selectedAnnotation.Json = sr.ReadToEnd();
However, when I import them, nothing happens. I don't see any errors and the rendered document stays the same. Here is my code for importing:
using var ms = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(selectedAnnotation.Json));
await pdfViewer.ImportAnnotation(ms);
The example provided in the
documentation uses a string to load a network resource. How should I be importing?
Thank you,
John