I want to keep track of changes that the user makes to annotation settings such as font color, etc. so that these are the defaults the next time the user uses the app. There is no callback to know when the user made a change in the annotations toolbar. Changes on the toolbar are not reflected in the settings such as FreeTextSettings. There is AnnotationPropertiesChanged event, but that does not give me direct access to the particular annotation that changed.
What do you think the best approach is to know when annotation properties have changed and what the current properties are of the selected annotation?
Thanks,
Arthur
|
<SfPdfViewerServer @ref="Viewer" DocumentPath="@DocumentPath" Height="640px" Width="100%">
<PdfViewerEvents AnnotationPropertiesChanged="@AnnotationPropertiesChanged"></PdfViewerEvents>
</SfPdfViewerServer>
private void AnnotationPropertiesChanged(AnnotationPropertiesChangeEventArgs args)
{
string Id = args.AnnotationId;
}
|
OK, how do I go from the AnnotationId to an actual Annotation object that I can query its properties?
Thanks,
Arthur
|
private async void AnnotationPropertiesChanged(AnnotationPropertiesChangeEventArgs args)
{
Id = args.AnnotationId;
var annotationCollection = await Viewer.GetAnnotations();
for (var i = 0; i < annotationCollection.Count; i++)
{
if (annotationCollection[i].Id == Id)
{
object annotation = annotationCollection[i];
}
}
}
|
This does give me the particular annotation. However, for Highlight, Underline, and Strikethrough annotations, the value of annotation.Color is not correct in AnnotationPropertiesChanged when I change the color of the annotation in the toolbar.
|
Blazor Client |
|
|
Blazor Sever |
|
|
Service side package |
ASP.NET Core :
https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Core.Windows/https://www.nuget.org/packages/Syncfusion.EJ2.PdfViewer.AspNet.Core.Linux/
ASP.NET MVC:
|