Page 1 of 1

ReadOnly PdfAnnotation is editable.

Posted: Mon Mar 23, 2020 10:34 pm
by IntegraHarlan
Hi,
If a read only PdfAnnotation is set to read only, I would expect to not be able to move or edit the annotation.
If I have a PdfAnnotation with the IsReadOnly property set to true, and the PdfAnnotationTool.InteractionMode set to PdfAnnotationInteractionMode.Edit, I am able to move and size the annotation.
Is this the correct behavior?
I would like to be able to multi select annotations, but If i try to move the selected annotations, I would expect only the ones that are read only to be movable.

Thanks
Harlan

Re: ReadOnly PdfAnnotation is editable.

Posted: Tue Mar 24, 2020 9:47 am
by Alex
Hi Harlan,

Yes, this is correct behavior.

In PdfAnnotationInteractionMode.Edit mode the PdfAnnotationTool allows to view and edit PDF annotations and PDF interactive fields.
Please read more info here: https://www.vintasoft.com/docs/vsimagin ... nMode.html

Best regards, Alexander

Re: ReadOnly PdfAnnotation is editable.

Posted: Wed Mar 25, 2020 8:50 pm
by IntegraHarlan
Thanks for the reply Alexander.
Is there a way I can select read only annotations with the InteractonMode set to Edit, but make it so that the read only annotations are not movable?
I would like to be able to select multiple annotations, but make so that if any of the selected annotations are read only, they would not be movable.

Thanks
Harlan

Re: ReadOnly PdfAnnotation is editable.

Posted: Thu Mar 26, 2020 8:39 am
by Alex
Hi Harlan,

You need to use the PdfAnnotationInteractionMode.Markup mode if you want to create, move and resize PDF annotations and read-only annotations must not be interactable.

If you still need to use the PdfAnnotationInteractionMode.Edit mode, you need to override the PdfAnnotationTool.CanInteractWith method (https://www.vintasoft.com/docs/vsimagin ... tWith.html) and override the method logic.

Best regards, Alexander

Re: ReadOnly PdfAnnotation is editable.

Posted: Fri Mar 27, 2020 6:40 pm
by IntegraHarlan
OK, maybe I am going about this the wrong way.
I am trying to multi select annotations so that I can move multiple annotations.
However, I only want to be able to move annotations that are not set to read only.
Is there a interaction mode that will let me do this?

Thanks
Harlan

Re: ReadOnly PdfAnnotation is editable.

Posted: Sat Mar 28, 2020 8:23 am
by Alex
Hi Harlan,
However, I only want to be able to move annotations that are not set to read only.
Is there a interaction mode that will let me do this?
For solving your task you need to use the PdfAnnotationInteractionMode.Edit mode and override the PdfAnnotationTool.CanInteractWith method (https://www.vintasoft.com/docs/vsimagin ... tWith.html) for changing the interaction logic with annotations. The PdfAnnotationTool.CanInteractWith method should return False for read-only PDF annotations.

Best regards, Alexander