I’m trying to add padding to the selection box of Signature annotations. Does anyone have an idea how to do that?
I’m calling the CreateSignatureTool method setSignature(base64Image) and add the signature to the document. After adding the signature, I select it. There is no padding around the signature, so it goes straigh to the selection border. I’m looking for a way to add some padding to it. I already tried to edit the SelectionModel.prototype.drawSelectionOutline function but it does not change the bounding box, only the visual representation of the border. I also tried to create a new Core.Math.Rect with adjusted dimensions from the original Rect of the annotation but calling annotation.setRect(newRect) didn’t help either.
Hi Wanbo, of course
As you can see in this screenshot, the selection box is touching the signature. I’d like to add a padding between the selection box and the signature without changing the image itself.
getting and setting the Rect of the annotation actually changes the dimensions of the annotation. However, it just causes the contained image to grow with the bounding rect.
I have checked with my manager, and unfortunately we don’t have a built-in API for this currently. But there’s a workaround you can try. You can create a new image with padding around it, and pass the new image to the setSignature API:
thank you very much for your solution. While I initially did not want to change the signature image itself, I must say that this simple approach works great. Maybe you can add padding as a feature wish for the future but for now this does the job