Restoring the widgets annot still shows "Sign here" for stamps but not for freehand

PDF.js Express Version

Detailed description of issue
When I restore (pulling it back from the DB) the annot to the SignatureWidgetAnnotation, the widget still shows a “sign here” for stamp but not for freehand.

Expected behaviour
Since the widget now have an annot, I would expect not to see the “Sign here”

Does your issue happen with every document, or just one?
All documents

Link to document
{Provide a link to the document in question if possible}

Code snippet
The code I’m using to restore.

if (fieldAnnot.type === “Sig”) {
annotManager
.importAnnotations(dbField[0].answer)
.then((impAnnot) => {
widgetAnnot.annot = impAnnot[0];
//widgetAnnot.value = impAnnot[0];
});
} else {
fieldAnnot.value = dbField[0].answer;
}

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

I’m any not be setting the annot of the signature properly to the widget.
Currently I’m doing
WidgetAnnot.annot = annotation.

You may not be able to set the .annot property directly.
It also looks as if the annotation is attached to the widget by position if there is not annotation set.

Hey there,

I will investigate shortly. Ill get back to you soon with any additional info.

Thanks!
Logan

Hey there,

I actually cannot reproduce this issue with the standard signature flow.

How are you exporting the XFDF? Is the XFDF you are importing the same XFDF that was exported from the document?

Im testing by doing the following flow:

  1. Open a document with a signature field
  2. Sign the field by clicking “sign here” and adding a signature
  3. Exporting the XFDF and saving it somewhere
  4. Reopen the original document
  5. Import the previously saved XFDF

When I reimport that XFDF, the “Sign here” button goes away as expected.

I do not need to do any of the WidgetAnnot.annot = annotation stuff to make this work.

Logan