I’m using signature annotations (Tools.ToolNames.SIG_FORM_FIELD) to indicate locations and I need to change the text and style of each one (individually). Currently, and by default, the text is white and the background is blue.
I need custom text, black and without colored background (and i’m not talking about the indicator).
I have tried different solutions after going through the documentation but I can’t find an answer.
Hello, I’m AiRon, an automated tech support bot While you wait for one of our customer support representatives, I can help you with your question.
To edit the “Sign Here” text and style for signature annotations in WebViewer, you can customize the appearance of the signature annotations by accessing their properties. This includes changing the text, text color, and background color.
Some things you can try:
Access the signature annotation object and modify its properties such as TextColor and BackgroundColor.
Use the setContents method to change the text of the annotation.
Apply styles individually to each signature annotation by targeting them specifically through their unique identifiers.
Consider using the Annot.Style object to set custom styles for your signature annotations.
Here are some resources that might help you:
Stamp Annotations: Learn about customizing stamp annotations, which can be applied similarly to signature annotations.
We do have a way to change the styles on widgets. Please see the guide below for more information.
Please note that these style changes will not be serialized and therefore won’t be saved to the PDF document.
We also have a dedicated API for signature widgets. To update the “Sign here” element of the signature field, you can use the setCustomCreateSignHereElementHandler() API.
Annotations.setCustomCreateSignHereElementHandler(function(tool, { annotation, originalCreateSignHereElement }) {
const signHereElement = originalCreateSignHereElement(tool);
// Change background color
signHereElement.style.background = "red";
// Change the displayed text
signHereElement.innerHTML = "Hello";
return signHereElement;
});
Please note that these style changes will not be serialized and therefore won’t be saved to the PDF document.