Hi,
I am trying to get the properties of an annotation to display in a dialog. I can do this by getting the FocusedAnnotationView from the PdfAnnotationTool on a mouse click event.
However, when the annotation is marked as ReadOnly, The FocusedAnnotaionView is null.
Is there a way I can select a ReadOnly annotation so I can read the properties?
I am using the Winforms .Net plugin.
Thanks
Harlan
Unable to get FocusedAnnotationView from annotation with ReadOnly flag set
Moderator: Alex
-
- Posts: 85
- Joined: Fri Jan 24, 2020 3:37 am
-
- Site Admin
- Posts: 2397
- Joined: Thu Jul 10, 2008 2:21 pm
Re: Unable to get FocusedAnnotationView from annotation with ReadOnly flag set
Hi Harlan,
The PdfAnnotationTool class does not allow to interact with read-only annotation in Markup or View interaction modes. Also read-only annotation cannot be set as focused annotation in Markup or View interaction modes.
In version 9.0.0.17, which will be released this week, we will add the PdfAnotationTool.FindAnnotationView(X,Y) method, which will allow to find any annotation in specified location on image.
Here is code snippet that shows how to find annotation in mouse location:
Best regards, Alexander
The PdfAnnotationTool class does not allow to interact with read-only annotation in Markup or View interaction modes. Also read-only annotation cannot be set as focused annotation in Markup or View interaction modes.
In version 9.0.0.17, which will be released this week, we will add the PdfAnotationTool.FindAnnotationView(X,Y) method, which will allow to find any annotation in specified location on image.
Here is code snippet that shows how to find annotation in mouse location:
Code: Select all
//...
// subscribe to the AnnotationTool.MouseClick event
_annotationTool.MouseClick += PdfAnnotationTool_MouseClick;
//...
/// <summary>
/// Mouse is clicked on image in image viewer.
/// </summary>
private void PdfAnnotationTool_MouseClick(object sender, VisualToolMouseEventArgs e)
{
// get the mouse position
Point mousePosition = e.Location;
// find annotation view in mouse location
PdfAnnotationView view = _annotationTool.FindAnnotationView(mousePosition.X, mousePosition.Y);
//...
}