Delete added signature


Hi,
I want to delete signature added from toolbar in case of some my logic conditions not match.
Here is my code:

But it doesn't work, the signature doesn't deleted from viewer. I also tried with CanUndoInk and UndoInk() but still not work.
What else I can try to remove the signature from viewer programmatically?

private void SfPdfViewer_OnInkAdded(object sender, InkAddedEventArgs args)
{
if (args.IsSignature /*And some more conditions*/)
{
SfPdfViewer.RemoveAnnotation(sender as InkAnnotation);
}
}

5 Replies 1 reply marked as answer

MK Muralitharan Karikalan Syncfusion Team February 4, 2021 09:29 AM UTC

Hi Dung, 
 
Greetings from Syncfusion support. 
 
To remove the signature using RemoveAnnotation API we need to provide the sender as HandwrittenSignature in the API parameter. 
 
Please find the code snippet below, 
 
private void PdfViewerControl_InkAdded(object sender, Syncfusion.SfPdfViewer.XForms.InkAddedEventArgs args) 
{ 
            if (args.IsSignature) 
            {               
                pdfViewerControl.RemoveAnnotation(sender as HandwrittenSignature); 
            } 
} 
 
 
However using RemoveAnnotation API in InkAdded event is currently not working as expected. Currently we are validating this issue and we will update the further details on February 8th ,2021. 
 
Regards, 
Muralitharan K 



MK Muralitharan Karikalan Syncfusion Team February 8, 2021 05:12 PM UTC

Hi Dung,  
   
We have confirmed that the issue RemoveAnnotation API is not working when using in InkAdded eventis a defect and logged a defect report for this issue. The patch for this issue will be delivered March 01, 2021.  
  
Please find the feedback link below,  
   
Regards,  
Muralitharan K.  



MK Muralitharan Karikalan Syncfusion Team March 1, 2021 07:02 PM UTC

Hi Dung,    
    
We have resolved the issues “RemoveAnnotation API is not working when using in InkAdded event” and the custom NuGet for the same can be downloaded from the following link.    
        
       
Disclaimer: Please note that we have created this NuGet for version 18.4.0.44 specifically to resolve the following issue(s) reported in this/the Forum 162158  
 
While resolving the issue, we found that ink annotation added event is not raised in android platform. Currently we are validating this issue. We will update the details on march 03, 2021. 
      
Note : Kindly follow the steps to clear the NuGet cache and then install patched NuGet to get the issue resolved.       
        
           
This fix will be included in our 2021 Volume 1 Service pack which is expected to available in the month of April, 2021.        
    
Regards,    
Muralitharan K.    
 



MK Muralitharan Karikalan Syncfusion Team March 3, 2021 02:08 PM UTC

Hi Dung, 
 
We will resolve and include the fix for the issue, ink annotation added event is not raised while adding the ink annotation in our upcoming weekly NuGet release which is expected to be available on March 09, 2021. 
 
Regards, 
Muralitharan K     



MK Muralitharan Karikalan Syncfusion Team March 9, 2021 10:10 AM UTC

 
Hi Dung,    
    
We have included the fix for the issue, Ink annotation added event is not raised while adding the Ink annotation in our weekly NuGet release v18.4.0.47. Kindly update to the mentioned version to resolve the issue.    
    
Please find the packages link below,    
  
Regards,    
Muralitharan K   


Marked as answer
Loader.
Up arrow icon