Copy/paste annotations

Hi,

Is there a way to select, copy and paste annotations in a PDF?
I have an eventhandler on the FreeTextAnnotationChanged event and can fetch the selected annotation using the e.Action == AnnotationChangedAction.Select.

private void PdfViewerControl_FreeTextAnnotationChanged(object sender, FreeTextAnnotationChangedEventArgs e)
{
if (e.Action == AnnotationChangedAction.Select)
{
_selectedAnnotation = PdfViewerControl.LoadedDocument.Pages[e.PageNumber - 1].Annotations[e.Name];
}
}​

I can also subscribe to the KeyDown event and store the _selectedAnnotation when the user presses CTRL+C. But when the user presses CTRL+V I don't know how to insert the copied annotation object into the document.

Can you tell me a way to make this work?


5 Replies

RB Rajavignesh BalaSankar Syncfusion Team March 16, 2022 05:09 PM UTC

Hi Wouter,


Currently, we do not have support to “Cut, Copy and Paste free text annotation”. We have logged a feature request for this. But we do not have any immediate plans to implement this feature. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. 


You can track the status of the feature in the below link. 

https://www.syncfusion.com/feedback/11263/support-to-cut-copy-and-paste-free-text-annotation


Regards,

Raja Vignesh.



WV Wouter van der Post March 16, 2022 06:01 PM UTC

Hello Raja,

A feature request that was added 2 years ago, will this ever be picked up?

For the time being, I can build something myself if there is an option to programmatically add a new annotation to the loaded document... is this possible?



RB Rajavignesh BalaSankar Syncfusion Team March 17, 2022 11:54 AM UTC

Hi Wouter, 
 
Sorry for the inconvenience. As we said earlier, based on our present commitments, we do not have any immediate plans to implement this feature. We can add the annotations to the PDF through loadedDocument in code behind and view it in the PDF Viewer. We have created a workaround sample to add a Free text annotation in code behind and attached below. In the sample, we have implemented the logic in a button click to achieve it at run time. In button click, we will add the annotation to the PdfViewer.LoadedDocument and save it as a memory stream. Then, we will load the stream using the PdfViewer.Load method. For adding different annotations, please refer the below UG link, 
 
Please let us know if you have any concern on this. 
 
Regards, 
Raja Vignesh. 

AddFreeText



WV Wouter van der Post replied to Rajavignesh BalaSankar March 17, 2022 03:58 PM UTC

Hello Raja,

Is it also possible to view the added annotation without reloading the whole document? We work with large PDF's that take about 5 seconds to load....



RB Rajavignesh BalaSankar Syncfusion Team March 18, 2022 06:33 AM UTC

Hi Wouter, 
 
Currently, we do not have support to “Create Annotation in the runtime using PDFViewer”. We have logged a feature request for this. But we do not have any immediate plans to implement this feature. At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest.  
 
You can track the status of the feature in the below link.  
 
Regards, 
Raja Vignesh. 


Loader.
Up arrow icon