Do you have an issue with a specific file(s)? - No
Can you reproduce using one of our samples or online demos? - No
Are you using the WebViewer server? - No
Does the issue only happen on certain browsers? - No
Is your issue related to a front-end framework? - No
Is your issue related to annotations? - Yes
Please give a brief summary of your issue:
Given that the Annotations are programmatically added in the Document;
by either calling new Annotations.FreeTextAnnotation() or new Annotations.SignatureWidgetAnnotation().
const annot = isSignature
? new Annotations.SignatureWidgetAnnotation(field, options)
: new Annotations.FreeTextAnnotation()
And uploaded document has a rotation value of 90 or 270 degrees;
the annotation’s height, and width are reversed.
We were able to handle the FreeTextAnnotation since we can easily rotate them, and reverse their height, and width.
But we couldn’t easily rotate the SignatureWidgetAnnotation.
The ‘Sign Here’ has an incorrect orientation - see attachment1.
We tried manipulating the createSignHereElement, and styling the ‘Sign Here’ element with transform: rotate() but still couldn’t get the desired result.
Would like to request help on how to rotate this to look like the ones in attachment2.
Thank you for the reply.
I tried using the NoRotate property but it still doesn’t work - the same result.
Is there any method that can style or hide the grey ‘Sign Here’ ?
I also tried using the rotation property, and its innerHTML is not aligned with the selection.
To customize the signatureWidgetAnnotation’s rotation, you can edit the rotation property
To customize the styling (i.e. background), you can use the getCustomStyles method. The grey ‘sign here’ is due to the read-only affect.
Example usage of the above:
const signatureStyle = () => {
return {
border: "2px solid #008080",
backgroundColor: "lightblue",
}
};
annotationManager.addEventListener("annotationChanged", (annotations, action) => {
if (action === "add") {
annotations.forEach(function (annot) {
if (annot instanceof Annotations.SignatureWidgetAnnotation) {
// change the rotation of the widget
annot.rotation = 90;
// change the styling of the widget
Annotations.WidgetAnnotation.getCustomStyles = signatureStyle;
// make the widget read-only (will show gray 'sign here')
annot.fieldFlags.set('ReadOnly', true);
}
});
}
})
Creating a new signature field will show up like this:
Thanks for the reply.
We tried rotating the SignatureWidgetAnnotation, and it works. Thanks!
However, the SelectionModel is kinda off, it seems to be reversed.
This is how we created the SignatureWidgetAnnotation like this:
Could you try setting the rotation manually and see if that resolves the issue?
Otherwise, could you please share a minimal runnable sample project for us to reproduce?