Annotation Added event not firing when annotation is copy and pasted

I have the following events in my PdfViewerServer:

<PdfViewerEvents AnnotationAdded="@AnnotationAdded" DocumentLoaded="@DocumentLoaded" AnnotationRemoved="@AnnotationRemovedv2" AnnotationSelected="@AnnotationSelected" />

When an annotation is copied then pasted, it does not appear to add it correctly to the annotation listing nor does the AnnotationAdded event get triggered. 

Is there a way to prevent copy/paste or is there a workaround that I haven't found to address this issue? 



6 Replies

SK Shamini Kiruba Sobers Syncfusion Team October 14, 2021 12:10 PM UTC

Hi Tim, 
  
Thanks for contacting Syncfusion support. Please find the response for your queries from the following table. 
  
Query 
Response 
When an annotation is copied then pasted, it does not appear to add it correctly to the annotation listing nor does the AnnotationAdded event get triggered.  
We have supported to trigger the AnnotationAdded event only when the annotations are added from the annotations toolbar and not on copying and pasting an annotation. This is the current behavior in PDF Viewer. 
  
However, we will validate the feasibility to trigger AnnotationAdded event for the copied and pasted annotations too. We will share the validation details in two business days on October 18th, 2021
  
Is there a way to prevent copy/paste or is there a workaround that I haven't found to address this issue? 
You can lock the annotation to prevent editing it by setting the IsLock property to true as below. 
  
Code snippet: 
  
<SfPdfViewerServer DocumentPath="@DocumentPath" AnnotationSettings="@AnnotationSettings" Height="500px" Width="1060px"> 
</SfPdfViewerServer> 
  
@code{ 
    private string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succinctly.pdf"; 
   PdfViewerAnnotationSettings AnnotationSettings = new PdfViewerAnnotationSettings { IsLock = true }; 
} 
  
But locking the annotations prevents all the other interactions like Delete, Move, Resize, and Select too. 
  
  
Regards, 
Shamini 



TS Tim Southard October 14, 2021 01:45 PM UTC

Thank you for your reply.  Locking the annotation is not an option so hopefully your validation will provide a better option.



SK Shamini Kiruba Sobers Syncfusion Team October 15, 2021 07:50 AM UTC

Hi Tim, 
  
Thanks for the update. We will update the validation details on October 18th, 2021 as promised. 
  
Regards, 
Shamini 



DM Dhivyabharathi Mohan Syncfusion Team October 18, 2021 12:15 PM UTC

Hi Tim, 
 
 
Please find the details, 
 
 
  Query 
  Details 
 
When an annotation is copied then pasted, it does not appear to add it correctly to the annotation listing nor does the AnnotationAdded event get triggered 
 
 
We have confirmed that the reported issue “annotationAdd event is not triggered properly” 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 November 10, 2021.  
  
You can track the status using the below feedback link. 
 
 
 
Is there a way to prevent copy/paste or is there a workaround that I haven't found to address this issue? 
 
We can prevent the copy and Paste context items using the contextMenuSettings property.  Please find the code snippet and sample link below. 
 
 
Code snippet:  
     
<SfPdfViewerServer @ref="Viewer" ContextMenuSettings="@ContextMenuSettings"> 
</SfPdfViewerServer> 
 
PdfViewerContextMenuSettings ContextMenuSettings = new PdfViewerContextMenuSettings() 
    { 
        ContextMenuItems = new List<ContextMenuItem>() 
        { 
            ContextMenuItem.Highlight, 
            ContextMenuItem.Strikethrough, 
            ContextMenuItem.Underline, 
            ContextMenuItem.Comment, 
            ContextMenuItem.Delete, 
            ContextMenuItem.Properties, 
            ContextMenuItem.ScaleRatio 
        } 
    }; 
 
 
 
 
However, we can be able to copy and paste the annotation using keyboard shortcut keys. So, we have logged “Restrict keyboard shortcuts in PDF viewer” as a feature request. But we don’t have any immediate plans to implement this feature. We will include the feature in any of our upcoming releases. You can track the status using the below feedback link,  
 
 
 
 
 
 
 
Regards, 
Dhivya. 



SK Shamini Kiruba Sobers Syncfusion Team November 10, 2021 12:51 PM UTC

Hi Tim, 

Sorry for the inconvenience. Due to our Volume 3 SP release, there is no weekly NuGet release for this week. We have included the fix for the reported issue in our SP release which will be available on November 12th, 2021

We appreciate your patience. 

Regards, 
Shamini 



SK Shamini Kiruba Sobers Syncfusion Team November 12, 2021 11:29 AM UTC

Hi Tim, 
 
We are glad to announce that our Essential Studio 2021 Volume 3 Service Pack Release V19.3.0.53 is rolled out and is available for download under the following link. 
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Shamini 


Loader.
Up arrow icon