How do I delete annotations in pdf viewer? How do I implement copy/paste?

Q:

1) How do I delete annotations: I am drawing rectangle on the page
(with PDFViewCtrl.ToolMode.e_rect_create) and want to delete it? The
annotation is deleted by page.AnnotRemove(annot).
How can the rectangle be deleted?

2) Is there a way to copy the content of rectangle or ellipse to new
pdf file: I have the position on the rectangle box and I want to copy
it to new or exists pdf file (like I can do with image file)?
-------------
A: > 1) How do I delete annotations: I am drawing rectangle on the
page (with

PDFViewCtrl.ToolMode.e_rect_create) and want to delete it? The annotation is
deleted by page.AnnotRemove(annot).
How can the rectangle be deleted?

After calling page.AnnotRemove(annot) you need to update the view
(pdfview.Update(annot)) to erase the annotation from the view.
Alternatively you may want to switch to
PDFViewCtrl.ToolMode.e_annot_edit tool mode which will allow used to
select, move, and delete any annotation object (in this case pdview
control will do all of the worek for you).

2) Is there a way to copy the content of rectangle or ellipse to new
pdf file: I have the position on the rectangle box and I want to
copy it to new or exists pdf file (like I can do with image file)?

You can implement copy and paste from one PDF to another along the
lines of ElementEdit sample project (http://www.pdftron.com/pdfnet/
samplecode.html#ElementEdit). I guess in your case you would copy only
elements whose bounding box (element.GetBBox()) intersects the
selection rectangle.