But when I sign the signature field, the signature annotation can move anywhere on the document. It is like that (Two signatures are showing). I try set flags for signature annotation like: locked, noMove, … But it is still moveable, It seems not to work on ios/android. Is there any way to locked the signature annotation in the signature field?
class MyAnnotEditTool : PTAnnotEditTool
{
// prevent the touches from being processwed by the tool
override func pdfViewCtrl(_ pdfViewCtrl: PTPDFViewCtrl, onTouchesMoved touches: Set<UITouch>, with event: UIEvent?) -> Bool {
// check annot properties to determine if it should be draggable
if let annot = self.currentAnnotation
{
// return true to prevent dragging
return true
}
return super.pdfViewCtrl(pdfViewCtrl, onTouchesMoved: touches, with: event)
}
// Optional function override to hide the resize widgets when selecting the annotation
override func selectAnnotation(_ annotation: PTAnnot, onPageNumber pageNumber: UInt32, showMenu: Bool) -> Bool {
let selectAnnotation = super.selectAnnotation(annotation, onPageNumber: pageNumber, showMenu: showMenu)
selectionRectContainerView.hideResizeWidgetViews()
return selectAnnotation
}
}
Android instructions:
You can disable certain annotations from dragging by first checking a condition on mAnnot before returning false in onMove . For example the current sample only prevents dragging for ink annotations. It checks whether the annotation type is Annot.e_ink and if so returns false:
You could modify this to check only for your signature stamp annotations.
This would prevent the annotation from being moved by the user.