Unable to get BringToBackItemUIAction UIAction to work

Questions, comments and suggestions concerning VintaSoft PDF .NET Plug-in.

Moderator: Alex

Post Reply
IntegraHarlan
Posts: 84
Joined: Fri Jan 24, 2020 3:37 am

Unable to get BringToBackItemUIAction UIAction to work

Post by IntegraHarlan »

Hi
I have a pop annotation that is on top of another annotation.
I am trying to set the pop annotation behind the other annotation so the other annotation can be selected.
No matter what I do, I cannot get the BringToBackItemUIAction to be enabled.
I have tried to get the BringToFrontItemUIAction and the BringToBackItemUIAction to be enabled, but the IsEnabled property is always false.
It appears that there is some criteria that is not being met.
I assume the following:
The annotation must either have focus or be in the SelectedAnnotationViewCollection.
InteractionMode must be set to edit.
For BringToBackItemUIAction to be enabled, the annotation must be in front.
For BringToFrontItemUIAction to be enabled, the annotation must be in back.

What other criteria is required?

Thanks
Harlan
Alex
Site Admin
Posts: 2305
Joined: Thu Jul 10, 2008 2:21 pm

Re: Unable to get BringToBackItemUIAction UIAction to work

Post by Alex »

Hi Harlan,

Please send us (to support@vintasoft.com) a small project, which allows to reproduce the problem. We need to reproduce the problem on our side.

Best regards, Alexander
IntegraHarlan
Posts: 84
Joined: Fri Jan 24, 2020 3:37 am

Re: Unable to get BringToBackItemUIAction UIAction to work

Post by IntegraHarlan »

I was able to figure out how to get the Send to back to work, but it is not exactly what I am looking for.
If a pop up is placed over the top of an annotation, and closed, you cannot select the annotation in edit mode, because the popup foot print is still over the annotation. I need to be able to select the annotation when the pop up is closed. We do not want the user to see the outline of a closed pop up and require them to use send to front or send to back.

Here are steps to reproduce on the C# Winform PDFEditorDemo app.
  • Add a annotation such as a line annotation.
  • Add a Reply and place it over the line annotation. Close the Reply.
  • In edit mode try to select the annotation.
You will only be able to select the reply even though it is closed.

Is there a way we can select that annotation in edit mode without having to deal with the closed popup foot print?

Thanks
Harlan.
Alex
Site Admin
Posts: 2305
Joined: Thu Jul 10, 2008 2:21 pm

Re: Unable to get BringToBackItemUIAction UIAction to work

Post by Alex »

Hi Harlan,

You need to override the PdfAnnotationTool.CanInteractWith method if you want to define custom annotation interaction logic.

Here is an example that demonstrates how to disable the interaction with PdfPopupAnnotation in Edit mode:

Code: Select all

public class MyPdfAnnotationTool : PdfAnnotationTool
{

    public MyPdfAnnotationTool(PdfJsApp jsApp, bool canUseEditMode)
        : base(jsApp, canUseEditMode)
    {
    }
    

        
    public override bool CanInteractWith(PdfAnnotationView view)
    {
        if (InteractionMode == PdfAnnotationInteractionMode.Edit && view.Annotation is PdfPopupAnnotation)
            return false;
        return base.CanInteractWith(view);
    }

}
Best regards, Alexander
IntegraHarlan
Posts: 84
Joined: Fri Jan 24, 2020 3:37 am

Re: Unable to get BringToBackItemUIAction UIAction to work

Post by IntegraHarlan »

Hi Alex,
I tried your suggestion, and it partially worked.
After applying the changes I was able to select the annotation with the mouse cursor.
However I am using the annotation tool FindAnnotationView method to select the annotation on a mouse event.
This still returns the Popup annotation view.
I would like to be able to not get the Pop up annotation view with this method.
Thanks
Harlan.
Alex
Site Admin
Posts: 2305
Joined: Thu Jul 10, 2008 2:21 pm

Re: Unable to get BringToBackItemUIAction UIAction to work

Post by Alex »

Hi Harlan,
However I am using the annotation tool FindAnnotationView method to select the annotation on a mouse event.
Please override the PdfAnnotationTool.FindInteractiveObject method and implement logic similar to the logic in PdfAnnotationTool.CanInteractWith method.

Best regards, Alexander
Post Reply